# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ellipsis-drive.com/developers/api-v3/oauth/authorization-code-variant.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
