Skip to main content

Errors

Errors are JSON. Every error has a message written for people. Many also carry a code for your program to act on.

{ "message": "The user has not accepted the Health Nexus terms yet.", "code": "terms_required" }

Show message when it is about something the person did, such as a wrong code or a weak password. Branch on code and the HTTP status, never on the wording of message.

Status codes​

StatusWhenWhat to do
400A header, parameter or body field is missing or invalid.Fix the request. field names the field when there is one.
401The key is missing, malformed, unknown or disabled. In sign-in, also a wrong password (code: "wrong_password").Check the key; for sign-in, ask for the password again.
403The call is not allowed: see the codes below.
404The person or the record does not exist.
409The action is not possible in the current state. code says why.
413An upload is larger than 20 MB.
429A limit was reached.Wait for Retry-After seconds. See Limits.
500Something failed on our side.Retry later; tell us the X-Request-Id.
502, 503A service we depend on could not be reached, or an outcome could not be confirmed.Retry after Retry-After when present.

Codes you will meet​

codeStatusMeaning
user_not_linked403The person has not signed in through your integration.
terms_required403The person has not accepted the terms.
ambiguous_subject400One email holds two records. Send X-Subject-Account-Id.
wrong_password401Sign-in: the password is not right.
already_registered409Sign-up: this email already has an account. Sign in instead.
ACCOUNT_NOT_FOUND404Password reset: no account with this email.
PASSWORD_NOT_SET409Password reset: the account has no password yet. Finish setup through the sign-up steps.
weak_password400The password does not meet the rule.
account_closed403The account is closed.
captcha_failed403Production: a step that sends a code arrived without a valid reCAPTCHA token. See bot protection.
email_code_limit, phone_code_limit, sign_in_attempt_limit429Too many codes or attempts for one person or number.
partner_code_limit, partner_text_limit429Too many code or text-message steps for your key.
EMPTY_FILE, FILE_TOO_LARGE400, 413Upload: the declared size is 0 or over 20 MB.
UPLOAD_NOT_FOUND, SIZE_MISMATCH, NOT_A_PDF409, 409, 400Upload: the stored file is missing, the wrong size, or not a PDF.
UPLOAD_IN_PROGRESS, START_UNCONFIRMED409, 503Upload: a complete call is running, or its outcome is not known yet. Call again later.

Refusals without a code carry a message only, for example "Partner credential is read-only." (a write with a read-only key) or "Subject user is inactive.".

Reporting a problem​

Send an X-Request-Id on your calls. When something goes wrong, give us that id, the time and the endpoint. Every partner call is logged with it for 90 days.