The scorings API starts a candidate scoring against the candidate's brand. The candidate must already be uploaded and verified.
Flow
- Create a candidate upload with
/api/uploads/create. - Upload bytes to the returned
uploadUrl. - Complete the upload with
/api/uploads/complete. - Create the scoring with
/api/scorings/create. - Open the result in the app or poll your own workflow using the returned identifiers.
Create upload
curl -X POST https://app.cortex.ad/api/uploads/create \
-H "Authorization: Bearer $CORTEX_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $UPLOAD_KEY" \
-d '{
"brand_id": "brand_123",
"original_filename": "candidate.mp4",
"mime_type_hint": "video/mp4",
"size_bytes_hint": 12800000,
"purpose": "candidate"
}'
Response:
{
"video_id": "video_123",
"uploadUrl": "https://..."
}
Upload the file directly to uploadUrl with the same MIME type.
Complete upload
curl -X POST https://app.cortex.ad/api/uploads/complete \
-H "Authorization: Bearer $CORTEX_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $UPLOAD_KEY" \
-d '{"video_id":"video_123"}'
Candidate uploads return after server verification. Reference uploads may start processing jobs, but candidates are ready to score after upload verification.
Create scoring
curl -X POST https://app.cortex.ad/api/scorings/create \
-H "Authorization: Bearer $CORTEX_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"video_id":"video_123"}'
video_id is required. The brand is resolved from the candidate video.
Responses
202 Accepted means a new scoring was created:
{
"scoring_id": "scoring_123",
"job_id": "job_123"
}
200 OK can mean the same idempotent request already committed and the existing scoring is returned:
{
"scoring_id": "scoring_123"
}
409 Conflict with idempotency_key_in_flight means the same key is already running. Retry after the Retry-After header.
Product-state errors
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request | Missing or invalid JSON. |
| 404 | candidate_not_found | The candidate video does not exist in this workspace. |
| 409 | candidate_not_ready | Upload is not complete. |
| 422 | no_ready_signature | Build a ready signature first. |
| 402 | quota_exceeded | The current period has no remaining scoring capacity. |
| 402 | trial_expired | The trial has ended. |
| 402 | subscription_inactive | The workspace has no active writable subscription state. |
| 429 | rate_limited | Too many requests. Honor Retry-After. |
Use Idempotency-Key for all create operations. Do not reuse a key for a different candidate or request body.