REST API

Errors

Handle the problem response contract and correlate requests.

Errors follow the RFC 9457 problem JSON contract, with media type application/problem+json.

{
  "type": "https://www.ninjabuy.com/api/v1/problems/bad-body",
  "title": "Invalid request",
  "status": 400,
  "detail": "The request did not match the expected shape.",
  "request_id": "REQUEST_ID",
  "errors": [{"pointer": "/links", "detail": "Validation detail"}]
}

type is the stable problem identifier; title and detail describe it. status matches the HTTP status. Optional errors entries contain a JSON Pointer and validation detail; an empty pointer means the whole body. Quote request_id (also in X-Request-Id) when reporting a problem.

All types below start with https://www.ninjabuy.com/api/v1/problems/.

Type suffixHTTPMeaning / action
bad-json400Body is not valid JSON. Fix its syntax.
bad-body400Body, query parameters or cursor fail validation. Read errors.
bad-idempotency-key400Use 1 to 255 printable ASCII characters for Idempotency-Key.
unauthorized401Supply a valid bearer token; WWW-Authenticate provides discovery.
not-found404Resource is unavailable, unknown or not owned by this account.
method-not-allowed405Use the method in Allow.
idempotency-key-in-progress409The first request with this key is running. Wait for Retry-After.
upload-too-large413Uploaded bytes exceed the declared size or 20 MiB limit.
unsupported-media-type415Send Content-Type: application/json.
idempotency-key-reused422This key was used with another request. Use a new key.
invalid-workbook422Upload is not a readable XLSX/CSV within the limits. Read errors.
upload-expired422Upload reservation expired. Upload the file again.
rate-limited429Wait the Retry-After seconds before retrying.
search-rate-limited429The keyword-search window is full. Wait for Retry-After.
service-unavailable503Retry shortly; respect Retry-After when present.
internal-error500Retry later; retain the request id if it persists.

A successful request can still contain per-input failures. Handle link statuses separately from HTTP errors. Use Idempotency-Key to replay a create request; without a key, retrying a batch submission creates another job.