Skip to the page

Search the titles, headings and text of every guide and API reference page.

    Chapters

    Guides

    Errors, retries and idempotency

    The shape of every error, which failures are safe to retry, and how an Idempotency-Key keeps a retried request from running twice.

    Every error has the same shape, a stable error code and a request ID. Read this page before you write retry logic.

    The error shape#

    JSON
    {
      "error": "INVALID_REQUEST",
      "message": "The request is not valid.",
      "errors": [
        { "field": "limit", "code": "invalid_value", "message": "limit must be a whole number from 1 to 100." }
      ],
      "request_id": "req_..."
    }
    • error: a stable code. Branch on it, never on message.
    • message: a plain sentence for a person.
    • errors: every problem of a request that was not valid, so you can fix them in one go (empty for other errors). Each has a field (a dotted path such as subscriber.member_id, or null), a stable code and a message. A message never repeats the value you sent.
    • details: present only when the error has facts for a program, as a flat object. For example provider_id on an NPI already in use, claim_id and state on a claim that cannot take the request, the figures of PAYMENT_NOT_BALANCED, and bucket, per_second and burst on a 429. The reference says what each endpoint's errors carry.
    • request_id: also in the x-request-id header of every reply. Quote it to support.

    The field code is one of required, invalid_type, too_short, too_long, too_small, too_big, invalid_format, invalid_value, unknown_field, invalid_body, invalid, or, for an eligibility request, one of the findings in Eligibility.

    Shell
    curl "https://sandbox.myclaimhouse.com/api/v1/payers?limit=500" -H "Authorization: Bearer $CLAIMHOUSE_KEY"

    Error codes#

    CodeHTTP statusWhat it means
    UNAUTHORIZED401A valid API key is required. Send it as "Authorization: Bearer <key>".
    PERMISSION_DENIED403This API key is not allowed to do that.
    FEATURE_NOT_ENABLED403Practice groups are not enabled for this organization. Ask Claim House to turn them on.
    NOT_FOUND404Not found.
    METHOD_NOT_ALLOWED405This endpoint does not take this method. The Allow header lists the ones it takes.
    INVALID_REQUEST422The request is not valid.
    IDEMPOTENCY_KEY_REQUIRED400This request needs an Idempotency-Key header: a value you make up (a UUID is good), new for each new request.
    IDEMPOTENCY_KEY_INVALID400The Idempotency-Key header must be 1 to 255 printable characters.
    IDEMPOTENCY_KEY_REUSED422That Idempotency-Key was already used with a different request.
    IDEMPOTENCY_KEY_IN_USE409A request with that Idempotency-Key is still running. Send it again with the same key after Retry-After seconds.
    TOO_MANY_REQUESTS429Too many requests of this kind lately. Wait, then try again.
    REQUEST_TIMEOUT408The request body stopped arriving, so the request was stopped. Send it again.
    PAYLOAD_TOO_LARGE413The request body is larger than 1 MB.
    TIMEOUT504The request took too long. Send it again with the same Idempotency-Key and body after Retry-After seconds: a 409 means it is still finishing (wait and send again), and any other answer is final. If this 504 comes back, find what the request made by listing with ?idempotency_key=<the key>.
    PAYER_REJECTED422The payer rejected the check. The check object says what to change, and whether resending can help.
    PAYER_UNAVAILABLE502The payer's system is not answering right now. Nothing needs to change: send the check again later.
    NETWORK_ERROR502The check could not be completed because the payer network failed. It is not billed. Send it again later.
    ELIGIBILITY_UNAVAILABLE503Eligibility checks are not available in live mode yet. Use a test key.
    CLAIMS_UNAVAILABLE503Claims are not available in live mode yet. Use a test key.
    ATTACHMENTS_UNAVAILABLE503Attachments are not available in live mode yet. Use a test key.
    ATTACHMENTS_NETWORK_ERROR502The attachment network did not finish. The attachment is still open and nothing was lost: close it again.
    NPI_REGISTRY_UNAVAILABLE502The NPI registry is not answering right now. Nothing needs to change: send the request again later.
    CONFLICT409The resource is not in a state that allows this, or it changed while the request was handled. Read it, then decide whether to send the request again.
    NO_APPLIED_PAYMENT409The claim has no payment applied from an ERA to carry to the next payer.
    NO_NEXT_PAYER409The claim is tertiary: no payer comes after it.
    PAYMENT_NOT_BALANCED409What the payer paid and its adjustments do not add up to the claim's charge. The details give the figures.
    DELIVERY_UNCERTAIN409This claim's last file may already be with the payer: no acknowledgement came after it was handed to the network. Check the claim's status before you send it again; to send it anyway, repeat the request with confirm_resend set to true.
    NO_PAYER_ANSWER409The payer has not answered this claim's last submission. Check its status with the payer before you send it again; to send it anyway, repeat the request with confirm_resend set to true, or void it.
    REGISTRATION_PENDING409The office’s registration with the attachment network is pending: Claim House is waiting for the network and tries again on its own. Close the attachment again once the office is registered (the event office.attachment_registration.updated says when).
    NPI_CONFLICT409This NPI belongs to another dentist in your organization: a provider with another last name has it. Check the NPI and the last name.
    STATUS_MANAGED409Claim House moves this enrollment's status.
    INTERNAL500Something went wrong on our side. Quote the request ID if you contact us.

    An eligibility check that is rejected, unavailable or failed carries the check itself next to the error. See Eligibility.

    Which failures to retry#

    What you gotWhat to do
    No response (the connection dropped, your server restarted)Send the same request with the same Idempotency-Key. You get the first answer, or it runs once.
    504 TIMEOUTSend the same request with the same key after Retry-After. See After a timeout.
    409 IDEMPOTENCY_KEY_IN_USEThe same request is still running. Wait Retry-After seconds, send it again with the same key.
    409 CONFLICTThe resource is not in a state that allows this (or changed meanwhile). Read it, then decide.
    409 NPI_CONFLICTThe NPI belongs to a provider with another last name. Check the NPI and name.
    409 DELIVERY_UNCERTAINThe claim's last file may already be with the payer. Check its status; send it with confirm_resend: true only if it is not there. See Claims.
    409 NO_PAYER_ANSWERThe payer never answered the claim's last submission. Check with the payer, then send it with confirm_resend: true, or void it. See Claims.
    409 STATUS_MANAGEDClaim House moves this enrollment's status. Change only its note or dates. See Payer enrollment.
    401, 403, 404, 422Fix the request, key or ID. Sent again unchanged, it gets the same answer.
    429 TOO_MANY_REQUESTSNothing ran. Wait Retry-After seconds and send it again.
    502 PAYER_UNAVAILABLE, NETWORK_ERRORNothing is billed. Send the check again later with a new key.
    500 INTERNALSend it again with a new key. If the error carries a check, read it first: the check was made.

    Idempotency#

    A POST or a PATCH needs an Idempotency-Key header, so a request that timed out can be repeated safely; for POST /api/v1/eligibility it is optional (recommended for retries); a search sent as a POST takes none. A request that needs one and has none is refused with 400 IDEMPOTENCY_KEY_REQUIRED.

    • An eligibility check runs without one: a repeat within 60 minutes reuses the saved answer, so it is neither asked nor billed twice. Send a key with a check you may retry after a timeout.
    • A key is 1 to 255 printable ASCII characters, no spaces (a UUID is good); otherwise 400 IDEMPOTENCY_KEY_INVALID. When the body has problems too, one 422 INVALID_REQUEST names them all.
    • Never put patient information in a key. Keys are stored and logged.
    • The same key with the same method, path, query and body returns the stored answer with idempotent-replayed: true; nothing runs or is billed again. Its body's request_id is the first request's.
    • The same key with anything different: 422 IDEMPOTENCY_KEY_REUSED.
    • While the first request runs, a repeat waits up to 10 seconds, then answers 409 IDEMPOTENCY_KEY_IN_USE with Retry-After.
    • Answers are kept 24 hours; after that the key starts a new request.

    Once a request has started, its answer is final, including a failure (500, 502): a retry with the same key replays it and never runs it twice. A retry after an error response is a new attempt with a new key. A request refused before it started (401) can be sent again with the same key. The exception is a 504, below.

    After a timeout#

    A 504 TIMEOUT (after 45 seconds) means Claim House stopped waiting, not that nothing happened. Do not wait on a clock, and do not decide from a lookup: the first attempt may still be committing, so a lookup can find nothing yet.

    1. Send the same request, same key and body, after Retry-After (5 seconds).
    2. 409 IDEMPOTENCY_KEY_IN_USE: the first attempt is still running. Wait and send it again.
    3. Any other answer is final. For POST /providers, POST /eligibility, POST /claims, POST /claims/{id}/next_claim, POST /enrollments, POST /attachments, POST /attachments/{id}/documents, POST /attachments/{id}/close, the retry takes the first attempt over and answers as if it had finished: one claim, one attachment, one check, never two.
    4. Any other operation answers the same 504 again. Find what it did with a lookup by key, below, or by reading the resource.

    Find a write by its key#

    Every list whose create takes a key finds what that key made: GET /offices, GET /practice_groups, GET /providers, GET /eligibility, GET /eligibility/batches, GET /claims, GET /enrollments, GET /attachments, GET /payer_requests, GET /webhook_endpoints. Use it for a request whose outcome you lost (a 504 that came back again, or a process that died after sending). It needs a key with read, so a submit-only integration keeps a read key for it.

    Shell
    curl "https://sandbox.myclaimhouse.com/api/v1/claims?idempotency_key=my-key-1" -H "Authorization: Bearer $CLAIMHOUSE_KEY"

    A claim, check or attachment also carries the request_id of the request that made it.

    Retried under a new key#

    A retry under a new key never sends anything twice:

    RequestAnswer
    POST /claims/{id}/submit of a claim already queued200, the claim as it is. Nothing new is queued.
    submit or resubmit of a claim already sent409 CONFLICT with details.claim_id and details.state. No new file.
    POST /claims with the same claim again201, a new claim held in needs_attention with a DUPLICATE_CLAIM error naming the first. It is never sent. See Duplicates.
    POST /attachments/{id}/close of a closed attachment200, the attachment as it is, same number. Nothing is sent again.

    Request size#

    A body over 1 MB is refused with 413 PAYLOAD_TOO_LARGE before anything is recorded. An attachment upload has its own limit (see Attachments); one whose body stops arriving for 15 seconds gets 408 REQUEST_TIMEOUT.

    Rate limits#

    Each key, organization, payer-call stream and office has a steady rate with room for bursts. The same limits apply to the API and the MCP server. The standard figures:

    LimitCountsSteady rateBurst
    Per API keyEvery request of the key20 a second40
    Per organizationEvery request of all its keys of one mode (test and live each have their own)50 a second100
    Payer and registry callsEligibility checks and NPI lookups of the organization in one mode, on top of the two above5 a second50
    Per officeEligibility checks of one office, on top of the three above5 a second50

    GET /rate_limits returns your organization's own figures for each, with custom: true where they were raised:

    Shell
    curl "https://sandbox.myclaimhouse.com/api/v1/rate_limits" -H "Authorization: Bearer $CLAIMHOUSE_KEY"
    • A request over a limit gets 429 TOO_MANY_REQUESTS, Retry-After, and details naming the bucket and its per_second and burst. Nothing of it runs or is billed. Through MCP, a tool call over the payer limit gets the error as its result.
    • More keys do not mean more requests: the organization limit counts all its keys of a mode.
    • An eligibility check takes a turn from its office (office_id, or your only office). A batch of checks takes the same turns and waits instead of failing.
    • Need more? Any limit can be raised for your organization: ask us. A raised limit applies in test and live alike. An organization with many offices usually needs a higher organization and payer limit; the office limit still holds each office to its own rate.
    • A key that keeps hitting a limit for 5 minutes is emailed about to your owners and admins (and Claim House), at most once every 60 minutes: usually a script or an agent stuck in a loop.