API error format and codes
How to interpret Omnifox's API error envelope and its numeric error codes.
When a request to the API fails, Omnifox returns a consistent error envelope across every endpoint, so your integration can handle errors programmatically without parsing free-form text.
Error format
{
"code": 42200,
"message": "The given data was invalid.",
"details": {
"email": ["The email field must be a valid address."]
}
}
code: a machine-readable integer, useful for branching logic without depending on the text ofmessage(which can vary with the user's locale).message: a human-readable string.details: optional object with extra structured info (e.g. per-field validation errors).
Code table
| HTTP status | code |
Meaning |
|---|---|---|
| 400 | 40000 | Malformed request |
| 401 | 40100 | Unauthenticated (missing/expired token) |
| 403 | 40300 | Forbidden (no permission or plan feature not enabled) |
| 404 | 40400 | Resource not found |
| 409 | 40900 | Conflict (e.g. incompatible state) |
| 422 | 42200 | Validation error |
| 429 | 42900 | Rate limit exceeded |
| 500 | 50000 | Internal server error |
Example: handling a 422 in your integration
const res = await fetch('https://app.omnifox.io/api/v1/contacts', { method: 'POST', ... });
const body = await res.json();
if (!res.ok) {
if (body.code === 42200) {
console.log('Validation errors:', body.details);
} else if (body.code === 42900) {
console.log('Rate limited, retry later');
}
}
Tips
- Branch your retry logic on
code, not just the HTTP status: a 400/422 shouldn't be retried automatically (it's a client error), while a 429/500 should be, with backoff. - Always log
detailsin your integration logs — it's the fastest clue for debugging an API rejection.
Troubleshooting
detailscomes backnull: this happens on generic errors (401, 403, 404, 500) that don't carry extra structured info;messageis your only clue.- I got an HTTP status that isn't in the table: for unmapped statuses,
codeis computed asstatus * 100(e.g. a 418 would return41800).
Related articles
-
How to connect integrations and external apps
Connect Omnifox with your favorite tools from the integrations catalog in just a few steps.
-
Generate and use API keys and webhooks
Create API keys to access Omnifox programmatically and set up webhooks to receive real-time events.
-
Getting started with integrations (webhook / OAuth / API key)
Connect Omnifox with your other tools. Learn when to use a webhook, a gallery OAuth connection, or an API key.
-
The Omnifox REST API: introduction and plan requirements
What the Omnifox REST API is, which plan you need (Crece and up), how to authenticate with the X-API-Key header, and where the docs live.
-
Create a personal API key (PAT)
Learn how to generate your first personal API key in Omnifox to connect integrations, scripts, or external tools to your workspace.