API basics
Error codes
Branch on code, never on detail. Codes are stable; messages may improve. See Errors for the response format.
| Code | Status | Title | Meaning |
|---|---|---|---|
invalid_request | 400 | Invalid request | A field of the request is missing, has the wrong type or breaks a limit, or the body has a field that does not exist. The param of the answer names the first field that failed and the detail says which rule it broke. |
unknown_field | 400 | Unknown field | The body has a field the route does not document. param names the first one, and the detail lists up to ten. Remove it and send the request again. Free-form maps such as metadata accept any key. |
invalid_cursor | 400 | Invalid cursor | The cursor is not one this API issued, was changed on the way, or was issued for a list with other filters. A cursor is only valid for the same filters and the same list. |
api_key_invalid | 401 | Invalid API key | Missing, invalid or revoked API key. Send it as Authorization: Bearer |
unauthorized | 401 | Unauthorized | Missing, invalid or revoked API key. Send it as Authorization: Bearer |
scope_missing | 403 | Scope missing | The key is valid but was created without the scope this operation needs. The operation page in the API reference lists the scope it requires and missingScopes in the answer names the ones this key lacks. |
agent_not_exposed | 403 | Agent not exposed | This agent is internal and was not created through the API, so it is not exposed. Create a copilot with POST /v2/agents and audience internal. |
forbidden | 403 | Forbidden | The key is valid and has the scope, but what it asks for is not allowed to it: the object belongs to another organization or subaccount, or the role behind the key is too low. |
grant_not_allowed | 403 | Grant not allowed | A key can only hand out scopes it has itself, and some scopes (the subaccounts:* ones) are never handed down. The request asked for a scope the creating key cannot grant. |
organization_deleted | 403 | Organization deleted | The organization of this key was deleted. |
subscription_canceled | 403 | Subscription canceled | The subscription of this organization is canceled. The API is closed until it is reactivated. |
budget_exceeded | 402 | Budget exceeded | A budget with the action stop reached its monthly limit, so the agent no longer answers on that scope. The budget object of the answer says which budget, its limit and what was spent. |
not_found | 404 | Not found | No object with this id exists in the organization of the key. The id may have a typo, belong to another organization or subaccount, or the object was deleted. |
method_not_allowed | 405 | Method not allowed | The path exists but not with this HTTP method, for example a DELETE on a route that only reads. The API reference lists the methods of each path. |
conflict | 409 | Conflict | The request is valid but clashes with the current state of the object, for example changing something that another request changed first or that is in a state that does not allow it. The detail says the state. |
idempotency_key_reused | 409 | Idempotency key reused | This Idempotency-Key was already used within the last 24 hours with a different method, path or body. A key identifies one request: the same key must always carry the same request. It also answers when the response stored for the key was erased because it held personal data of a person who was suppressed: send the request again with a new key. |
idempotency_key_in_use | 409 | Idempotency key in use | A request with this Idempotency-Key is still running, so this second copy cannot be answered yet. It happens when a client retries before the first call finished. |
agent_version_conflict | 409 | Agent version conflict | Someone saved the agent after you read it. Read it again and retry with its current version. |
external_ref_conflict | 409 | External reference conflict | Another contact in this organization already has this externalRef. An externalRef is unique per organization. |
actor_role_above_key | 403 | Actor role above the key | The actor declares a role higher than this key can declare. Declare a lower role or use a key with more reach. |
approval_not_pending | 409 | Approval not pending | Someone decided this approval first, or it expired. Read it to see its status. It cannot be decided twice. |
approval_decision_not_allowed | 403 | Approval decision not allowed | This key is not named as an approver by the policy of the tool, it created the request itself, or it lacks the approvals |
review_not_available | 422 | Review not available | Only a decision marked automatedDecision takes a review request, and an approval only once someone decided it. |
team_question_not_open | 409 | Team question not open | The team question was already answered or closed. It cannot be answered twice. |
slot_not_available | 409 | Slot not available | That time is no longer free in the agenda, or it was never one of its slots. Nothing was booked. |
meeting_not_active | 409 | Meeting not active | The meeting is canceled, completed or was marked as a no-show, so it cannot be canceled or moved. |
invalid_cron | 422 | Invalid cron expression | The cron expression could not be read. Use five fields (minute hour day-of-month month day-of-week), for example 0 9 2 * * for the 2nd of each month at 09:00. |
invalid_timezone | 422 | Invalid timezone | The timezone is not an IANA name. Use a name such as America/Santiago. |
schedule_limit_reached | 409 | Schedule limit reached | The agent or the organization already has the maximum number of scheduled tasks. Delete or reuse one before creating another. |
run_finished | 409 | Run finished | The run already ended (completed, stopped, failed or canceled), so there is nothing left to cancel. |
run_not_waiting | 409 | Run not waiting for an answer | The run is not paused with a question, so it has nothing to receive an answer. Read the run: only status waiting_for_answer takes one. |
case_agent_in_control | 409 | Agent in control | The agent is handling this case and would answer over your message. Take control first, or close the case. |
case_message_limit_reached | 409 | Message limit reached | The case reached its limit of messages. Open a new case to keep talking. |
resource_in_use | 409 | Resource in use | Something still depends on this object, for example a contact with open cases or a pipeline with a case in it, so it cannot be deleted. The detail names what depends on it. |
action_origin_not_allowed | 403 | Action origin not allowed | This key may not create actions that call that site. An administrator adds the site to the key. |
action_destination_blocked | 400 | Destination blocked | That address cannot be used. It must be a public http or https URL that answers. |
phone_number_in_use | 409 | Phone number in use | This number is already connected. |
payload_too_large | 413 | Payload too large | The body is bigger than the limit of the route. JSON bodies take up to 1 MB; a file route has its own limit, which the detail states. |
unprocessable | 422 | Unprocessable | The request is well formed and the fields are valid, but a rule of the object does not allow it in its current state. The detail names the rule and param the field when there is one. |
agent_not_ready | 422 | Agent not ready | The agent cannot be turned on yet because it lacks something required: instructions or a model. The detail lists what is missing and param names the first field. |
agent_channel_disabled | 422 | Agent channel disabled | The agent does not have this channel enabled. |
case_channel_not_api | 422 | Case not from the API | Only cases that came through the API can be written to as the contact. On other channels the contact writes by themselves. |
channel_window_closed | 422 | Channel window closed | More than 24 hours passed since the last message of the person and WhatsApp only accepts approved templates now. The message was not sent. |
no_outbound_channel | 422 | No outbound channel | This case has no channel to write to the person. The message was not sent. |
interactive_unsupported_channel | 422 | Interactive messages need WhatsApp | Buttons, lists and catalog messages only exist on WhatsApp. This case is on another channel. The message was not sent. |
catalog_not_connected | 422 | Catalog not connected | The WhatsApp number that sends the message has no catalog, or the catalogId is not the one connected to it. The message was not sent. |
message_variable_missing | 422 | Message variable missing | The template needs a variable that has no value. The message was not created. |
template_not_approved | 422 | Template not approved | WhatsApp has not approved this template, so nothing can be sent with it yet. |
no_whatsapp_number | 422 | No WhatsApp number | The organization has no active WhatsApp number that can send this template. |
template_across_accounts | 422 | Numbers on different WhatsApp accounts | A template belongs to one WhatsApp Business Account. Choose numbers that share it. |
sender_domain_not_verified | 422 | Sender domain not verified | The sender address must belong to a verified domain of the organization. Check GET /v2/email/domains. |
field_not_sensitive | 422 | Field not sensitive | Only a field the pipeline marks as sensitive can be revealed. Read any other field from the case. |
contact_without_email | 422 | Contact without email | The contact has no email address to write to. |
subject_required | 422 | Subject required | The first email of a case needs a subject. |
recipient_not_allowed | 422 | Recipient not allowed | This organization cannot send email to that address. |
contact_opted_out | 422 | Contact opted out | The contact opted out of this channel, so nothing is sent to them. |
presence_not_configured | 409 | Presence not configured | Presence is off for this organization: no presence setting is saved yet, so signals have nothing to update and presence filters have nothing to read. |
action_variable_needs_authorization | 400 | Action variable needs authorization | The action sends contact.phone or contact.whatsapp_id to your system, and those two leave Lelemon only with the authorization of the destination (article 15 bis of Law 21.719). The request has no authorization and the action has no current one for this destination. |
action_variable_in_query | 400 | Action variable in the query | In a GET action everything goes in the URL, and the URL stays in the logs of your system and of whatever sits in front of it. contact.phone, contact.whatsapp_id and the variables that come from a field of the case do not go there. |
domain_in_use | 409 | Domain in use | Another organization already registered this domain. |
model_not_supported | 422 | Model not supported | The llmConfig.model is not a public model id of the list in GET /v2/models, or it is one that was withdrawn. |
thinking_not_supported | 422 | Thinking cannot be turned off | The model in llmConfig.model cannot turn thinking off, so thinking: "off" is rejected. GET /v2/models says which models accept it. |
template_variable_missing | 422 | Template variable missing | The instructions ask for a variable that has no value. |
mcp_server_unreachable | 422 | MCP server unreachable | The MCP server did not answer a tools request. Check the URL and the credentials. Redirects are not followed. |
linear_rejected | 422 | Linear rejected the request | Linear did not accept the API key, the team or the project. Check that the key is valid and can see the team. |
required_fields_missing | 422 | Required fields missing | The stage the case is moving to or entering requires fields that the case does not have yet. param names the first missing one. |
unsupported_file_type | 422 | Unsupported file type | Allowed: PDF, DOCX, TXT and MD. |
rate_limited | 429 | Too many requests | This key sent more than 3000 requests in the last minute. The RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset headers of every answer say where the key stands, and Retry-After says how many seconds to wait. |
data_connector_unavailable | 422 | Data connector unavailable | Your connector did not answer in time, answered with an error, or its address is not reachable. Nothing was stored. |
data_connector_invalid_response | 422 | Data connector response is not valid | Your connector answered, but an account card, a search answer or a view page does not follow lelemon-connector/v1. The detail lists the failing paths with the rule each breaks, never the values. The check endpoint reads the manifest only, so it can pass while a card fails. |
data_connector_not_ready | 409 | Data connector not ready | The connector is not active. Read its signing secret, serve the format and call POST /v2/data-connectors/{id}/check. |
data_connector_limit | 422 | Data connector limit reached | An organization can have up to 10 data connectors. Delete one first. |
webhook_endpoint_limit | 422 | Webhook endpoint limit reached | An organization can have up to 16 webhook endpoints, enabled or disabled. Every event is delivered to each endpoint that listens to it, so the cap also bounds how many deliveries one event can make. |
internal_error | 500 | Internal error | Something failed on our side after the request started. The same Idempotency-Key returns this same error, so check whether the operation happened before retrying with a new key. |
service_unavailable | 503 | Service unavailable | Lelemon is temporarily unavailable. Retry with backoff. |