2xx range indicate success, 4xx indicate a problem with the request, and 5xx indicate a server-side error.
Response format
Successful responses wrap their payload in adata field:
error message:
Status codes
| Status | Meaning | What to do |
|---|---|---|
200 OK | Request succeeded. | — |
201 Created | Resource created. | Read the new resource from data. |
400 Bad Request | Malformed request or invalid body. | Check field names, types, and required fields. |
401 Unauthorized | Missing or invalid credentials. | Verify your x-metal-client-id and x-metal-api-key headers. |
403 Forbidden | Authenticated but not allowed. | Your key lacks permission for this resource or route. |
404 Not Found | Resource does not exist in your organization. | Confirm the id and that it belongs to your org. |
422 Unprocessable Entity | Request understood but cannot be processed (for example, a plan limit). | Resolve the limit or conflict described in the body. |
429 Too Many Requests | Rate limit exceeded. | Back off and retry. See Rate limits. |
500 Internal Server Error | Something went wrong on Metal’s side. | Retry with backoff; contact support if it persists. |
Handling errors
Always check the status code before reading the body. Treat429 and 5xx as retryable with exponential backoff; treat 4xx (other than 429) as a problem to fix in your request.