Integration API
Errors and request ids
The error object#
Every JSON error has this shape, on every route:
{"error": {"code": "bad_args",
"message": "An argument has the wrong type; error.arg names it.",
"requestId": "3f1c2a9e-51b0-4c1e-9a67-0d2e8b7a4c11",
"arg": "limit"}}
| Field | Meaning |
|---|---|
code |
what your program switches on. A code is never renamed |
message |
one sentence for a person reading a log. It may be reworded; do not match on it |
requestId |
the id of this request, also in the X-Request-Id response header |
| other fields | depend on the code: arg on bad_args, retryAfter on rate_limited, reason on some resync_required |
Treat the object as open. New fields and new codes are added; none is removed.
Request ids#
Every response carries X-Request-Id. Send your own X-Request-Id and it is
echoed back, so your logs and the server's line up. It must match
^[A-Za-z0-9._-]{8,64}$; anything else is replaced with a new id. Quote the id
when you report a problem to whoever runs the server.
Malformed requests#
| Request | Answer |
|---|---|
| a body that is not JSON, is cut short, or is not UTF-8 | 400 bad_json |
| a body over the size cap (about 70 MB) | 413 too_large, and the connection closes |
an argument of the wrong JSON type ("limit": "ten", "args": []) |
400 bad_args, arg names it |
a number no integer can hold ("limit": 1e999) |
400 bad_args, arg names it |
an entity or relation of add_to_graph in the wrong shape |
400 bad_args |
A scope is checked before arguments are read: a tool your key does not hold
answers 403 forbidden whatever you sent with it.
A body sent without a length (chunked) that runs far past the cap is not read to its end. The connection is dropped without an answer.
Codes added for integrations#
| Code | Status | Meaning |
|---|---|---|
bad_json |
400 | the body is not valid JSON in UTF-8 |
bad_args |
400 | an argument has the wrong type or an unusable value |
too_large |
413 | the body is over the cap |
rate_limited |
429 | wait Retry-After seconds and send the same request again |
bad_cursor |
400 | the cursor does not belong to this listing; start again |
resync_required |
409 | the sync token cannot be followed; list again |
key_expired |
401 | the key is past its expiresAt |
bad_expiry |
400 | expiresAt is not after now and within ten years |
previous_secret |
403 | a rotated-out secret tried to rotate |
groups_required |
400 | a key for a service account must name its groups |
service_account |
409 | that member is a service account; use its own routes |
scope_not_exportable |
403 | the key's reads are narrower than an export |
url_not_allowed |
400 | the webhook URL may not be called |
too_many_webhooks |
409 | the graph already has the most webhooks it may |
webhooks_not_configured |
503 | the server has no secret to seal signing secrets with |
The full list of known codes is in the OpenAPI document, under
x-known-codes.
Over MCP#
POST /v1/live/mcp answers in JSON-RPC. A failed tool call is a result with
isError: true and a sentence, not an HTTP error. A body that cannot be
parsed is HTTP 400 with JSON-RPC error -32700 and id: null. A params
of the wrong type is -32602 with your request's id. A wrong-typed tool
argument is a tool result reading Bad arguments: <name>.