HTTP status codes
Error response envelope
All error responses follow the same envelope structure as successful ones:data: alwaysnullon errorsuccessful: alwaysfalseon errormessages: array of human-readable error strings; may contain multiple messages
Common 400 errors
A400 response means the request syntax or parameters are invalid. Common causes include:
Invalid mobile number
09.
Invalid filter parameter
filter__is_finished use boolean strings (true or false).
Missing required profile field
name, mobile, birth, is_male) are present and valid.
401 vs 403
These two statuses both indicate access problems, but the cause and fix differ. 401 Unauthorized TheAPI-KEY header is missing or the key does not exist.
- The header name is exactly
API-KEY - The value matches the key generated in the organizer panel
- The key is active and has not been revoked
- The API key is expired or suspended
- The requesting IP address is not allowlisted
- A payment or quota issue exists on the account
- The record or roadmap requires profile authentication first (
auth_required: true)
409 conflicts
A409 response means the resource is in a state that prevents the requested operation.
Already completed
external_id must be unique per organizer. Choose a different value.
Roadmap record authentication error
/record/{token}/auth/ for a record that is part of a roadmap. Use /roadmap/{token}/auth/ instead.
Incomplete roadmap
/roadmap/{token}/generate/.
Rate limits
The Braintest API enforces per-minute and per-hour request limits on every API key. When you exceed either limit, the API returns HTTP429 Too Many Requests. See Rate Limits for the exact values and handling guidance.
General troubleshooting tips
- Always check the
messagesarray first. It contains the most specific explanation. - Verify the base URL is
https://braintest.ir/api/v2/and the path is correct. - Confirm the
API-KEYheader is present and properly formatted. - For
400errors, validate your JSON body against the field requirements in the relevant guide. - For
409errors, check the current resource status before retrying the operation.

