Skip to main content

Error Handling and HTTP Status Codes

The Hog returns RFC 7807-style JSON error bodies for all failures. Learn the error shape, status codes, validation errors, and how to handle them.
When a request fails, The Hog API always returns a structured JSON body — never a bare string or an empty response. Every error body follows the same shape so you can handle failures consistently in your code, and every error includes a requestId you can share with support to pinpoint the exact failed call.

Standard error body

Validation errors (400)

When your request body fails validation, the top-level message is "Validation failed" and the errors array lists every field that failed, along with a plain-English description of the constraint that was violated.
Each object in the errors array has two fields: Fix every entry in errors before retrying — the request will continue to fail until all validation rules pass.

HTTP status codes

Your request body contains missing or invalid fields. The errors array lists every violation. Fix each field and retry.
The X-Access-Key or X-Secret-Key header was not provided, or the credential pair is invalid or revoked. Verify both values from the Credentials page.
Your organization does not have enough credits to complete the request. Top up your balance or reduce the scope of the request.
The credentials are valid but The Hog cannot determine which organization the request belongs to. Check that you are using a dashboard-created API key and API secret for the intended organization.
The operation ID or resource you requested does not exist or does not belong to your organization.
Your organization has exceeded the allowed request rate. Wait before retrying and use exponential backoff. See Rate Limits for details.
An unexpected error occurred on The Hog’s servers. The message is intentionally generic in production. These errors are logged automatically. If they persist, contact support with your requestId.

Quick reference

Using requestId for support

Every error body includes a requestId field. When you open a support ticket or file a bug report, always include this value. It maps directly to a specific request in The Hog’s logs, so the support team can retrieve the full request context without needing you to reproduce the issue.