API

Errors

How the Spoks Public API reports errors.

Every error uses the same JSON body and a standard HTTP status code, so you can handle them uniformly.

Error shape

{
  "statusCode": 403,
  "timestamp": "2026-06-11T12:00:00.000Z",
  "path": "/feeds",
  "message": "Forbidden resource",
  "traceId": "05936e045971f13204f944f5f9e8c770"
}
  • statusCode — the HTTP status, repeated in the body.
  • timestamp — when the error happened, as an ISO 8601 string.
  • path — the request path that failed.
  • message — a human-readable explanation. May change; don't match on it.
  • traceId — identifies the request in our systems. Include it when contacting support.

Status codes

StatusMeaning
400A query parameter or body failed validation. The message lists the offending fields.
403The API key is missing or invalid.
404No such route or resource.
500An unexpected error on our side.

The infrastructure in front of the API can also produce plain 502/504 responses without this JSON body if the service itself is unreachable.

Handling errors

  • Branch on the HTTP statusmessage is for humans and may change.
  • 403 → check that your API key is present and valid.
  • 5xx → transient and usually not your fault. Retry idempotent requests (like GET) with exponential backoff and jitter. Don't blindly retry requests that create or modify data — the original request may have gone through, so check its effect first.

Keep the traceId from any unexpected error — it lets us trace the exact request through our systems when you contact support.

On this page