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

# Gerar token de acesso

> Gera um token de acesso (access_token) para o parceiro utilizando as credenciais do cliente (client_id e client_secret).



## OpenAPI

````yaml POST /v1/authentication/accesstoken
openapi: 3.0.1
info:
  title: WebIntegration
  description: Este documento descreve os endpoints disponíveis da API.
  version: '1.0'
servers:
  - url: https://api.staging.cartaosimples.com.br/integration
    description: Servidor para o ambiente de staging
security:
  - bearerAuth: []
paths:
  /v1/authentication/accesstoken:
    post:
      tags:
        - Autenticação
      summary: Gerar token de acesso.
      description: >-
        Gera um token de acesso (access_token) para o parceiro utilizando as
        credenciais do cliente (client_id e client_secret).
      operationId: generateAccessToken
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/WebIntegration.Endpoints.Authentication.Requests.GenerateAccessTokenRequest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.Services.Cognito.AccessTokenResult'
              example:
                token_de_acesso: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
                expira_em_segundos: 3600
                expira_em: '2025-01-15T11:30:00-03:00'
                tipo_de_token: Bearer
                escopo: credicarro.integration.access/full
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '500':
          description: Internal Server Error
      security: []
components:
  schemas:
    WebIntegration.Endpoints.Authentication.Requests.GenerateAccessTokenRequest:
      required:
        - clientId
        - clientSecret
      type: object
      properties:
        clientId:
          minLength: 1
          type: string
        clientSecret:
          minLength: 1
          type: string
      additionalProperties: false
    Common.Services.Cognito.AccessTokenResult:
      type: object
      properties:
        token_de_acesso:
          type: string
        expira_em_segundos:
          type: integer
          format: int32
        expira_em:
          type: string
          format: date-time
          readOnly: true
        tipo_de_token:
          type: string
        escopo:
          type: string
      additionalProperties: false
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        tipo:
          type: string
          nullable: true
        titulo:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detalhe:
          type: string
          nullable: true
        instancia:
          type: string
          nullable: true
      example:
        tipo: https://tools.ietf.org/html/rfc7231#section-6.5.1
        titulo: Requisição inválida.
        status: 400
        detalhe: O campo 'cpf' é obrigatório.
        instancia: /v1/order
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Cabeçalho de autenticação Bearer no formato `Bearer <token>` onde
        `<token>` é seu TOKEN de autenticação

````