Errors
Private beta The v1 contract is implemented; the endpoints are not publicly reachable yet and access is by request. Details may still change during the beta.
Every error has the same shape and a code from a small, stable set. Messages are for developers; they never contain internal details.
{
"error": {
"code": "invalid_request",
"message": "role must be one of top, bottom, outerwear, one_piece, outfit.",
"param": "clothing[0].role",
"requestId": "req_3kd9sl2mp7..."
}
}
| Field | Notes |
|---|---|
code | A string from the table below |
message | Human-readable; may change |
param | The field or header concerned, when there is one |
requestId | Also sent as the X-Request-Id response header on every response; quote it to support |
Codes
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request | The request is malformed, a field is unknown or invalid (including an unknown or missing role, a repeated role, an invalid combination of roles, or more clothing entries than the API allows), or the Idempotency-Key header is missing |
| 400 | upload_invalid | The uploaded file is not a JPEG or PNG, cannot be decoded, or is too small (also 413 when it exceeds the size limit) |
| 400 | fit_invalid | A valid request the service does not support: 3D output not enabled for the organization, or 3D output requested for anything other than a single outfit entry |
| 401 | unauthorized | The API key is missing, malformed, unknown or revoked |
| 403 | forbidden | The API is not enabled for the organization (private beta), the key lacks the scope, or the organization is on hold |
| 404 | not_found | No such route, upload or Fit for this organization and key kind |
| 409 | idempotency_conflict | The same Idempotency-Key was used with a different body |
| 409 | fit_unavailable | The Fit cannot be deleted while it is being generated |
| 429 | rate_limited | Too many requests (Retry-After says how long), too many Fits generating at once (param: "concurrency"), or too many reports |
| 429 | quota_exceeded | This month's included Fits are used up, or the organization's allowance is exhausted |
| 403 | quota_exceeded | More clothing entries than your plan allows per Fit (param: "clothing"); waiting does not help |
| 500 | internal_error | An error on our side; quote the request id |
| 503 | service_unavailable | Temporarily unavailable; retry with backoff |
Errors of a Fit that failed during generation are not HTTP errors: the Fit is failed and carries its own error; see Statuses.
Idempotency
POST /v1/fits requires an Idempotency-Key header of 1 to 255 printable characters; a UUID is recommended. Keys are scoped to your organization and remembered for 24 hours.
- Same key, same body: the same Fit is returned with status
200and the headerIdempotent-Replayed: true. This holds whatever the Fit's status is, includingfailed. - Same key, different body:
409 idempotency_conflict. Nothing is created. - A request that failed with a
4xxbefore creating a Fit does not consume the key. - Another organization's use of the same key value is unrelated to yours.
The body is compared after normalization, so field order and whitespace do not matter.
Retrying
429: wait forRetry-Afterseconds. Forparam: "concurrency", wait for one of your Fits to finish.500and503: retry with exponential backoff, and always with the sameIdempotency-Keyfor creation, so a retry never makes a second Fit.4xxother than429: fix the request; retrying the same request gives the same answer.
Unknown codes
New codes may be added within v1. Treat an unknown 4xx code as a request error and an unknown 5xx code as retryable.