---
updatedAt: 2026-06-26T14:23:58.000Z
agentTools:
  projectIndex: https://developers.miro.com/llms.txt
---

# Step 3: Exchange authorization code with access token

Exchange the authorization code returned to your redirect URI for an access token and a refresh token.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Platform OAuth",
    "version": "v2.0",
    "description": "Provides endpoints for the OAuth 2.0 authorization flow and for managing OAuth tokens."
  },
  "x-settings": {
    "publish": true,
    "skip-tests": true
  },
  "servers": [
    {
      "url": "https://api.miro.com",
      "description": "Miro API base URL"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "OAuth",
      "description": "Endpoints for the OAuth 2.0 authorization flow and token management"
    }
  ],
  "paths": {
    "/v1/oauth/token": {
      "post": {
        "summary": "Step 3: Exchange authorization code with access token",
        "description": "Exchange the authorization code returned to your redirect URI for an access token and a refresh token.",
        "operationId": "exchange-authorization-code-with-access-token",
        "tags": [
          "OAuth"
        ],
        "security": [],
        "parameters": [
          {
            "name": "grant_type",
            "in": "query",
            "description": "Always set the value for this parameter to `authorization_code`.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "authorization_code"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "description": "The Client ID of the app that is requesting user authorization.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_secret",
            "in": "query",
            "description": "App client secret. **The client secret must be kept confidential.**",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "query",
            "description": "Paste the authorization code that was provided as the `code` parameter value in the redirect URI.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "description": "Paste the redirect URI. The URI must match the original redirect URI that was used when requesting the authorization (including the trailing slash).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Access token issued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Failed to exchange the authorization code"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "AccessTokenResponse": {
        "title": "Access token",
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string",
            "example": "3074457362577955221"
          },
          "expires_in": {
            "type": "integer",
            "example": 3599
          },
          "team_id": {
            "type": "string",
            "example": "3074457362577833142"
          },
          "access_token": {
            "type": "string",
            "example": "eyJtaXJvLm9yaWdpbiI6ImV1MDEifQ_o-P91OccaII0A63CDSK--x21xiI"
          },
          "scope": {
            "type": "string",
            "example": "boards:write boards:read"
          },
          "refresh_token": {
            "type": "string",
            "example": "eyJtaXJvLm9yaWdpbiI6ImV1MDEifQ_-PIBKmE9rzQuL3bUeAvUEGFEhLk"
          },
          "token_type": {
            "type": "string",
            "example": "bearer"
          }
        }
      }
    }
  }
}
```

# Sibling pages

* [Step 1: Create authorization request link](https://developers.miro.com/miro-ea/reference/create-authorization-request-link.md)
* [Step 2: Request user for authorization](https://developers.miro.com/miro-ea/reference/request-user-for-authorization.md)
* [Step 4: Use access token for REST API requests](https://developers.miro.com/miro-ea/reference/use-access-token-for-rest-api-requests.md)
* [Step 5: Get new access token using refresh token](https://developers.miro.com/miro-ea/reference/get-new-access-token-using-refresh-token.md)