> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fidel80.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Verification Token

> Generate a Smart Capture verification token with the Fidel80 GraphQL API.

The `generateVerificationToken` mutation creates a verification token for an active Fidel80 workflow.

## Authentication

This mutation requires a valid Fidel80 API key.

```http theme={null}
Authorization: Bearer fidel80_your_api_key_here
```

## Mutation

```graphql theme={null}
mutation GenerateVerificationToken($input: GenerateVerificationTokenInput!) {
  generateVerificationToken(input: $input) {
    success
    message
    tokenString
    token {
      id
      status
      expiresAt
      workflow {
        id
        name
      }
    }
  }
}
```

## Example variables

```json theme={null}
{
  "input": {
    "workflowId": 123,
    "workflowVersionId": 456,
    "applicantFirstName": "John",
    "applicantLastName": "Doe",
    "applicantEmail": "user@example.com",
    "expiresInHours": 24
  }
}
```

## Required fields

### `workflowId`

The ID of the active workflow to use for the verification.

The workflow must belong to the authenticated organization.

### `workflowVersionId`

The ID of the workflow version to use.

The version must belong to the selected workflow.

## Optional fields

Supported optional inputs include:

* `applicantFirstName`
* `applicantLastName`
* `applicantEmail`
* `applicantPhone`
* `profileId`
* `metadata`
* `expiresInHours`

## Successful response

A successful request returns a `tokenString`.

Example:

```json theme={null}
{
  "data": {
    "generateVerificationToken": {
      "success": true,
      "message": "Verification token generated successfully",
      "tokenString": "returned-token-value",
      "token": {
        "id": "123",
        "status": "pending",
        "expiresAt": "..."
      }
    }
  }
}
```

## Create the verification link

Use the returned token to construct the applicant verification URL:

```text theme={null}
{FIDEL80_FRONTEND_URL}/verify/{tokenString}
```

## Validation performed by Fidel80

Before generating a token, Fidel80 verifies that:

* the request is authenticated,
* the authenticated user belongs to an organization,
* the selected workflow belongs to that organization,
* the workflow is active,
* the selected workflow version belongs to the workflow,
* applicable subscription and usage limits permit the verification.

If a `profileId` is provided, that profile must also belong to the authenticated organization.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.