Skip to main content

API Reference

Base URL: https://api.surt.com

All requests require your API key in the Authorization header.

Create Portal Token

Creates a JWT portal token for initializing FaceGuard in your frontend.

POST /faceguard/session/portal

Request

cURL
curl --location 'https://api.surt.com/faceguard/session/portal' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"workflow_id": "YOUR_WORKFLOW_ID",
"customer": {
"customer_id": "user_123",
"email": "customer@example.com",
"first_name": "John",
"last_name": "Doe"
}
}'

Request Body

FieldTypeRequiredDescription
workflow_idstringYesYour FaceGuard workflow ID from the dashboard
customerobjectYesCustomer details (see below)

Customer Object

FieldTypeRequiredDescription
customer_idstringYesYour unique identifier for the user
emailstringNoUser's email
first_namestringNoUser's first name
last_namestringNoUser's last name

Response

Response
{
"status_code": 200,
"message": "Portal token created",
"data": {
"token": "eyJ0eXAiOiJKV1Qi...",
"customer_id": "user_123"
}
}

Pass the token to your frontend (SDK, iframe URL, or WebView URL). Portal tokens expire after 30 minutes.


Session Endpoints

These endpoints are used internally by the FaceGuard app. They are documented here for reference but are not called directly by integrators.

Create Session

Creates a FaceGuard session from a portal token. Called automatically when FaceGuard loads.

POST /faceguard/session
Authorization: Bearer PORTAL_TOKEN

Get Session Status

Polls the latest session status using the portal token. Used by the QR code flow to detect when the mobile user completes verification.

GET /faceguard/session/status
Authorization: Bearer PORTAL_TOKEN

Shortcode Endpoints

Used by the QR code flow for phone handoff.

MethodPathAuthDescription
POST/faceguard/short-codePortal JWTCreate a shortcode
PUT/faceguard/short-codePortal JWTRefresh a shortcode
GET/faceguard/short-code?code=ABC123PublicRedeem a shortcode

Response Envelope

All responses use the standard Surt envelope:

{
"status_code": 200,
"message": "Success",
"data": { ... }
}