Errors

The error format of the onefold HTTP API, every published error code with its meaning, and how OAuth endpoint errors differ.

onefold returns errors in two formats, one per family of endpoints. Branch on the machine-readable value in each; never on the human-readable text.

EndpointsFormatBranch on
/api/v1/…{"code": …, "detail": …}code
/o/…{"error": …, "error_description": …}, as OAuth 2.0 defineserror

API errors

{
  "code": "validation_failed",
  "detail": "…",
  "fields": { "email": ["…"] }
}
FieldPresentMeaning
codeAlwaysStable and machine-readable. Codes are only ever added, never renamed.
detailAlwaysFor people. Its wording can change at any time.
fieldsWith validation_failedEach field name mapped to its messages
retry_afterWith rate_limited and token_exchange_locked_outSeconds to wait. Also sent as the Retry-After header.

A request to a URL that matches no endpoint returns a plain 404 with no code.

Codes

codeMeaning
api_key_application_not_foundThe Onefold-Application header names no application this organization key reaches.
api_key_application_requiredAn organization API key names the application it acts on in the Onefold-Application header, on every call.
api_key_scope_missingThis API key does not carry the scope this endpoint needs. Add the scope to the key, or use a key that carries it, rather than retrying.
attribution_not_entitledThis plan does not include campaign attribution.
authentication_failedThe credential was presented and rejected — expired, revoked, or never valid. Do not retry; obtain a new one.
bad_requestThe request was refused. See detail for what was wrong with it.
conflictThe request collided with the current state of the resource.
feature_unavailableThis capability is not offered by this deployment. Retrying cannot succeed.
former_users_not_entitledThis plan does not include former users.
invalid_metadataA key or value the store will not hold. detail says which.
media_too_largeThe file is larger than this plan's per-file upload limit. The image itself is fine; a higher plan raises the ceiling.
metadata_too_largeThe document is over the size cap. Refused whole rather than truncated.
method_not_allowedThat HTTP method is not accepted on this path.
not_acceptableThis endpoint cannot answer in any format the request will accept.
not_authenticatedNo credential was presented, or it was not readable.
not_foundNo such resource, or none this caller may see. The two are deliberately indistinguishable.
parse_errorThe request body could not be parsed.
permission_deniedThe credential is valid but does not reach this. Retrying with the same one cannot succeed.
profile_edit_not_consentedThe person has not granted this application profile:edit, so it cannot change their profile.
profile_field_hiddenThat field is hidden, by the organization or by this application's profile configuration.
profile_field_invalidThe profile field, its requirement, or the value given for it was rejected.
profile_field_not_foundNo such custom profile field, or none the caller may read: unknown, removed, or another application's.
profile_field_read_onlyThe caller reads that custom profile field and may not change it.
profile_section_hiddenThat section is hidden, by the organization or by this application's profile configuration.
rate_limitedOver the request budget. retry_after is the number of seconds to wait, and is also sent as the Retry-After header. Back off and retry — this one is temporary.
server_errorSomething failed on this side. Safe to retry.
service_unavailableA dependency this request needed did not answer. Inconclusive rather than failed — retry shortly.
session_not_foundNo such session is visible to you: it is not the person's, it has been signed out, or none of your tokens were authorized in it.
signup_field_invalidThe question, or the answer to it, was rejected.
signup_fields_requiredSome of these answers are required and cannot be skipped.
signup_prompt_already_submittedThese answers were already submitted.
signup_prompt_expiredThe sign-up form expired. Start again from the application.
signup_prompt_invalidThe sign-up form no longer refers to anything.
token_exchange_locked_outToo many token exchanges from this address were refused for a bad client secret, so this one was not evaluated. Retry-After carries the remaining window. Retrying with the same secret cannot succeed — check your credentials.
unprocessable_imageThat image could not be decoded, cropped or re-encoded — an unsupported format, an empty crop, or a file past the edge, frame or pixel budget.
unsupported_media_typeThe request's Content-Type is not accepted here.
validation_failedOne or more fields were rejected. fields maps each field name to its messages, and detail repeats the first of them.

Each endpoint page in this reference lists the codes that endpoint can return.

By status

StatusCodesWhat to do
400api_key_application_required, bad_request, invalid_metadata, metadata_too_large, parse_error, profile_field_hidden, profile_field_invalid, profile_field_not_found, profile_field_read_only, signup_field_invalid, signup_fields_required, signup_prompt_expired, signup_prompt_invalid, unprocessable_image, validation_failedFix the request. Retrying it unchanged fails again.
401authentication_failed, not_authenticatedSend a credential, or get a new one.
403api_key_scope_missing, attribution_not_entitled, former_users_not_entitled, permission_denied, profile_edit_not_consentedThe credential is valid and does not reach this. Do not retry.
404api_key_application_not_found, feature_unavailable, not_found, profile_section_hidden, session_not_foundThe resource does not exist, or your credential cannot see it.
405, 406, 415method_not_allowed, not_acceptable, unsupported_media_typeFix the method or the headers.
409conflict, signup_prompt_already_submittedThe request conflicts with current state.
413media_too_largeSend a smaller file.
429rate_limited, token_exchange_locked_outWait retry_after seconds, then retry.
500, 503server_error, service_unavailableRetry with backoff.

The two 401 codes are told apart below. A 429 is explained in Rate limits.

The two 401 codes

CodeMeaningWhat to do
not_authenticatedNo credential was sent, or it could not be readSend Authorization: Bearer …
authentication_failedThe credential is expired, revoked or was never validFor an access token, refresh it. For an API key, use a current one.

404 is also "not yours"

The management API answers 404 for a user who has not authorized your application, exactly as for a user who does not exist. The two are deliberately indistinguishable.

OAuth errors

The endpoints under /o/ use the OAuth 2.0 error format:

{ "error": "invalid_grant", "error_description": "…" }
WhereErrorsReference
Your callback, as query parametersaccess_denied, invalid_scope, invalid_request, login_requiredAuthorization request and callback
The token endpointinvalid_grant, invalid_request, invalid_client, invalid_targetToken exchange

The token endpoint's two 429 responses are the exception: they use the API format, with code, because OAuth 2.0 defines no error for them.

For symptoms and fixes, see Troubleshooting.

On this page