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

# Create an API token

> Create an API token for the authenticated user's account. Only Super Admin (level 5) can generate tokens.



## OpenAPI

````yaml /api-reference/comecar.yaml post /v2/api-tokens
openapi: 3.0.0
info:
  title: Tarefy API
  description: >-
    Tarefy REST API — task management, culture and performance platform.


    Endpoints are versioned at `/v2/...`. Authentication via Bearer JWT in the
    `Authorization` header.


    To get started, see the [authentication guide](/authentication) and the
    [quickstart](/quickstart).
  version: 2.0.0
  contact:
    name: Tarefy Support
    email: suporte@tarefy.com
    url: https://tarefy.com
  license:
    name: Proprietary
    url: https://tarefy.com
servers:
  - url: https://app.tarefy.com/nodeapi
    description: Production
security:
  - bearerAuth: []
tags:
  - name: User
    description: Login, profile, session
  - name: API Tokens
    description: Persistent tokens for integrations
  - name: Accounts
    description: Organization account
paths:
  /v2/api-tokens:
    post:
      tags:
        - API Tokens
      summary: Create an API token
      description: >-
        Create an API token for the authenticated user's account. Only Super
        Admin (level 5) can generate tokens.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Nome descritivo do token
                nivel:
                  type: integer
                  description: Nível de permissão do token (1 a 5)
                expires_at:
                  type: string
                  format: date-time
                  description: Data de expiração opcional em ISO 8601
              required:
                - name
                - nivel
      responses:
        '200':
          description: Token criado com sucesso
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                  name:
                    type: string
                  nivel:
                    type: integer
                  id_conta:
                    type: integer
                  created_by:
                    type: integer
                  created_by_name:
                    type: string
                    nullable: true
                  token_prefix:
                    type: string
                    nullable: true
                  token:
                    type: string
                    description: Token completo retornado apenas na criação
                  expires_at:
                    type: string
                    format: date-time
                    nullable: true
                  revoked_at:
                    type: string
                    format: date-time
                    nullable: true
                  last_used_at:
                    type: string
                    format: date-time
                    nullable: true
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
        '400':
          description: Requisição inválida ou dados de entrada incorretos
        '403':
          description: Acesso negado. Apenas Super Admin pode criar tokens
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````