> For the complete documentation index, see [llms.txt](https://docs.ellipsis-drive.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ellipsis-drive.com/developers/api-v3/oauth/authorization-code-variant.md).

# Authorization code variant

| **Description** | Exchanges an authorization code for an access token. |
| --------------- | ---------------------------------------------------- |
| **Endpoint**    | `/oauth/token`                                       |
| **Method**      | POST                                                 |

### Parameters

<table><thead><tr><th width="258.06091370558374">Name</th><th width="322.3333333333333">Description</th><th>Required</th></tr></thead><tbody><tr><td><code>grant_type</code></td><td>Must be "authorization_code" to emphasize that you are trying to exchange an authorization code.</td><td></td></tr><tr><td><code>client_id</code></td><td>The client id given during the client registration. Alternatively, this can be supplied using the Basic HTTP header with the client_id as username and client_secret as password.</td><td></td></tr><tr><td><code>client_secret</code></td><td>The client secret given during the client registration. Alternatively, this can be supplied using the Basic HTTP header with the client_id as username and client_secret as password.</td><td></td></tr><tr><td><code>authorization_code</code></td><td>The authorization code given in the query parameters of the /authorize endpoint redirect.</td><td></td></tr><tr><td><code>redirect_uri</code></td><td>The redirect location used for the authorization. This parameter is required if a redirect uri was given to the /authorization endpoint.</td><td>false</td></tr><tr><td><code>code_verifier</code></td><td>The code verifier of the PKCE. Required if a code_challenge was given to the /authorization endpoint.</td><td>false</td></tr></tbody></table>
