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

# Generate User token



## OpenAPI

````yaml POST /user-tokens
openapi: 3.0.1
info:
  title: Payroll API
  description: A full flagged payroll api provided by Teal
  version: 1.0.0
servers:
  - url: https://api.sandbox.goteal.co
    description: Sandbox server for experiments
  - url: https://api.goteal.co
    description: Production server
security:
  - ApiKeyAuth: []
  - MemberBearerAuth: []
paths:
  /user-tokens:
    post:
      summary: >-
        Generate a link token for authentication in subsequent steps to a unique
        user ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                user_id:
                  type: string
                  description: The id of the user
                  example: 95a0e70b-fe02-4f47-aef9-2efff279df71
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserToken'
        '401':
          $ref: '#/components/responses/UnauthorizedApiKey'
components:
  schemas:
    UserToken:
      type: object
      required:
        - token
        - webapp_link
        - created_at
      properties:
        token:
          type: string
          description: The token to be used in subsequent requests
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiOTVhMGU3MGItZmUwMi00ZjQ3LWFlZjktMmVmZmYyNzlkZjcxIiwiaWF0IjoxNTE2MjM5MDIyfQ.4S5J
        webapp_link:
          type: string
          description: >-
            URL of the teal webapp with short version of token. Ignore if not
            utilising webapp.
          example: https://api.sandbox.goteal.co/r/ZwgQkNEMZ4QDkQ
        created_at:
          $ref: '#/components/schemas/Date'
    Date:
      type: string
      format: date-time
      example: '2019-05-17T00:00:00.000Z'
    Unauthorized:
      type: object
      properties:
        errors:
          type: string
          description: An array of messages describing the errors
          example:
            - No X-API-KEY header provided or wrong value
  responses:
    UnauthorizedApiKey:
      description: Unauthorized if the X-API-KEY is not provided or is wrong
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Unauthorized'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
    MemberBearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token for authentication. The token should be the one returned by
        the "/members/signin"

````