Errors
Format
Section titled “Format”Every Open API error comes in the standard RFC 9457 (Problem Details) format with the Content-Type: application/problem+json header. The HTTP status of the response matches the status field in the body.
HTTP/1.1 404 Not FoundContent-Type: application/problem+json
{ "type": "https://open.jecrm.org/errors#DEAL_NOT_FOUND", "title": "Deal not found", "status": 404, "detail": "Deal not found.", "instance": "/v1/deals/3f2a1c7e-5b1d-4f0e-9c3a-2b8d6e4f1a90", "code": "DEAL_NOT_FOUND", "timestamp": "2026-11-17T10:00:00.000Z"}| Field | Meaning |
|---|---|
code |
Machine-readable error code. Handle errors by this field, not by title or detail. |
status |
HTTP status (a number). |
title |
Short name of the error. The same for every error with the same code. |
detail |
Explanation of this particular case, for the developer. The text may change. |
type |
Link to the error description on open.jecrm.org/errors. |
instance |
Path of the request that caused the error. |
timestamp |
Time of the error (UTC, ISO 8601). |
errors |
Only for VALIDATION_ERROR: the list of invalid parameters. |
retry_after |
Only for RATE_LIMIT_EXCEEDED: how many seconds to wait before retrying. |
Successful responses keep the same format as before ({ "status": true, "status_code": 200, "data": … }).
Statuses
Section titled “Statuses”| Status | When | What to do |
|---|---|---|
400 |
Invalid parameters or request body | Fix the request. Retrying unchanged will not help. |
401 |
The API key is missing or wrong | Check the key. See Where to get the API key. |
404 |
The record does not exist or belongs to another company; unknown URL | Check the id and the request URL. |
413 |
The file is larger than 25 MB | Make the file smaller. |
429 |
Too many requests | Wait Retry-After seconds and retry. |
500 |
Unexpected server error | Retry later. If it keeps happening, contact support with instance and timestamp. |
Validation errors
Section titled “Validation errors”If a request parameter is invalid (in the query, the path or the body), the API returns 400 with the VALIDATION_ERROR code. The errors field lists all problems at once, not just the first one:
{ "type": "https://open.jecrm.org/errors#VALIDATION_ERROR", "title": "Request parameters are invalid", "status": 400, "detail": "Invalid parameters: status, limit.", "instance": "/v1/tasks?limit=500&status=FOO", "code": "VALIDATION_ERROR", "timestamp": "2026-11-17T10:00:00.000Z", "errors": [ { "field": "status", "rule": "isEnum", "detail": "each value in status must be one of the following values: NEW, IN_PROGRESS, REVIEW, POSTPONED, CANCELLED, DONE" }, { "field": "limit", "rule": "max", "detail": "limit must not be greater than 100" } ]}field: the parameter name. Nested fields use dots, for exampleattachments.0.url.rule: the check that failed (isUuid,max,isEnum,isDateStringand so on). One field can have several entries.detail: description of the problem in English.
API key and rate limit
Section titled “API key and rate limit”If the key is missing or wrong, the API returns 401 with the WWW-Authenticate: ApiKey header="x-api-key" header:
API_KEY_NOT_FOUND: no key was sent.API_KEY_INVALID: the key does not belong to any company. It is wrong, deleted or regenerated.
When the rate limit (200 requests per second per company) is exceeded, the API returns 429 with the RATE_LIMIT_EXCEEDED code. How many seconds to wait is in the Retry-After header and the retry_after field.
Error codes
Section titled “Error codes”| Code | Status | When it happens |
|---|---|---|
VALIDATION_ERROR |
400 | Invalid query, path or body parameter. Details in errors. |
BAD_REQUEST |
400 | The request could not be parsed, for example broken JSON. |
CHAT_CREATED_DATE_FILTER_INVALID |
400 | created_at is combined with created_from / created_to. |
CHAT_UPDATED_DATE_FILTER_INVALID |
400 | updated_at is combined with updated_from / updated_to. |
CHAT_DATE_FILTER_INVALID |
400 | A chat date filter is not a valid date. |
WEBHOOK_EVENT_INVALID |
400 | The webhook subscription contains an unsupported event. |
WEBHOOK_URL_INVALID |
400 | The webhook URL is invalid, is not https or points to a private network. |
API_KEY_NOT_FOUND |
401 | No API key was sent. |
API_KEY_INVALID |
401 | The API key does not belong to any company. |
NOT_FOUND |
404 | The URL (route) does not exist. |
CHAT_NOT_FOUND |
404 | The chat does not exist or belongs to another company. |
MESSAGE_NOT_FOUND |
404 | The message does not exist or belongs to another company. |
FUNNEL_NOT_FOUND |
404 | The funnel does not exist or belongs to another company. |
LEAD_NOT_FOUND |
404 | The lead does not exist, belongs to another company or is a deal (use /v1/deals). |
DEAL_NOT_FOUND |
404 | The deal does not exist, belongs to another company or is a lead (use /v1/leads). |
CONTACT_NOT_FOUND |
404 | The contact does not exist or belongs to another company. |
CLIENT_COMPANY_NOT_FOUND |
404 | The client company does not exist or belongs to another company. |
PRODUCT_NOT_FOUND |
404 | The product does not exist or belongs to another company. |
PAYMENT_NOT_FOUND |
404 | The payment does not exist or belongs to another company. |
TASK_NOT_FOUND |
404 | The task does not exist or belongs to another company. |
PAYLOAD_TOO_LARGE |
413 | The file exceeds the 25 MB limit. |
RATE_LIMIT_EXCEEDED |
429 | Too many requests. |
INTERNAL_ERROR |
500 | Unexpected server error. |
The current list of codes is always on open.jecrm.org/errors. The link in the type field opens the matching row there.
MCP server
Section titled “MCP server”On error, MCP server tools return isError: true, and the response text holds the same error body as the REST API, only without the instance field. If a tool gets invalid arguments (a wrong uuid, date, enum value or limit), the call is rejected before it runs, with MCP error -32602 and a description of the field.
Handling example
Section titled “Handling example”const res = await fetch(url, { headers: { 'x-api-key': KEY } });
if (!res.ok) { const problem = await res.json();
switch (problem.code) { case 'RATE_LIMIT_EXCEEDED': await sleep(problem.retry_after * 1000); return retry(); case 'DEAL_NOT_FOUND': return null; case 'VALIDATION_ERROR': throw new Error(problem.errors.map((e) => `${e.field}: ${e.detail}`).join('; ')); default: throw new Error(`${problem.code}: ${problem.detail}`); }}Migrating from the old format
Section titled “Migrating from the old format”Errors used to come in the { "status": false, "status_code": …, "errors": [{ "code", "message" }], "data": null } wrapper. What changed:
errors[0].code→code,errors[0].message→titleordetail.status_code→status. Note:statusis now a number, nottrue/false.- “Not found” (
*_NOT_FOUND) is now404instead of400. - Key problems are now
401instead of400. A wrong key has theAPI_KEY_INVALIDcode instead ofCOMPANY_NOT_FOUND. - Validation errors have the
VALIDATION_ERRORcode with a list of fields (previouslyINTERNAL_ERROR). - An invalid webhook event or URL is now
400(previously500).
See also: Open API, MCP server.