REST API

Errors

The error format of the Brunel REST API, every error code with its HTTP status and meaning, and how to handle them. Generated from the API's own error table.

Format

json
{ "error": { "code": "upgrade_required", "message": "Your plan does not include this, or its monthly quota is used up." } }

Handle errors by code, not by message: messages are written for people and may change.

Codes

StatusCodeMeaning
400invalid_argumentsA field is missing or invalid; the message says which.
401auth_requiredNo API key was sent.
401invalid_api_keyThe key is wrong, revoked or expired.
402upgrade_requiredYour plan does not include this, or its monthly quota is used up.
403read_only_keyA read-only key called an endpoint that writes.
403ip_not_allowedThe key's IP allow list does not include this address.
403policy_deniedYour team's restricted access refuses this address.
404not_foundUnknown endpoint, or a project you cannot access.
409not_analyzedAnalyze the repository before designing it.
409not_designedDesign the infrastructure before refining it.
502job_failedThe analysis or design failed; the message says why.

Other codes you may meet:

StatusCodeMeaning
403browser_onlyThe action needs the Brunel web app, not an API key
403cross_originA browser request came from another site
415unsupported_media_typeSend a JSON body with Content-Type: application/json
500internalUnexpected error: retry later and quote the x-request-id

Handling

  • 4xx errors other than 429 will fail again unchanged: fix the request or the account.
  • 402 upgrade_required: a plan limit or quota; see Plans and limits.
  • 409 not_analyzed / not_designed: call the steps in order (analyze, design, refine).
  • 502 job_failed and 500: retry once after a short wait; if it persists, contact support with the x-request-id.
Errors · Brunel Docs