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

# Create a bridge token

> The endpoint creates a bridge token for a user.
        This is typically the endpoint called before initializing the Bridge since the
        response from this call is passed to the TruvBridge.init function.



## OpenAPI

````yaml POST /v1/users/{user_id}/tokens/
openapi: 3.0.1
info:
  title: Truv API
  description: Truv API Documentation
  termsOfService: https://www.truv.com/legal/terms-of-use
  contact:
    email: support@truv.com
  version: v1
servers:
  - url: https://prod.truv.com
security:
  - ClientID: []
    AccessKey: []
tags:
  - name: Users
  - name: Bridge Token
  - name: Companies and Data Providers
  - name: Key Management
  - name: Account Links
  - name: Data Refresh
  - name: Customization Templates
  - name: Webhooks
  - name: Orders
  - name: Tasks
  - name: VOIE Reports
  - name: VOA Reports
  - name: Income Insights Reports
  - name: DDS Reports
  - name: Employment
  - name: Identity
  - name: Shifts
  - name: Pay Statements
  - name: Tax Documents
  - name: Parsed Documents
  - name: Reports
  - name: Uploaded Documents
  - name: Bank Accounts
  - name: Bank Statements
  - name: Deposit Switch Reports
  - name: Insurance Reports
  - name: Income Report
  - name: Scoring Attributes
  - name: Accounts
  - name: Transactions
  - name: Recurring Transactions
  - name: Document Collections
paths:
  /v1/users/{user_id}/tokens/:
    parameters:
      - name: user_id
        in: path
        required: true
        schema:
          type: string
        example: 24d7e80942ce4ad58a93f70ce4115f5c
    post:
      tags:
        - Bridge Token
      summary: Create a bridge token
      description: |-
        The endpoint creates a bridge token for a user.
                This is typically the endpoint called before initializing the Bridge since the
                response from this call is passed to the TruvBridge.init function.
      operationId: v1_users_tokens
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplicantBridgeTokenCreate'
        description: Bridge token properties
        required: true
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BridgeTokenCreateResponse'
        '400':
          description: HTTP 400 Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '401':
          description: HTTP 401 Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '403':
          description: HTTP 403 Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'
components:
  schemas:
    ApplicantBridgeTokenCreate:
      required:
        - product_type
      type: object
      properties:
        tracking_info:
          description: Any information to associate with current user.
          type: string
          example: any data for tracking current user
        product_type:
          description: |+

            Indicates the type of product to use:

            * `employment` - Employment verification,
            * `income` - Income and Employment verification,
            * `deposit_switch` - Direct deposit switch,
            * `pll` - Paycheck linked lending,
            * `insurance` - Insurance verification,
            * `transactions` - Financial account aggregation,
            * `assets` - Assets verification,

          type: string
          example: income
          enum:
            - income
            - employment
            - deposit_switch
            - pll
            - insurance
            - transactions
            - assets
        allowed_products:
          description: >-
            List of all allowed products for this payroll connection. If not
            passed, only type from the product_type field will be allowed.
          type: array
          example:
            - income
          items:
            type: string
            enum:
              - income
              - employment
              - deposit_switch
              - pll
              - insurance
              - transactions
              - assets
        company_mapping_id:
          description: A mapping ID from a company to payroll provider.
          type: string
          example: 99dd17074ac94aa9ace2621d657c7610
        provider_id:
          description: An ID of a data provider for direct login.
          type: string
          example: adp
        access_token:
          description: Access token of the existing link (used for the data refresh).
          type: string
          example: 99dd17074ac94aa9ace2621d657c7610
        account:
          description: >-
            Bank account info. Used for Direct deposit switching and Paycheck
            linked lending
          required:
            - account_number
            - routing_number
            - bank_name
          type: object
          properties:
            action:
              description: >

                Action to be performed on the account.


                `update` and `delete` actions are only available for the
                accounts that were previously created.
              type: string
              example: create
              enum:
                - create
                - update
                - delete
            account_number:
              description: >-
                Account number. Only digits are allowed, leading zeros will be
                preserved.
              type: string
              example: '16002600'
              maxLength: 20
              minLength: 4
            routing_number:
              description: >-
                Routing number. Only digits are allowed, leading zeros will be
                preserved.
              type: string
              example: '123456789'
              maxLength: 12
              minLength: 8
            account_type:
              description: |+

                Account type. Required for the `create` action.

                * `checking` - Checking account,
                * `savings` - Savings account

              type: string
              example: checking
              enum:
                - checking
                - savings
            bank_name:
              description: Bank name. Required for the `create` action.
              type: string
              example: TD Bank
              maxLength: 128
              minLength: 1
            bank_address:
              description: Bank address.
              type: string
              example: 123 Main St, New York, NY 10001
              maxLength: 1024
              minLength: 1
            deposit_type:
              description: >

                Deposit type.

                For `pll` product type is required and must be set to `amount`.

                For `deposit_switch` product type is optional and can be set to
                any supported value.


                * `entire` - Entire paycheck,

                * `percent` - Percentage of the paycheck,

                * `amount` - Fixed amount from the paycheck
              type: string
              example: entire
              enum:
                - entire
                - percent
                - amount
            deposit_value:
              description: >

                Deposit value.


                Possible values for this field depend on the `deposit_type`
                field:

                `percent` - this field must be set to a whole number between 0
                and 100.

                `amount` - this field must be set to a number between 0 and
                9999.99.

                `entire` - this field must be set to `null` or be not provided.
              type: string
              example: '50.00'
        template_id:
          description: An ID of a customization template.
          type: string
          example: 99dd17074ac94aa9ace2621d657c7610
        use_case:
          description: Use case for the connection.
          type: string
          enum:
            - ''
            - background_screening
            - mortgage_lending
            - home_equity_lending
            - consumer_lending
            - auto_lending
            - tenant_screening
            - banking
            - government
          default: ''
          example: mortgage_lending
        request_extended_history:
          description: >-
            A boolean parameter to enable extended transaction/statement
            history.
          type: boolean
          default: false
          example: true
        locale:
          description: Locale parameter (ISO 639) for regional customization of the Bridge.
          type: string
          enum:
            - en
            - ar
            - cmn
            - es
            - fa
            - hy
            - km
            - zh
            - hi
            - hmn
            - ja
            - ko
            - lo
            - ium
            - pa
            - pt
            - ru
            - so
            - tl
            - th
            - uk
            - vi
          example: es
        data_sources:
          description: >-
            List of data sources for the provided product_type. Leave blank to
            apply default values.
          type: array
          example:
            - payroll
          items:
            type: string
            enum:
              - payroll
              - docs
              - insurance
              - financial_accounts
              - tax
    BridgeTokenCreateResponse:
      required:
        - bridge_token
      type: object
      properties:
        bridge_token:
          description: The bridge token
          type: string
          example: 2f67984a110747d190c39e1022c81837
        tracking_info:
          description: Any information to associate with current user.
          type: string
          nullable: true
          example: any data for tracking current user
        client_name:
          description: Client name to be used in the Bridge.
          type: string
          nullable: true
          example: Truv Demo
        product_type:
          description: |+

            Indicates the type of product to use:

            * `employment` - Employment verification,
            * `income` - Income and Employment verification,
            * `deposit_switch` - Direct deposit switch,
            * `pll` - Paycheck linked lending,
            * `insurance` - Insurance verification,
            * `transactions` - Financial account aggregation,
            * `assets` - Assets verification,

          type: string
          example: income
          enum:
            - income
            - employment
            - deposit_switch
            - pll
            - insurance
            - transactions
            - assets
        allowed_products:
          description: >-
            List of all allowed products for this payroll connection. If not
            passed, only main type will be allowed.
          type: array
          items:
            type: string
            enum:
              - income
              - employment
              - deposit_switch
              - pll
              - insurance
              - transactions
              - assets
          example:
            - income
            - deposit_switch
        company_mapping_id:
          description: A mapping ID from a company to payroll provider.
          type: string
          nullable: true
          example: 99dd17074ac94aa9ace2621d657c7610
        access_token:
          description: Access token of the existing link (used for the data refresh).
          type: string
          nullable: true
          example: 99dd17074ac94aa9ace2621d657c7610
        user_id:
          description: Unique Truv ID of the user.
          type: string
          example: 99dd17074ac94aa9ace2621d657c7610
        template_id:
          description: An ID of a customization template.
          type: string
          nullable: true
          example: 99dd17074ac94aa9ace2621d657c7610
        data_sources:
          description: >-
            List of data sources for the provided product_type. Leave blank to
            apply default values.
          type: array
          example:
            - payroll
          items:
            type: string
            enum:
              - payroll
              - docs
              - insurance
              - financial_accounts
              - tax
      description: Data for the bridge token
    Error400:
      description: ''
      type: object
      properties:
        error:
          description: ''
          type: object
          properties:
            code:
              description: ''
              type: string
              example: incorrect_parameters
            message:
              description: ''
              type: string
              example: Incorrect request parameters
            extra:
              description: ''
              type: object
              properties:
                invalid-params:
                  description: ''
                  type: array
                  items:
                    description: ''
                    type: object
                    properties:
                      field:
                        description: ''
                        type: string
                        example: access_token
                      message:
                        description: ''
                        type: string
                        example: This field is required.
                  example:
                    - field: access_token
                      message: This field is required.
    Error401:
      description: ''
      type: object
      properties:
        error:
          description: ''
          type: object
          properties:
            code:
              description: ''
              type: string
              example: authentication_failed
            message:
              description: ''
              type: string
              example: No such token
    Error403:
      description: ''
      type: object
      properties:
        error:
          description: ''
          type: object
          properties:
            code:
              description: ''
              type: string
              example: not_authenticated
            message:
              description: ''
              type: string
              example: Authentication credentials were not provided.
  securitySchemes:
    ClientID:
      type: apiKey
      description: Client ID
      name: X-Access-Client-Id
      in: header
    AccessKey:
      type: apiKey
      description: Client Access Key
      name: X-Access-Secret
      in: header

````