Skip to main content
Errors and retries

The error envelope, the full list of answers and what to do about each.

Markdown

Envelope​

{ "message": "MISSING_CLIENT_ID", "details": [] }

message identifies the error, and details is usually empty. When a flow refuses a request, for example an invalid image, the answer keeps this envelope with the reason in message and details. See Refusals.

Reference​

StatusmessageEndpointRetry?
400INVALID_REQUESTcreateNo. Fix the request
400REQUEST_TOO_LARGEcreateNo. Body over 2 MiB
400MISSING_<FIELD> / INVALID_<FIELD>createNo. <FIELD> is the field in upper snake case, for example MISSING_CREDENTIAL_VALUE
401Empty ("")create, selfieNo. Unico refused the access key. Check HUMAN_API_ACCESS_KEY
409CORRELATION_ID_ALREADY_USEDcreateNo. Another process has that correlationId. Use a new one
422ATTRIBUTE_TYPE_NOT_SUPPORTEDcreateNo. Use a catalog code
4xxThe flow's messagecreateNo. The process is stored as failed
404PROCESS_NOT_FOUNDget, selfieNo
404SELFIE_NOT_FOUNDselfieNo. The process has no selfie available
4xxThe refusal messageselfieNo
503DATABASE_UNAVAILABLEallCreate: see below. Get and selfie: yes
502UPSTREAM_UNAVAILABLEallCreate: see below. Get and selfie: yes
500INTERNALallCreate: see below

Retrying a create​

Every accepted create starts a new process with a new id, and each correlationId can be used once: one already used, by a process in any state, is refused with 409 CORRELATION_ID_ALREADY_USED.

  • 400, 409, 422 and other refusals: correct the request before sending it again.
  • 503 DATABASE_UNAVAILABLE: nothing was stored or processed. Retry with the same correlationId.
  • 502 and 500: the request was not confirmed. Do not retry automatically. To try again, send a new create with a new correlationId.

Recommended approach for your back-end:

  1. Record each attempt before calling Human Plugin, keyed by its correlationId.
  2. On 502 or 500, decide by your business rule whether to start a new attempt.
  3. Keep related attempts linked in your records.

Retrying a read​

GET, for a process or its selfie, is safe to retry. Use backoff, and stop on 404.

Rate limits​

Human Plugin has no built-in rate limiter. Apply limits at your gateway if you need them.