MegTrustDevelopers

Errors

Every failure is { error: { code, message } }. Branch on code — messages may be reworded.

error envelope
{
  "error": {
    "code": "validation_failed",
    "message": "The request body is invalid.",
    "details": {}
  }
}

details is present only on some errors, such as validation_failed. The set of codes is closed: a new code is only ever added for a new endpoint or behaviour, and an existing code never changes meaning within a version.

Codes

CodeHTTPMeaning
unauthorized401Unknown, revoked or expired key; bad signature; or a signature already used once.
invalid_timestamp401Clock more than 5 minutes off, or the timestamp is missing/malformed. Sync NTP.
rate_limited429Over 120 requests/minute for this key.
validation_failed400Body or query failed validation (including a malformed cursor) — see the details field.
idempotency_key_required400POST /withdrawals needs an Idempotency-Key header.
idempotency_conflict409That payment key was used for another payload. Recover the original payment before proceeding.
withdrawal_not_cancellable409The payout is past pending_approval, or an approver acted first. Re-read its status.
request_too_large413Request bodies are limited to 64 KiB.
wallet_not_found404No such wallet in your workspace.
withdrawal_not_found404No such withdrawal in your workspace.
transaction_not_found404No such transaction in your workspace.
asset_not_held422That wallet holds no such asset on that network.
destination_not_whitelisted422The destination is not an approved, verified destination yet.
no_approver_available422The workspace has no second approver configured.
withdrawal_failed422The request could not be processed.
service_unavailable503Temporary service failure. Honour Retry-After and preserve the payment key and body.
internal_error500Something went wrong on our side. Safe to retry with the same idempotency key.

A resource outside your workspace is always a 404, never a 403, so a response never confirms whether an id exists elsewhere.

Retrying

ResponseRetry?
429, 503Yes, after Retry-After seconds, with a newly signed attempt.
500, network failureYes; for a payout, only with the same Idempotency-Key and body.
401Not until you fix the cause: credentials, expiry, IP allowlist, clock, canonical encoding, or a resent signature.
Other 4xxNo — correct the request first.

See Sign a request for why every attempt needs a new signature.

On this page