SightRadardocs
API referenceFaces

Index faces from a photo

Detects all quality-gated faces in an image and stores them in the collection (Rekognition IndexFaces). (POST /v1/collections/{id}/index)

POST/v1/collections/{id}/index
Auth
Bearer API key
Billing
93 credits (real-time tier).

Detects all quality-gated faces in an image and stores them in the collection (Rekognition IndexFaces). Provide the image as JSON {url} / {gcsKey}, a multipart file, or raw image bytes. Optional photoId is the per-image key (defaults to a content hash).

Example request

curl -X POST "https://api.sightradar.com/v1/collections/$ID/index" \
  -H "Authorization: Bearer $SR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/photo.jpg"}'

Parameters

NameInTypeDescription
id requiredpathstring
photoIdquerystringPer-image key (also accepted in body).
Idempotency-KeyheaderstringOpt-in idempotency. A replay under the same key is never re-charged. For a selfie register it returns 200 with the stored result (Idempotent-Replay: true) when the registration identity matches; every other op returns 409.

Request body (application/json)

FieldTypeDescription
urlstringPublic image URL.
gcsKeystringGoogle Cloud Storage object key.
photoIdstringOptional per-image key.

Also accepts: multipart/form-data, application/octet-stream.

Response body

FieldTypeDescription
collection_idstring
photo_idstring
indexedintegerFaces stored.
detected_face_countinteger
rejected_face_countintegerDetected but quality-gated out.
facesobject[]
model_versionstring

Status codes

StatusMeaning
200Faces indexed.
400Cannot decode image, or no url/gcsKey/body provided.
401Missing or invalid API key.
402Wallet balance too low for this operation.
409A request with this Idempotency-Key is in flight or already processed.
413Image exceeds the 30 MB encoded size cap.
429Per-key RPS or per-customer concurrency limit exceeded.
502Engine error (the credit hold is refunded automatically).
Last updated

On this page