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

# Generate Access Token

> Exchanges your credential's `client_id` and `client_secret` for a short-lived access token. Send the returned token in the `Authorization: Bearer <access_token>` header of subsequent requests.

The token expires in **300 seconds (5 minutes)** — generate a new one when it expires; there is no refresh token.



## OpenAPI

````yaml openapi.en.json POST /auth
openapi: 3.0.0
info:
  title: pague.dev API
  description: pague.dev Payment API documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://api-gateway.pague.dev/v2
security: []
paths:
  /auth:
    post:
      tags:
        - Autenticação
      summary: Generate Access Token
      description: >-
        Exchanges your credential's `client_id` and `client_secret` for a
        short-lived access token. Send the returned token in the `Authorization:
        Bearer <access_token>` header of subsequent requests.


        The token expires in **300 seconds (5 minutes)** — generate a new one
        when it expires; there is no refresh token.
      operationId: ExternalAuthController_authenticate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                client_id:
                  type: string
                  description: >-
                    Credential identifier (mp_live_* production, mp_test_*
                    sandbox)
                  example: mp_live_0123456789abcdef01234567
                client_secret:
                  type: string
                  description: Credential secret (shown only once at creation)
              required:
                - client_id
                - client_secret
      responses:
        '200':
          description: Token generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                    description: JWT token to use in the Authorization header
                    example: eyJhbGciOiJSUzI1NiIs...
                  token_type:
                    type: string
                    example: Bearer
                  expires_in:
                    type: integer
                    description: Token validity in seconds
                    example: 300
                required:
                  - access_token
                  - token_type
                  - expires_in
        '400':
          description: Missing client_id or client_secret
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                example:
                  error: Bad Request
                  message: client_id and client_secret are required
        '401':
          description: Invalid or revoked credential, or incorrect secret
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                example:
                  error: Unauthorized
                  message: Invalid credentials
      security: []

````