Skip to main content
The API uses standard HTTP status codes and returns errors in a consistent JSON format.

Error response format

All error responses include a detail field:
For validation errors, the response includes structured field-level details:

Status codes

Telling the two 402s apart

402 carries two different failures that need opposite fixes: an exhausted AI Credit Wallet (top up credits) and a plan feature or allowance cap (upgrade the plan). Do not infer which from the wording of detail — it has been wrong in practice, reporting “insufficient credits” to a workspace whose wallet was funded. Every 402 carries an X-Morphic-Error-Code response header:

Handling errors