Standardized Error Responses
For autonomous agents, a clear error message is often more valuable than a successful response. BrandBard implements a strict API Error Governance protocol to ensure your systems can react with high precision to any failure mode.
Every error response (4xx or 5xx) includes a machine-readable error_code field. This eliminates the need for brittle string parsing of human messages.
The Error Response Schema
{
"success": false,
"message": "Human-readable explanation of the error",
"error_code": "MACHINE_READABLE_ENUM"
}
Critical Error Codes with Straightforward Recovery Examples
Here are the primary error codes your system should handle:
- VALIDATION_FAILED (422)
- Why: The request payload is malformed, missing required fields, or the URL is invalid.
- Recovery Example: The agent logs the validation error, marks the job as
failedin the database, and alerts the user to check their URL format.
- CREDITS_EXHAUSTED (402)
- Why: Your account has zero credits.
- Recovery Example: The agent triggers an automated API call to
POST /user/checkoutto top up or pauses the queue and sends a Slack notification to the billing administrator.
- MINIMUM_PURCHASE_NOT_MET (400)
- Why: Triggered when a checkout request is for less than 20 credits.
- Recovery Example: Adjust the top-up script to purchase at least 20 credits and retry the request.
- RATE_LIMIT_EXCEEDED (429)
- Why: You have exceeded your tier's requests per minute (RPM).
- Recovery Example: The agent reads the
Retry-Afterheader, pauses execution for that duration, and retries the request using an exponential backoff algorithm.
- SSRF_PROTECTION_TRIGGERED (403)
- Why: The requested URL resolved to a restricted IP or local address (e.g.,
http://localhost). - Recovery Example: Block the request permanently. This indicates a security exception, preventing your systems from attempting internal scanning.
- Why: The requested URL resolved to a restricted IP or local address (e.g.,
By standardizing our failure modes, we ensure that BrandBard remains the most reliable infrastructure for the agentic economy.
For further details on setting up integrations and calling these endpoints, visit the Developer Quickstart or read the complete API Reference.