> ## 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 KYB form token



## OpenAPI

````yaml /openapi/kyb.yaml post /kyb/tokens/
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: KYB Token
    description: KYB token endpoints to begin KYB flow.
  - name: KYB Forms
    description: Endpoints for KYB form actions.
  - name: KYB Documents
    description: KYB documents CRUD endpoints for the KYB form.
  - name: Beneficiaries
    description: Beneficiaries CRUD endpoints for the KYB form.
  - name: KYB Questionnaires
    description: KYB questionnaires endpoints.
  - name: Companies
    description: Endpoints for actions with companies.
  - name: Credit Bureau
    description: Endpoints for actions with credit bureau documents.
  - name: GOV Registers
    description: Endpoints for actions with GOV registers documents.
  - name: GOV Orders
    description: Endpoints for actions with GOV ordered documents.
  - name: SOS Reports
    description: Endpoints for actions with SOS filing documents.
  - name: Webhooks
    description: Webhooks.
externalDocs:
  description: For other/more docs on iDenfy services visit our main documentation page.
  url: https://documentation.idenfy.com
paths:
  /kyb/tokens/:
    post:
      tags:
        - KYB Token
      summary: Generate KYB form token
      operationId: kybTokensCreate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KybTokenRequest'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KybToken'
          description: ''
      security:
        - apiKeyPair: []
components:
  schemas:
    KybTokenRequest:
      oneOf:
        - $ref: '#/components/schemas/KybFormTokenRequest'
      discriminator:
        propertyName: tokenType
        mapping:
          FORM:
            $ref: '#/components/schemas/KybFormTokenRequest'
    KybToken:
      oneOf:
        - $ref: '#/components/schemas/KybFormToken'
      discriminator:
        propertyName: tokenType
        mapping:
          FORM:
            $ref: '#/components/schemas/KybFormToken'
    KybFormTokenRequest:
      type: object
      properties:
        tokenType:
          $ref: '#/components/schemas/KybTokenTypeEnum'
        lifetime:
          type: integer
          maximum: 2592000
          minimum: 0
          writeOnly: true
          default: 3600
          description: The duration in seconds of KYB token validity.
        clientId:
          type: string
          minLength: 1
          description: A unique string identifying a client on your side.
          maxLength: 100
        externalRef:
          type: string
          nullable: true
          description: Any additional value chosen by you.
          maxLength: 40
        locale:
          allOf:
            - $ref: '#/components/schemas/KybLocaleEnum'
          nullable: true
          description: >-
            The default client's language. By default selected by a client's IP
            address.
        flow:
          type: string
          format: uuid
          nullable: true
          description: KYB flow's `id` to use for this KYB session.
        theme:
          type: string
          format: uuid
          nullable: true
          description: KYB theme's `id` to use for this KYB session.
        questionnaire:
          type: string
          minLength: 1
          writeOnly: true
          nullable: true
          description: >-
            KYB questionnaire's `key` to use for this KYB session. `null` for no
            questionnaire. If not given, the default questionnaire (from your
            KYB settings) will be used. Ignored when KYB flow is used, then
            questionnaire is taken according to used flow.
        questionnaireRequired:
          type: boolean
          writeOnly: true
          default: true
          description: If KYB session should have a questionnaire.
        tags:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 32
            pattern: ^[^,]+$
          default: []
          description: >-
            List of case-sensitive strings. Each tag can not be longer than 32
            characters.
          maxItems: 5
        scanRefs:
          type: array
          items:
            type: string
            minLength: 1
            pattern: ^[^,]+$
            maxLength: 40
          nullable: true
      required:
        - clientId
        - tokenType
    KybFormToken:
      type: object
      properties:
        tokenType:
          $ref: '#/components/schemas/KybTokenTypeEnum'
        tokenString:
          type: string
          readOnly: true
          description: Token string used for authentication.
        expiration:
          type: string
          format: date-time
          readOnly: true
          description: Date and time when this token will become expired.
        isActive:
          type: boolean
          readOnly: true
          description: Indicates whether this token is not deactivated.
          deprecated: true
        isValid:
          type: boolean
          description: Indicates whether this token is valid.
          readOnly: true
        companyId:
          type: string
          readOnly: true
          nullable: true
        clientId:
          type: string
          description: A unique string identifying a client on your side.
          maxLength: 100
        externalRef:
          type: string
          nullable: true
          description: Any additional value chosen by you.
          maxLength: 40
        locale:
          allOf:
            - $ref: '#/components/schemas/KybLocaleEnum'
          nullable: true
          description: >-
            The default client's language. By default selected by a client's IP
            address.
        flow:
          type: string
          format: uuid
          nullable: true
          description: KYB flow's `id` to use for this KYB session.
        theme:
          type: string
          format: uuid
          nullable: true
          description: KYB theme's `id` to use for this KYB session.
        tags:
          type: array
          items:
            type: string
            maxLength: 32
            pattern: ^[^,]+$
          default: []
          description: >-
            List of case-sensitive strings. Each tag can not be longer than 32
            characters.
          maxItems: 5
        scanRefs:
          type: array
          items:
            type: string
            pattern: ^[^,]+$
            maxLength: 40
          nullable: true
      required:
        - clientId
        - companyId
        - expiration
        - isActive
        - isValid
        - tokenString
        - tokenType
    KybTokenTypeEnum:
      enum:
        - FORM
        - GOV1
        - GOV2
      type: string
    KybLocaleEnum:
      enum:
        - en
        - es
        - fr
        - ru
        - de
        - it
        - pl
        - lt
        - lv
        - et
        - cs
        - ro
        - hu
        - ja
        - bg
        - nl
        - pt
      type: string
  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*.

````