Skip to main content

API Reference

Base URL & Headers

https://<your-auth-service-domain>

All requests and responses use JSON:

Content-Type: application/json

Endpoint Summary

MethodEndpointAuthDescription
POST/auth/users/registerJWTRegister new user
GET/auth/devices/challenge/:device_verifying_keyJWTGet challenge for device registration
POST/auth/devices/registerJWT + Device Signature + Face (conditional)Register device verifying key
POST/v2/auth/devices/register-and-recoverJWT + Device Signature + FaceRegister device and recover keyshares in one call
POST/v2/auth/face/init-sessionJWTRelay the FaceTec SDK initialization request
POST/v2/auth/face/processJWT + write:face or read:faceCreate or continue a face enrollment or match scan
GET/v2/keysJWTList user's MPC keys
GET/v2/devicesJWTList user's devices
POST/v2/keyshare/backupJWTSave encrypted keyshares
POST/v2/keyshare/recoverJWT + FaceFetch encrypted keyshares
GET/transactionsJWTGet transaction history
GET/v2/faceJWTGet face registration status
GET/v2/admin/groupsJWT + update:default_policyList policy groups (admin)
GET/v2/admin/groups/:group_idJWT + update:default_policyGet a group's policy (admin)
PUT/v2/admin/groups/:group_id/policyJWT + update:default_policyReplace a group's policy (admin)

Authentication Methods

JWT Authentication

All endpoints require a valid Access Token (JWT) from the External Auth Service (e.g., Auth0).

Authorization: Bearer <access_token>

JWT Claims Used:

ClaimDescription
subUser identifier (auth0_id)
audMust include API identifier
expToken expiration time
scopeGranted permissions

Device Signature Authentication

Device registration endpoints require an additional Device Signature to prove possession of the device's private key (stored in Secure Enclave).

Signature Generation:

  1. Create JSON_MESSAGE containing request body fields
  2. Canonicalize JSON_MESSAGE (sort keys alphabetically, remove whitespace) per RFC 8785
  3. Compute: M = SHA256(bytes(canonicalize(JSON_MESSAGE)))
  4. Generate: DER-encoded ECDSA signature of M (NIST P-256 curve)
  5. Hex-encode the signature

Step-Up Authentication (JWT + Face)

Sensitive operations require JWT + a successful face match session:

  • POST /auth/devices/register: required if the user has already enrolled a face
  • POST /v2/auth/devices/register-and-recover: always required
  • POST /v2/keyshare/recover: always required

The first request of a match scan to POST /v2/auth/face/process returns a face_session_id. The app includes that ID in every later request for the scan. Once the scan completes with succeeded: true, the app sends the same ID in the sensitive operation's request body:

FieldTypeDescription
face_session_idstringID of a match scan that completed with succeeded: true

Auth-svc spends the session when it accepts the sensitive operation. Each successful match authorizes exactly one operation. The validity window begins when the match completes and lasts FACETEC_SESSION_EXPIRY_SECONDS, which is 300 seconds by default.


Error Codes

All errors follow this format:

{
"error": "Human-readable error description",
"code": 100101
}