Skip to content

Errors reference

Every error Trustline returns says what went wrong in one line, and most say what to do next. This page lists each code with its HTTP status, the fields it carries and the step an agent should take.

Error shape

REST answers with the HTTP status from the table below and a JSON body {error, msg, details?, hint?}. error is the stable code to branch on; msg is one readable line; details holds what the next step needs (a checkout link, a wait time, a missing scope); hint appears on the few errors whose message does not already say what to do.

Over MCP an op error is a tool result with isError: true whose text is the same JSON. A bad_request also carries args, the op's argument signature, so the agent can correct its call without asking tl_help. These are the real responses:

bad_request with args (MCP)
tl_create {"op":"create","args":{"title":"x","text":"y"}}
// isError: true
{
  "error": "bad_request",
  "msg": "signers: Invalid input: expected array, received undefined",
  "args": "{title:str,text?:str,pdf?:str,doc?:str,message?:str,signers:[{name:str,email:str,order?:int,role?:str}],fields?:[{kind:signature|initials|date|text|checkbox,signer:int,page:int,x:0..1,y:0..1,w:num,h:num,required?:bool,label?:str}],redirect?:str|{url:str,label?:str},approval?:bool,send?:bool,expiresInDays?:int,remindEveryDays?:int}"
}
op sent to the wrong tool (MCP)
tl_create {"op":"send","args":{"id":"env_..."}}
// isError: true, nothing ran
{"error":"bad_request","msg":"send is a send op: use tl_send"}
plan_required
HTTP/1.1 402 Payment Required        (REST; over MCP the same JSON is a tool error)
{
  "error": "plan_required",
  "msg": "Sending needs a plan: this account has no plan yet. Start a 14-day trial to send. Open https://trustline.app/app/settings?upgrade=solo to start it (a person signs in and adds a card; an agent can't pay).",
  "details": {
    "checkoutUrl": "https://trustline.app/app/settings?upgrade=solo",
    "plan": "solo",
    "status": null,
    "trialDays": 14
  }
}
plan_limit with hint
{
  "error": "plan_limit",
  "msg": "sending signers to your invoice needs the Team plan",
  "details": {
    "upgradeTo": "team"
  },
  "hint": "only a person can change plans: give them https://trustline.app/pricing (details.upgradeTo)"
}

Error codes

The same codes come from REST, MCP and the dashboard, because all three run the same operations. Statuses are fixed per code.

Error codes
errorHTTPMeaningNext stepCarries
bad_request400The arguments failed validation (unknown keys are rejected, required ones missing, wrong types) or a value does not fit (a field off the page, a signer index that does not exist, a webhook URL that is not public https).Read msg: it names the path and the problem, for example signers: expected array. Over MCP the error also carries args, the op's signature, so fix and retry without calling tl_help.args (MCP, the op's signature); details.problems on some send checks
unauthorized401No credential, or the API key or token is unknown, expired or revoked.Send Authorization: Bearer with a tlk_ API key or an OAuth access token. To get one, see /docs/agents#connect.hint
forbidden403The credential lacks the op's scope (details.scope), or the action is one only a person may take (approving an envelope, changing the plan).Missing scope: reconnect asking for it; a person approves the new grant. Person-only action: tell the person what to do; do not retry.details.scope and hint when a scope is missing
not_found404No such envelope, template, webhook, document or op for this account. Another account's ids also read as not found, never as forbidden.Check the id. list, tpls and hooks show what this account has. For an unknown op, msg lists the valid ones.
conflict409Another call is changing the same envelope (envelope is busy; retry), or a stored file failed its integrity check.Busy: retry after a moment. An integrity failure is not fixed by retrying: report it at /contact.
invalid_state409The envelope's status does not allow this: editing after it was sent, downloading the signed PDF before completion, sending after the expiry date.msg says the current status and what was expected. Read tl_read status and do what that status allows; for an expired draft, set update {expiresInDays}.
not_your_turn409Signing order: an earlier signer has not signed yet. Raised on the signing page, not by agent ops.Wait. In status, the signer whose turn it is has turn: true.
missing_fields422A signer submitted without filling required fields. Raised on the signing page, not by agent ops.The signer fills the fields listed in details.fields.details.fields
plan_limit402The plan does not include this: an invoice link (redirect) needs the Team plan; adding a sender over the plan's limit.Only a person can change the plan: give them the pricing page; details.upgradeTo names the plan. Or retry without the feature (for example without redirect).details.upgradeTo, hint
plan_required402Sending needs a trial or a subscription, and this account has neither (or it ended). create with send: true stores nothing, so no draft is left behind; send leaves the draft as it was.Give details.checkoutUrl to the person. After they start the 14-day trial, retry the same call. Drafts, reads and downloads keep working meanwhile.details.checkoutUrl, details.plan, details.status, details.trialDays
rate_limited429The per-account burst limiter tripped (far above normal use), or a sign-up limit was reached.Wait details.retryAfter seconds (60 when absent), then retry. REST also sends a Retry-After header.details.retryAfter (seconds), when known
unsupported400Reserved for requests the server does not support. No current op returns it.Not expected; if seen, read msg.
billing_unavailable409A billing action from the dashboard cannot run on this server (no billing provider, or test-mode billing has no portal).Not an agent path: plans are changed by a person in the dashboard.
unavailable503A dependency could not be reached (email or payments). Nothing was sent or charged.Retry in a minute.

Retrying safely

  • Retry after waiting: rate_limited (wait details.retryAfter seconds), conflict with "envelope is busy", and unavailable.
  • Retry after a person acts: plan_required (they start the trial at details.checkoutUrl), plan_limit (they upgrade), forbidden for a missing scope (they approve a new grant).
  • Fix the call first: bad_request, not_found, invalid_state.

There is no idempotency key on ops. create is not idempotent: if a call times out and you cannot tell whether it ran, read tl_read {"op":"list"} (newest first, with titles) before creating again, or you may send the document twice. send on an envelope that is already sent fails with invalid_state rather than emailing again. Account webhook deliveries carry an idempotency-key header (the event id) so your endpoint can drop repeats.

JSON-RPC errors

The MCP endpoint answers protocol problems with JSON-RPC errors before any op runs. Authorization errors also set WWW-Authenticate, which is how OAuth clients know to sign in again or ask for more scope:

missing scope
HTTP/1.1 403 Forbidden
WWW-Authenticate: Bearer error="insufficient_scope", error_description="needs tl:send", resource_metadata="...", scope="tl:read tl:send"

{"jsonrpc":"2.0","id":1,"error":{"code":-32024,"message":"Forbidden: this credential lacks scope tl:send","data":{"scope":"tl:send"}}}
JSON-RPC error codes
codeNameHTTPWhen
-32700Parse error400The body is not JSON.
-32600Invalid Request400 (403 for a disallowed Origin, 413 over 30 MB)Not a JSON-RPC 2.0 message, a browser Origin that is not https or localhost, or a body over 30 MB.
-32001Unauthorized401No credential, or an invalid one. WWW-Authenticate points to the OAuth metadata; the message explains how to connect.
-32601Method not found404 on 2026-07-28, 200 beforeUnknown method, or an events/* method from a client older than 2026-07-28.
-32602Invalid params200Unknown tool, bad event arguments or cursor, or (2026-07-28) a resource that does not exist or is not yours.
-32002Resource not found200resources/read of a missing resource on revisions before 2026-07-28.
-32603Internal error500An unexpected server error.
-32020Header mismatch400A 2026-07-28 request whose MCP-Protocol-Version, Mcp-Method or Mcp-Name header is missing or does not match the body.
-32022Unsupported protocol version400An unknown protocol version; data lists supported and requested.
-32023NotFound200Unknown event name, or events/unsubscribe of a subscription that does not exist.
-32024Forbidden403 with WWW-Authenticate insufficient_scope (200 inside events)The credential lacks the scope the method needs (data.scope); events need tl:read.
-32025ResourceExhausted429 with Retry-AfterThe per-account burst limit on methods other than tools/call; data.retryAfter in seconds. tools/call reports rate_limited as a tool error instead.
-32026Unsupported200events/subscribe with a delivery mode other than webhook.
-32027CallbackEndpointError200events/subscribe: the endpoint did not echo the verification challenge; data.reason is connection_refused, timeout, tls_error, http_4xx, http_5xx or challenge_failed.

The event codes -32023 to -32027 come from the MCP Events extension; see the events reference.

Connect your agent and send a test envelope

Every plan includes the REST API and the MCP server, unlimited, with a 14-day free trial.