API reference
Errors and rate limits
Red uses standard HTTP status codes. Every error body is JSON with a detail field: a string, or an array for field validation errors.
Error shape
Branch on the status code, not the message text. Messages are written for people and can change. 4xx means the request needs changing. 5xx means Red had a problem, so retry with backoff.
Error body
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json
{
"detail": [
{
"type": "value_error",
"loc": [
"body",
"video_url"
],
"msg": "Value error, URL must use https",
"input": "http://storage.example.com/interview.mp4",
"ctx": {
"error": {}
}
}
]
}Status codes
| Status | Message and cause | How to fix it |
|---|---|---|
| 401 | Invalid API keyWorkspace not foundThe key is mistyped, revoked or past its rotation grace period, or its workspace no longer exists. | Copy the key again from your secret store. Check that nothing trims or re-encodes the header. |
| 402 | Insufficient balance to run this scan. Upgrade to continue. Estimated cost: …, balance: …Add a payment method to activate your $6 monthly allowance.The workspace can't pay for a scan of this length. A balance problem found later ends the scan FAILED and sends scan.failed. See Polling and webhooks. | An owner adds a card or upgrades on the Billing page, then you resend the request. |
| 403 | Missing API key permissionSetting webhook_url needs the webhooks:manage permissionSandbox keys can't manage webhook endpoints, which also receive live events. Use a live key.system taxonomy templates are read-onlyTaxonomy templates apply to live scans; use a live key to manage themThe key lacks the scope this route needs, a scan sets webhook_url without webhooks:manage, a sandbox key calls the webhook endpoints API or changes an interview check, or the request edits a built-in interview check. | Add the scope to the key on the API keys page, use a live key for webhook endpoints and interview check changes, or clone the built-in interview check and edit the copy. |
| 404 | Scan not foundJob group not foundEndpoint not foundtaxonomy template not foundThe id doesn't exist in the key's workspace. | Check the id, and that the key belongs to the workspace that created the resource. |
| 409 | Scan is not completedA workspace can have at most 20 webhook endpointsAn export was requested before the scan finished, or the workspace already has 20 webhook endpoints. | Wait for scan.completed, or poll until status is COMPLETED, then export. Delete an endpoint you no longer use before adding one. |
| 422 | One of video_url, audio_url, or transcript is requiredUnknown job group in set_idstaxonomy template not foundField required (a missing x-api-key header)sandbox_scenario is only accepted with a sandbox keyset_ids is not supported for sandbox scansJob groups hold live scans only; use a live key to manage themstatus must be one of: PENDING, PROCESSING, COMPLETED, FAILEDInput should be greater than or equal to 0Input should be less than or equal to 100A field, header or query parameter is missing, has the wrong type or is out of range, names something that doesn't exist, or doesn't fit the key's mode. | Read detail. For field validation it is an array: loc names the field and msg says what's wrong. |
| 429 | Rate limit exceededSandbox daily scan limit reachedAt most 10 test sends and replays a minuteThe key made more than 120 requests in the current minute, the workspace ran 200 sandbox scans today (UTC), or it sent more than 10 webhook test events this minute. | Wait for Retry-After seconds, then retry. Move to webhooks if polling is the cause. |
| 503 | Sandbox is temporarily unavailableTest sends and replays are unavailable. Try again shortly.Red couldn't check the sandbox daily limit or the webhook test-send limit, so it refused the request rather than run it unmetered. | Retry with backoff. Live scans are not affected. |
Rate limits
Each key can make 120 requests per minute. The window resets on the minute, and every /v1 response says where you stand:
X-RateLimit-Limit: requests allowed per minute.X-RateLimit-Remaining: requests left in this minute.X-RateLimit-Reset: when the window resets, in Unix seconds.Retry-After: on a429only, seconds to wait before retrying.
Polling is the usual cause of 429s. Poll each scan every 5 seconds at most, or switch to webhooks once you run more than a handful of scans at a time.
GETRetry on 429
export RED_API_KEY="<YOUR_API_KEY>"
for attempt in 1 2 3 4 5; do
status=$(curl -s -o scan.json -D headers.txt -w "%{http_code}" \
"https://red-api.apps.heymilo.cloud/v1/scans/8F3A91C24D7E0B5A6C1D9E2F3B4A5C6D7E8F9A0B1C2D3E4F5A6B7C8D9E0F1A2B" \
-H "x-api-key: $RED_API_KEY")
[ "$status" != "429" ] && break
wait=$(awk 'tolower($1) == "retry-after:" { print $2 + 0 }' headers.txt)
sleep "${wait:-5}"
doneResponse429
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1790157660
Retry-After: 13
{
"detail": "Rate limit exceeded"
}