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

# Create api token

> Create a new api token for this user. This token can be used to authenticate against the API. The token has the same privileges as the current user account, assigned to tenant.

<sup>Required permissions: `user:api-token:write`</sup>



## OpenAPI

````yaml post /user/api-tokens
openapi: 3.1.0
info:
  title: Fynn API
  description: ''
  termsOfService: https://www.fynn.eu/tos
  contact:
    name: Fynn UG (haftungsbeschränkt)
    url: https://www.fynn.eu
    email: hi@fynn.eu
  license:
    name: Proprietary
    url: https://www.fynn.eu/license
  version: 0.0.0
servers:
  - url: https://coreapi.io
    description: Production
  - url: https://preview.coreapi.io
    description: Sandbox
security:
  - JWT: []
tags: []
paths:
  /user/api-tokens:
    parameters: []
    post:
      tags:
        - UserApiToken
      summary: Create api token
      description: >-
        Create a new api token for this user. This token can be used to
        authenticate against the API. The token has the same privileges as the
        current user account, assigned to tenant.


        <sup>Required permissions: `user:api-token:write`</sup>
      operationId: createUserApiToken
      parameters: []
      requestBody:
        description: The new ApiToken resource
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/ApiToken.CreateApiTokenRequest-ApiTokenWrite
          text/html:
            schema:
              $ref: >-
                #/components/schemas/ApiToken.CreateApiTokenRequest-ApiTokenWrite
        required: true
      responses:
        '201':
          description: ApiToken resource created
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ApiToken.ApiTokenCreatedResponse-ApiTokenCreatedResponse
            text/html:
              schema:
                $ref: >-
                  #/components/schemas/ApiToken.ApiTokenCreatedResponse-ApiTokenCreatedResponse
          links: {}
        '400':
          description: Invalid input
        '422':
          description: Unprocessable entity
      deprecated: false
      security:
        - JWT:
            - user:api-token:write
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X POST \
             /user/api-tokens \
             --header "Content-Type: application/json" \
             --header "Authorization: Bearer <token>" \
             --data '{
                "description": "My API token",
                "expiresAt": "2021-01-01T00:00:00+00:00"
            }'
components:
  schemas:
    ApiToken.CreateApiTokenRequest-ApiTokenWrite:
      type: object
      description: ''
      deprecated: false
      properties:
        description:
          minLength: 3
          maxLength: 255
          description: Description of the API token
          example: My API token
          type:
            - string
            - 'null'
        expiresAt:
          description: >-
            Date and time when the API token expires. If null, the token never
            expires.
          example: '2021-01-01T00:00:00+00:00'
          type:
            - string
            - 'null'
          format: date-time
    ApiToken.ApiTokenCreatedResponse-ApiTokenCreatedResponse:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          example: A1B2C3D4E5F6G7H8I9J0
          type: string
        token:
          example: api_A1B2C3D4E5F6G7H8I9J0
          type: string
        description:
          example: My API token
          type:
            - string
            - 'null'
        expiresAt:
          example: '2021-01-01T00:00:00+00:00'
          type:
            - string
            - 'null'
          format: date-time
  securitySchemes:
    JWT:
      type: http
      scheme: bearer

````