Skip to content

Developer docs

Errors

Every failed request has a non-2xx status and the same JSON body. Branch on the error code, not on the message text.

Error format

JSON
Error body (JSON){
  "error": "agent_paused",
  "message": "(A human-readable explanation, worded by Haven.)",
  "reason": "credits_exhausted"
}

error is a stable code that does not change once released. message is written for people and may be reworded. Some errors add fields, for example retryAfterSeconds for rate limits or issues for a request that failed validation.

Error codes

Codes that only the dashboard login screens or Haven’s own staff can trigger are left out of this list.

Authentication and sessions

Authentication and sessions
CodeMeaning
not_authenticatedNo session cookie or API key was sent.
invalid_api_keyThe API key is malformed, unknown or revoked.
origin_not_allowedThe website making the request is not on the allowed list (for the chat widget: the widget's allowed websites).

Permissions

Permissions
CodeMeaning
forbiddenLogged in, but this role cannot do this.
session_requiredOnly available to a logged-in dashboard user, not to API keys.

Limits

Limits
CodeMeaning
rate_limitedToo many requests; see retryAfterSeconds.
payload_too_largeThe request body is too large.

Request shape

Request shape
CodeMeaning
invalid_requestValidation failed; see issues.
invalid_jsonThe body is not valid JSON.
not_foundNo such resource for your account.

Billing and subscriptions

Billing and subscriptions
CodeMeaning
invalid_planThe plan does not exist for this agent.
same_planAlready on that plan.
rail_unavailableThat payment method is not configured.
already_subscribedThere is already a subscription for this agent.
not_subscribedThere is no subscription for this agent.
plan_change_unavailableThe subscription cannot change plan in its current state.
plan_change_unsupportedPlan changes are not available for this payment method.
plan_change_failedThe payment provider refused the plan change.
checkout_failedThe payment provider could not start checkout.
no_billing_accountThere is no card subscription yet, so there is no card billing account.
billing_portal_failedThe payment provider could not open the billing portal.
cancel_not_applicablePrepaid subscriptions end on their own; there is nothing to cancel.
cancel_failedThe payment provider refused the cancellation change.
not_cancellingThe subscription is not set to cancel, so there is nothing to reactivate.
subscription_endedThe billing period is over; subscribe again instead.

Agent engine

Agent engine
CodeMeaning
agent_not_foundUnknown agent.
agent_pausedThe agent is paused for your account; see reason and message.
agent_not_configuredYour account has not set up this agent yet.
conversation_not_foundNo such conversation for your account.
conversation_busyThe conversation is still answering a previous message.
conversation_fullThe conversation is too long; start a new one.
not_pendingThe approval was already decided.
engine_unavailableThe agent engine is not configured.
model_unavailableThe AI model service rejected or could not complete the request.

Knowledge

Knowledge
CodeMeaning
invalid_urlThe website address cannot be used.
not_verifiedThe website is not verified yet.
crawl_in_progressA crawl of this site is already queued or running.
knowledge_unavailableKnowledge indexing is not configured.
subscription_requiredKnowledge work needs an active subscription with credits; see reason.
crawling_pausedCrawling stopped because the site lost its verification; verify it again.
document_limit_reachedThe plan allows no more documents; see limit.
invalid_fileThe uploaded file is empty or unnamed.
unsupported_file_typeThe file type, declared type and content must be a PDF or UTF-8 text.
file_too_largeThe file exceeds the size or page limit.
unreadable_pdfThe PDF could not be read.
no_textNo readable text in the file.
captcha_failedThe anti-bot check did not pass; reload the page and try again.
captcha_unavailableThe anti-bot check could not run; try again shortly.
agent_requiredThis business has more than one agent: say which one with agent_id.

Channels (WhatsApp, email) and platform switches

Channels (WhatsApp, email) and platform switches
CodeMeaning
channel_unavailableThe channel is not available yet (coming soon) or not configured on this server.
channel_not_foundNo such channel connection.
models_haltedThe AI models are paused by an emergency stop.
purchases_haltedNew purchases are paused by an emergency stop.
signups_haltedNew sign-ups are paused by an emergency stop.
invalid_attachmentOne of the attached files is not available.
idempotency_key_reusedThe Idempotency-Key was already used with a different request.
request_in_progressThe first request with this Idempotency-Key is still running.
account_suspendedThis account has been suspended. Contact support.

Chat widget (public endpoints)

Chat widget (public endpoints)
CodeMeaning
widget_not_foundUnknown or disabled widget id.
visitor_session_requiredWidget calls need the visitor token from POST /widget/v1/:widgetId/sessions.
visitor_session_expiredThe visitor token is unknown, expired, or from another site; start a new session.
message_too_longThe visitor message is longer than the widget allows; see maxChars.
widget_cap_reachedYour account's daily widget message cap is reached.
challenge_failedThe bot challenge was missing or did not pass.
verification_failedNo order matches that order number and email (deliberately generic).
verification_unavailableThis widget has no order verification set up.
chat_unavailableThe chat cannot answer right now (any internal reason; details are not shown to visitors).

Server

Server
CodeMeaning
internal_errorSomething went wrong on our side.