# Errors & limits

> Interpret failures, handle conflicts, and stay within service limits.

Source: https://math-api.qmindlabs.ai/docs/guides/errors

## Error format

```json
{
  "code": "math_workflow_conflict",
  "message": "The task changed. Read its latest version before retrying."
}
```

Errors include `code` and `message`. Save the `x-request-id` response header for troubleshooting. Example messages are illustrative; branch on the HTTP status and documented code.

## HTTP status codes

| Status | Meaning | Next step |
| --- | --- | --- |
| 400 | Invalid request | Check fields and allowed values. |
| 401 | Authentication required or invalid key | Check the key and expiry. |
| 403 | Access denied | Check role, scopes, membership, and origin. |
| 404 | Unavailable or outside your assignment | Check the ID and task access. |
| 405 | Unsupported method | Use the documented HTTP method. |
| 409 | Version, state, or evidence conflict | Read the latest state before retrying. |
| 413 / 415 | Body too large / unsupported media type | Check size and Content-Type. |
| 429 | Key rate limit reached | Wait until the next UTC minute. |
| 503 | Temporary service or capacity issue | Back off; verify state before retrying a write. |

## Service limits

| Resource | Limit |
| --- | --- |
| Authenticated requests | 600 per UTC minute per key across the service. |
| JSON request body | 40 KiB |
| Task attachment | 16 MiB |
| Bug screenshot | 8 MiB |
| Page size | 100 records |
| Active keys | 50 per member |

## Retry safely

Use bounded backoff for temporary read failures. For a write that times out, fetch the current state and history before resubmitting; the original request may have succeeded. The API does not advertise an idempotency-key mechanism.
