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

# Exchange OAuth token

> Exchanges authorization code or refresh token for an access token pair.



## OpenAPI

````yaml /openapi/application.json post /oauth/mcp/{account_id}/token
openapi: 3.1.0
info:
  title: WiseApp API — Aplicação
  description: >-
    Referência completa da API do WiseApp: plataforma (provisionamento),
    aplicação (conta), cliente (canais públicos) e MCP.
  version: 1.1.0
servers:
  - url: https://chat.wiseapp360.com
    description: Sua instalação WiseApp
security: []
paths:
  /oauth/mcp/{account_id}/token:
    parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
        example: sample
    post:
      tags:
        - MCP
      summary: Exchange OAuth token
      description: Exchanges authorization code or refresh token for an access token pair.
      operationId: post-oauth-mcp-account-id-token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  required:
                    - grant_type
                    - code
                    - redirect_uri
                  properties:
                    grant_type:
                      type: string
                      enum:
                        - authorization_code
                    code:
                      type: string
                    redirect_uri:
                      type: string
                      format: uri
                    code_verifier:
                      type: string
                    client_id:
                      type: string
                    client_secret:
                      type: string
                - type: object
                  required:
                    - grant_type
                    - refresh_token
                  properties:
                    grant_type:
                      type: string
                      enum:
                        - refresh_token
                    refresh_token:
                      type: string
                    client_id:
                      type: string
                    client_secret:
                      type: string
            examples:
              authorization_code:
                summary: Exchange authorization code
                value:
                  grant_type: authorization_code
                  code: auth_code_from_authorize
                  redirect_uri: https://client.example.com/callback
                  code_verifier: pkce_verifier
                  client_id: i8UpUOYutYF-9nq4E8hZ8L8JdPAHnDruVV6y1qYQO8k
              refresh_token:
                summary: Refresh token exchange
                value:
                  grant_type: refresh_token
                  refresh_token: refresh_token_value
                  client_id: i8UpUOYutYF-9nq4E8hZ8L8JdPAHnDruVV6y1qYQO8k
      responses:
        '200':
          description: OAuth token response
          headers:
            Cache-Control:
              description: OAuth token responses are not cacheable.
              schema:
                type: string
                example: no-store
            Pragma:
              description: Legacy cache control header.
              schema:
                type: string
                example: no-cache
          content:
            application/json:
              schema:
                type: object
                required:
                  - access_token
                  - token_type
                  - expires_in
                  - refresh_token
                  - scope
                properties:
                  access_token:
                    type: string
                  token_type:
                    type: string
                    enum:
                      - Bearer
                  expires_in:
                    type: integer
                  refresh_token:
                    type: string
                  scope:
                    type: string
              example:
                access_token: eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJB...
                token_type: Bearer
                expires_in: 3600
                refresh_token: eyJfcmFpbHMiOnsibWVzc2FnZSI6IkFC...
                scope: mcp.read mcp.write
        '400':
          description: Invalid OAuth token request
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - error_description
                properties:
                  error:
                    type: string
                  error_description:
                    type: string
              example:
                error: invalid_request
                error_description: code and redirect_uri are required
        '401':
          description: Invalid OAuth client credentials
          headers:
            WWW-Authenticate:
              description: OAuth client authentication challenge.
              schema:
                type: string
                example: Basic realm="mcp_oauth"
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - error_description
                properties:
                  error:
                    type: string
                  error_description:
                    type: string
              example:
                error: invalid_client
                error_description: Client authentication failed
        '403':
          description: MCP feature disabled for the account
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: MCP server feature is not enabled for this account
      security: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.