Skip to main content
POST
/
identity
/
consents
/
widget
Get KYC Widget URL
curl --request POST \
  --url https://api.sandbox.sardine.ai/v1/identity/consents/widget \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customerId": "3f8c1a22-1234-4abc-9def-000000000001",
  "successUrl": "https://yourapp.com/kyc/success",
  "scope": [
    "profile",
    "doc_kyc"
  ],
  "flow": "kyc_input"
}
'
{
  "widgetUrl": "https://identity.sardine.ai/?client_token=abc123&consent_id=xyz789&success_url=https%3A%2F%2Fyourapp.com%2Fkyc%2Fsuccess"
}

Authorizations

Authorization
string
header
required

HTTP Basic Auth. Use your clientId as the username and clientSecret as the password.

Body

application/json
customerId
string
required

Sardine customer UUID

Example:

"3f8c1a22-1234-4abc-9def-000000000001"

successUrl
string<uri>

URL to redirect the user to after successful completion

Example:

"https://yourapp.com/kyc/success"

manualKycUrl
string<uri>

Fallback URL if automated verification fails and manual review is needed

Example:

"https://yourapp.com/kyc/manual"

scope
enum<string>[]

Verification scopes to request. Defaults to ["profile"]. Use ["profile", "doc_kyc"] for a full document verification flow.

Available options:
profile,
doc_kyc,
liveness,
ssn
Example:
["profile", "doc_kyc"]
flow
enum<string>
default:kyc_input

Verification flow type. Defaults to kyc_input.

Available options:
kyc_input,
kyc_sharing
Example:

"kyc_input"

autoRedirect
boolean
default:false

If true, the widget automatically redirects to successUrl upon completion without showing a confirmation screen.

Example:

false

Response

Widget URL generated successfully

widgetUrl
string<uri>

Fully-formed URL to the Sardine hosted KYC widget. Redirect the user here or embed it in an iframe.

Example:

"https://identity.sardine.ai/?client_token=abc123&consent_id=xyz789&success_url=..."