Create a hosted verification link
POST /api/v1/kyc/links
POST https://api.trustverify.co.uk/api/v1/kyc/links
Creates a one-time link to a hosted identity check page (ID document, selfie and liveness check). The person opens the URL, completes the check, and the result is available on GET /api/v1/kyc/links/{id} and, when configured, on the verification.completed webhook. The url is returned only on this create response. A test key (tv_test_sk_…) creates a sandbox link and never runs a paid check. A live key is refused when the account cannot run live identity checks (plan, included feature, owner verification, or monthly allowance). There is no list endpoint.
Request body#
| Field | Type | Description |
|---|---|---|
| externalReference | string | Your own id for this person (also accepted as `reference`). Echoed unchanged on the link and on verification.completed. |
| fullName | string | Optional. Shown to the person on the check page. Not returned on later reads. |
| returnUrl | string | Optional. An https URL the person is sent back to when they finish. |
| expiresInMinutes | integer | From 15 to 10080 (7 days). Default is 4320 (72 hours). |
| sandboxOutcome | string: "approve" | "review" | "block" | With a test key, the result the link will return once it is opened. Ignored for live keys. Aliases accepted: approved or passed → approve; blocked, failed or rejected → block. Also accepted as metadata.forceStatus. |
| sharetribeUserId | string | Sharetribe user id (UUID). If set, Sharetribe must already be connected on this account, or the call is 400 sharetribe_not_connected. |
| ifPending | string: "reject" | "replace" | Optional, needs externalReference. What to do if a link for the same externalReference is already open (unused and unexpired). "reject" answers 409 verification_already_open and creates nothing; "replace" cancels the open link and issues a new one. If the person has already submitted and the check is running, both answer 409 verification_in_progress. Left out, a new link is always created. |
Example request#
curl -sS -X POST 'https://api.trustverify.co.uk/api/v1/kyc/links' \
-H "Authorization: Bearer $TRUSTVERIFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"externalReference": "order_12345",
"fullName": "Jane Example",
"returnUrl": "https://example.com/verification/done"
}'Responses#
201 Link created — includes the one-time url
| Field | Type | Description |
|---|---|---|
| idrequired | string | |
| objectrequired | string: "verification_link" | |
| url | string | The one-time hosted page URL. Returned only when the link is created. GET and cancel do not include it, so a later read cannot recover the token. |
| statusrequired | string: "pending" | "submitted" | "completed" | "cancelled" | "expired" | expired is computed on read for a pending link whose expiresAt has passed; it is not stored |
| environmentrequired | string: "test" | "live" | |
| externalReferencerequired | string,null | |
| sharetribeUserIdrequired | string,null | |
| expiresAtrequired | string,null | |
| createdAtrequired | string,null | |
| submittedAtrequired | string,null | |
| completedAtrequired | string,null | |
| resultrequired |
400 validation_failed (returnUrl must be https, expiresInMinutes out of range, sharetribeUserId not a UUID, or a field too l
validation_failed (returnUrl must be https, expiresInMinutes out of range, sharetribeUserId not a UUID, or a field too long or not a string) or sharetribe_not_connected
401 Missing, invalid or revoked API key
403 A live key was used on an account that cannot run live identity checks (plan, included feature, or owner verification).
409 Only with ifPending: verification_already_open (a link for this externalReference is already open; nothing was created)
Only with ifPending: verification_already_open (a link for this externalReference is already open; nothing was created) or verification_in_progress (the person has submitted and the check is running). The body has the existing linkId.
429 QUOTA_EXCEEDED — all identity checks included in the plan this month are used. Nothing was charged. Or the per-minute ke
QUOTA_EXCEEDED — all identity checks included in the plan this month are used. Nothing was charged. Or the per-minute key limit was reached.