Guides

Errors

The API returns 20 error codes. Branch on the code, not on the message.

An error has an HTTP status and a body with a stable code and a message. The message is a sentence in English for the person building the automation. It can change. The code doesn’t.

Answer, 404
{
  "code": "not_found",
  "message": "ContactZapp has nothing at this address for this API key. Check the id or the trigger name."
}

All codes

This list is built from the API’s own spec, so it has every code the API can return.

CodeStatusSend again?What it means
api_key_missing401No, fix the requestThe request has no API key.
api_key_invalid401No, fix the requestThe API key is not valid. It may have been revoked.
insufficient_scope403No, fix the requestThe API key does not have the scope this operation needs.
rate_limited429YesToo many requests. Wait the number of seconds in the Retry-After header.
internal_error500YesSomething went wrong in ContactZapp. Try again.
unavailable503YesContactZapp could not check the request just now. Try again.
invalid_parameter400No, fix the requestA parameter is not usable, for example a limit out of range, a cursor from another request, or more than one filter.
not_found404No, fix the requestThere is nothing at this address for this API key.
invalid_body400No, fix the requestThe request body is not a contact.
invalid_date400No, fix the requestA date in the request is not a real date.
empty_contact400No, fix the requestThe contact has no values.
no_account_to_write_to422No, fix the requestThe user has no two-way account that keeps an address book and is not paused.
contact_gone409No, fix the requestThe contact was merged into another contact or deleted.
contact_pending_review409No, fix the requestThe contact waits in Review duplicates.
contact_changed409YesThe contact changed while it was being written. Try again.
idempotency_key_invalid400No, fix the requestThe Idempotency-Key header is empty, too long or has more than one value.
idempotency_key_reused422No, fix the requestThis Idempotency-Key was already used with a different request.
idempotency_key_in_progress409YesA request with this Idempotency-Key is still being handled, or did not finish.
body_too_large413No, fix the requestThe request body is too large.
unknown_field400No, fix the requestThe body carries a field a contact write does not take: a misspelt name, a read-only field such as id or updatedAt, or a field the contact does not show. Nothing was written.

What to do

  • 429, 500 and 503. Wait, then send the same request again. For a 429, wait the seconds in Retry-After. See Rate limits.
  • 409 contact_changed. The contact changed while we wrote it. Read it again and resend.
  • Other 4xx. The request is wrong. Sending it again gives the same answer, so change it first.