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

# Generate KYC token

> Creates a KYC verification session token. Pass the returned `tokenString` to your frontend or SDK to launch the verification flow.



## OpenAPI

````yaml /openapi/kyc.yaml post /api/v2/token
openapi: 3.1.0
info:
  title: iDenfy IVS Core API
  version: 0.0.0
  description: iDenfy Identity Verification Service's Core API documentation.
  contact:
    name: API Support
    url: https://idenfy-ivs.atlassian.net/servicedesk/customer/portal/1/group/-1
  x-logo:
    url: /static/idenfy_logo.svg
    altText: iDenfy logo
servers:
  - url: https://ivs.idenfy.com
security: []
tags:
  - name: KYC Token
    description: Endpoints for creating KYC verification session tokens.
  - name: KYC Verifications
    description: Endpoints for actions with KYC verifications.
  - name: Webhooks
    description: Webhooks.
externalDocs:
  description: For other/more docs on iDenfy services visit our main documentation page.
  url: https://documentation.idenfy.com
paths:
  /api/v2/token:
    post:
      tags:
        - KYC Token
      summary: Generate KYC token
      description: >-
        Creates a KYC verification session token. Pass the returned
        `tokenString` to your frontend or SDK to launch the verification flow.
      operationId: kycTokensCreate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - clientId
                - tokenType
              properties:
                clientId:
                  type: string
                  maxLength: 100
                  description: A unique string identifying the client on your side.
                tokenType:
                  type: string
                  enum:
                    - IDENTIFICATION
                    - DOCUMENT
                  description: |-
                    - `IDENTIFICATION` — document scan + selfie (default)
                    - `DOCUMENT` — document scan only
                externalRef:
                  type: string
                  nullable: true
                  maxLength: 40
                  description: Optional internal reference. Returned as-is in webhooks.
                generateDigitString:
                  type: boolean
                  default: false
                  description: If `true`, generates an 8-digit mobile app code.
                lifetime:
                  type: integer
                  minimum: 0
                  maximum: 2592000
                  description: Token validity in seconds. Maximum 2,592,000 (30 days).
                locale:
                  type: string
                  nullable: true
                  maxLength: 7
                  description: UI language code (e.g. `en`, `de`, `ko`).
                sessionLength:
                  type: integer
                  minimum: 60
                  maximum: 3600
                  description: Seconds the user has to complete verification once started.
                allowedCountries:
                  type: array
                  nullable: true
                  items:
                    type: string
                  description: Restrict accepted document-issuing countries (ISO alpha-2).
                allowedDocuments:
                  type: array
                  nullable: true
                  items:
                    type: string
                  description: >-
                    Restrict accepted document types (e.g. `PASSPORT`,
                    `ID_CARD`).
                client:
                  type: object
                  nullable: true
                  description: >-
                    Pre-fill known client data. Mismatches trigger `SUSPECTED`
                    status.
                  properties:
                    name:
                      type: string
                      nullable: true
                      maxLength: 100
                    surname:
                      type: string
                      nullable: true
                      maxLength: 100
                    dateOfBirth:
                      type: string
                      format: date
                      nullable: true
                    nationality:
                      type: string
                      nullable: true
                    documentNumber:
                      type: string
                      nullable: true
                      maxLength: 50
                    personalNumber:
                      type: string
                      nullable: true
                      maxLength: 50
                    sex:
                      type: string
                      nullable: true
                      enum:
                        - M
                        - F
                    dateOfExpiry:
                      type: string
                      format: date
                      nullable: true
                    dateOfIssue:
                      type: string
                      nullable: true
                urls:
                  type: object
                  nullable: true
                  description: Override default redirect URLs for this session.
                  properties:
                    successUrl:
                      type: string
                      format: uri
                      nullable: true
                    failUrl:
                      type: string
                      format: uri
                      nullable: true
                    unverifiedUrl:
                      type: string
                      format: uri
                      nullable: true
                    webhookUrl:
                      type: string
                      format: uri
                      nullable: true
                      description: Override webhook URL for this session only.
                settings:
                  type: object
                  nullable: true
                  description: Session-level feature overrides.
                  properties:
                    verifyEmail:
                      type: boolean
                    verifyPhone:
                      type: boolean
                    verifyBank:
                      type: boolean
                    verifyBankAccounts:
                      type: boolean
                    verifyBankBalances:
                      type: boolean
                    verifyBankTransactions:
                      type: boolean
                    verifyPoaAddress:
                      type: boolean
                    showInstructions:
                      type: boolean
                    reviewFailedVerifications:
                      type: boolean
                    reviewSuccessfulVerifications:
                      type: boolean
                questionnaire:
                  type: string
                  nullable: true
                  description: >-
                    Questionnaire `key` for this session. Pass `null` to
                    disable.
                questionnaireRequired:
                  type: boolean
                  default: true
                riskAssessmentProfile:
                  type: string
                  format: uuid
                  nullable: true
                address:
                  type: string
                  nullable: true
                  description: Client address for Proof of Address verification.
      responses:
        '201':
          description: Token created successfully.
          content:
            application/json:
              schema:
                type: object
                required:
                  - tokenString
                  - scanRef
                  - isValid
                  - tokenType
                properties:
                  tokenString:
                    type: string
                    readOnly: true
                    description: >-
                      Pass this to the frontend, SDK, or redirect URL to start
                      verification.
                  scanRef:
                    type: string
                    readOnly: true
                    description: >-
                      Unique session ID. Store this to correlate with webhook
                      results.
                  clientId:
                    type: string
                    nullable: true
                  digitString:
                    type: string
                    nullable: true
                    readOnly: true
                    description: >-
                      8-digit mobile code. Only present when
                      `generateDigitString` was `true`.
                  expiration:
                    type: string
                    format: date-time
                    readOnly: true
                  isValid:
                    type: boolean
                    readOnly: true
                  isActive:
                    type: boolean
                    readOnly: true
                    deprecated: true
                  tokenType:
                    type: string
                    enum:
                      - IDENTIFICATION
                      - DOCUMENT
                  externalRef:
                    type: string
                    nullable: true
                  locale:
                    type: string
                    nullable: true
                  sessionLength:
                    type: integer
                    nullable: true
                  sessionUrl:
                    type: string
                    nullable: true
                    readOnly: true
                    description: Direct URL to the verification session.
      security:
        - apiKeyPair: []
components:
  securitySchemes:
    apiKeyPair:
      type: http
      scheme: basic
      description: >-
        The request must contain basic auth headers where username is *API key*
        and password is *API secret*.<br>

        In order for you to start using our API you will need an **API key** and
        **API secret**.<br>

        Both can be retrieved by contacting *iDenfy's support* or *iDenfy's
        sales team*.

````