> For the complete documentation index, see [llms.txt](https://manual.personr.co/api-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.personr.co/api-documentation/applicants/generating-a-verification-link.md).

# Generating a verification link

Once you've created an applicant, you can generate a hosted link for verification.

This endpoint allows you to generate a hosted verification link, where applicants can upload their documents and verify themselves on your chosen flow.

By default, verification links are hosted on our domain <https://enterprise.personr.co> and are easily embeddable into your website or mobile application. A custom domain can be configured from within the platform if you intend to self-host.

Once an individual has finished uploading their documents, the verification will trigger and process automatically. You can go to [Retrieving applicant verification results](/api-documentation/applicant-results/retrieving-applicant-verification-results.md) to retrieve the results, or create a webhook by going to [Setting up a webhook](/api-documentation/applicant-results/retrieving-applicant-verification-results/setting-up-a-webhook.md).

Webhooks are the recommended method for integration.

#### Example Verification Screen

<div align="left" data-full-width="false"><figure><img src="https://2927352434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyAmEVMxhOOdXgxn7sjnz%2Fuploads%2Ft5M9mi470PCO7VWw9Uob%2FIMG_3489%20(1).png?alt=media&amp;token=3772e9bd-94ae-4126-aad7-03ca54c523a1" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="https://2927352434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyAmEVMxhOOdXgxn7sjnz%2Fuploads%2FSAzhbFKDIQ4loeyRYPKU%2FIMG_3491.PNG?alt=media&amp;token=df13a989-b5a9-4a72-88d3-26b27acff893" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="https://2927352434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyAmEVMxhOOdXgxn7sjnz%2Fuploads%2FLxRNBmnRGh7tnPWb3Icq%2FIMG_3492.PNG?alt=media&amp;token=469516f1-4a79-41ac-82db-8f13c1d35e31" alt="" width="188"><figcaption></figcaption></figure></div>

Whitelabelling is available upon request. This allows you to customise the verification screens' logo, font, and colours to align with your brand. Reach out to your account manager to discuss your options.

We support all device types and modern browsers for verification.

***

## Generate a verification link

<mark style="color:green;">`POST`</mark> `/api-verificationlink-create`

Generate a verification link, to send to an applicant.

**Headers**

| Name          | Value                 |
| ------------- | --------------------- |
| Content-Type  | `multipart/form-data` |
| Authorization | `Bearer YOUR_TOKEN`   |

**Body**

<table><thead><tr><th>Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>applicant</code></td><td>string</td><td>Unique applicantId generated on applicant creation <mark style="color:red;">(required)</mark></td></tr><tr><td><code>returnUrl</code></td><td>string</td><td>Where to send the applicant once they've finished verifying (optional). Must be a full URL starting with <code>https://</code>, or your app's own scheme for a deep link (for example <code>myapp://verification-complete</code>). Overrides the flow's Return URL. See <a href="#returning-applicants-to-your-app-or-website">Returning applicants to your app or website</a>.</td></tr></tbody></table>

#### Request

{% tabs %}
{% tab title="cURL" %}

```sh
curl --location 'https://enterprise.personr.co/api/1.1/wf/api-verificationlink-create' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--form 'applicant="4242424242424x424242424242424242"' \
--form 'returnUrl="https://example.com/verification-complete"'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var axios = require('axios');
var FormData = require('form-data');
var data = new FormData();
data.append('applicant', '4242424242424x424242424242424242');
data.append('returnUrl', 'https://example.com/verification-complete'); // optional

var config = {
  method: 'post',
maxBodyLength: Infinity,
  url: 'https://enterprise.personr.co/api/1.1/wf/api-verificationlink-create',
  headers: { 
    'Authorization': 'Bearer YOUR_TOKEN',
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
var form = new FormData();
form.append("applicant", "4242424242424x424242424242424242");
form.append("returnUrl", "https://example.com/verification-complete"); // optional

var settings = {
  "url": "https://enterprise.personr.co/api/1.1/wf/api-verificationlink-create",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer YOUR_TOKEN"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require "uri"
require "net/http"

url = URI("https://enterprise.personr.co/api/1.1/wf/api-verificationlink-create")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer YOUR_TOKEN"
form_data = [['applicant', '4242424242424x424242424242424242'], ['returnUrl', 'https://example.com/verification-complete']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://enterprise.personr.co/api/1.1/wf/api-verificationlink-create"

payload={'applicant': '4242424242424x424242424242424242',
         'returnUrl': 'https://example.com/verification-complete'}  # returnUrl is optional
files=[

]
headers = {
  'Authorization': 'Bearer YOUR_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "status": "success",
  "response": {
    "verificationLink": "https://enterprise.personr.co/verification/4242424242424x424242424242424242",
    "customLink": "https://enterprise.personr.co/verification/4242424242424x424242424242424242",
    "returnUrl": "https://example.com/verification-complete"
  }
}
```

`returnUrl` is only included when you sent one.
{% endtab %}

{% tab title="200 - Invalid returnUrl" %}

```json
{
  "status": "success",
  "response": {
    "error": "invalid_return_url",
    "message": "returnUrl must be a full URL starting with https:// or your app's own scheme (for example myapp://verification-complete). No link was created."
  }
}
```

No link is created. Check `response.error` and fix the URL before trying again.
{% endtab %}

{% tab title="400" %}

```json
{
    "statusCode": 400,
    "message": "Error: incorrect applicantId provided"
}
```

{% endtab %}
{% endtabs %}

#### Verification Link

The `verificationLink` key contains the standard **enterprise.personr.co** domain that applicants can access to provide information and go through the flow.

#### Custom Link

The `customLink` key contains the custom domain that you have linked to the platform. To return a custom link with this endpoint, you need to specify the domain you wish to use when editing or creating a flow.

Custom links default to **enterprise.personr.co** if you have not specified which domain you'd like to use when creating or editing a flow.

#### Returning applicants to your app or website

Applicants can be sent back to your app or website automatically once they've finished and their verification has been recorded, usually a few seconds after they submit. There are two ways to set where they go:

* **On the flow:** in the dashboard, open the flow and add a **Return URL** under its settings. Every link on that flow uses it, including links you create in the dashboard.
* **On the link:** send `returnUrl` when you create the link. This overrides the flow's Return URL for that link only, so you can include your own reference in it (for example `?ref=12345`).

With neither set, applicants stay on our completion screen.

* Use an `https://` URL to send them to a page on your website, or your app's own scheme (for example `myapp://verification-complete`) to reopen your mobile app.
* Being redirected only means the applicant has finished. Always confirm the outcome with a webhook or [Retrieving applicant verification results](/api-documentation/applicant-results/retrieving-applicant-verification-results.md) before acting on it.

{% hint style="info" %}
**Opening links inside a mobile app:** use an in-app browser tab (`SFSafariViewController` on iOS, Chrome Custom Tabs on Android). Camera access for the document and selfie steps works there with no extra set-up, and an app-scheme return URL hands the applicant straight back to your app. If you embed the link in a web view (`WKWebView` or Android `WebView`) instead, your app must allow camera access and inline media playback, or the capture steps can't start.
{% endhint %}

{% hint style="info" %}
Verification links aren't sent to an applicant's email or phone number by default.
{% endhint %}

{% hint style="info" %}
For more customisation and control over what your users see, upload document images directly via API instead. Head to the next page to read more.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://manual.personr.co/api-documentation/applicants/generating-a-verification-link.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
