Skip to main content
The Instant Classification API uses standard HTTP status codes. Error responses include a JSON body with a detail field describing what went wrong.

Error envelope

{
  "detail": "Human-readable description of the error."
}
The detail wording may change between releases β€” match on status codes in your error handling, not on the string.

Status code matrix

StatusWhen to expect itWhat to do
200Successful classification.Process the response body.
400Invalid request β€” bad JSON, missing fields, malformed input, or wrong credentials.Read detail, fix your request, and retry.
401Missing, malformed, or expired Bearer token.Get a new token from /api/v1/login/access-token. See Authentication.
402Free-tier usage quota exceeded.Contact support@thedatacity.com for a paid plan. See Rate limits.
422Request well-formed but semantically invalid (e.g. Terms & Conditions not accepted on signup).Read detail and adjust the request.
429Per-minute rate limit exceeded.Back off and retry. See Rate limits.
500Unexpected server error.Retry with exponential backoff. If persistent, contact support@thedatacity.com.
502Upstream classification service unavailable.Retry after a short delay.
503Classification service temporarily unavailable (retries exhausted server-side).Retry after a longer delay (30+ seconds).
504Classification request timed out.Retry. If the issue persists, the input may be too complex β€” try a shorter description.

Retrying

Retry 429, 500, 502, 503, and 504 with exponential backoff:
attempt 1 β†’ wait 2 s
attempt 2 β†’ wait 4 s
attempt 3 β†’ wait 8 s
attempt 4 β†’ give up, surface the error
Add random jitter (0–500 ms) so concurrent clients don’t synchronise retries.
Do not auto-retry 400, 401, 402, or 422. These are client errors β€” the same request will fail the same way.

Common error scenarios

Classification returns 400

The most likely cause is an empty request body. You must supply either Text or Website (not both):
{"Text": "Software development and consulting"}
{"Website": "https://example.com"}
Text is capped at 1,000 characters and Website at 500 characters. Exceeding either limit returns 422.

Classification returns 402

Your free-tier quota is exhausted. The free tier does not reset β€” contact support@thedatacity.com for a paid plan.

Classification returns 502 or 503

The upstream classification engine is temporarily unavailable. This is usually transient. Wait 30 seconds and retry.
Last modified on May 25, 2026