FaceCard Docs
API reference

POST /v1/challenges

Request a single-use challenge before every enroll or match.

POST /v1/challenges

Issues a single-use challenge bound to your app. It expires after 60 seconds. Every enroll and match needs a fresh one. See Challenges and replay protection.

Credential: publishable key, from an allowed Origin. No request body.

Request

curl -X POST https://api.facecard.dev/v1/challenges \
  -H "X-FaceCard-Key: fc_pk_live_xxx" \
  -H "Origin: https://app.example.com"

Response

200 OK

{
  "challenge_id": "ch_...",
  "nonce": "Zm9vYmFy...",
  "expires_at": "2026-10-14T12:01:00.000Z"
}
FieldTypeDescription
challenge_idstringPass this as challenge_id to enroll or match.
noncestring32 random bytes, base64url.
expires_atstringISO 8601 time. 60 seconds after issue.

Errors

StatusCodeWhen
401unauthorizedMissing or invalid key.
403origin_not_allowedThe Origin is not on the app's allow list.
429rate_limitedMore than 30 requests a minute from this IP.
429plan_limit_reachedThe team is over its monthly auth limit.

On this page