> For the complete documentation index, see [llms.txt](https://docs.digitalturbine.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalturbine.com/dt-growth/reporting-api/reporting-api-endpoints/api-v1-token.md).

# api/v1/token

Use the `ap1/v1/token` endpoint to request an authorization token for the DT Growth Reporting API. Authorization tokens expire after one hour.

| Host URL | `https://reporting.digitalturbine.com` |
| -------- | -------------------------------------- |
| Method   | `POST`                                 |
| Endpoint | `/auth/v1/token`                       |
| Headers  | `Content-Type: application/json`       |

### Sample Authentication Request

```
 https://reporting.digitalturbine.com/auth/v1/token
```

```json
{
        "grant_type": "client_credentials",
        "client_id": "3ce66d885XXXXXXXXXXa3b752bb9000",
        "client_secret": "YtMvC7VYTQMQ7w9UCUaFXXXJnwVZnQqq00000yt8IIh2h8XFDuXXXXXXXXSS6XTrFWW4TkebCcMLJkrXSw5IurkearTJIDzUxsbiMXv8hb4T23MwN6eE7DDIthRFqDnhnuhiDlY2oPeaOjsMbzE8joZ5cs6tsySJz6uZXwJ-x3lcYaYbgXXXXXXXX3_hFeuXm-C7-me2V1MMs-ftJxTd5QbHoUhG3Q5anCWCW_pg8x3CL4yPGCbpWUDZfpdNPyyCT4rxCEb-VC0Bdqwe8N2GGn_VSFOwQYxa-yap2JuNSGJfl_ZURXXXXXXXXFe1GpHDn8pk7yYwQYIGAg"
}
```

| PARAMETER       | TYPE   | STATUS   | DESCRIPTION                                                                                             |
| --------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------- |
| `grant_type`    | string | Required | Type of credentials you are sending. When sending API Report credentials, specify `client_credentials`. |
| `client_id`     | string | Required | Your Reporting API ID that DT sends via encrypted email.                                                |
| `client_secret` | string | Required | Your Reporting API password that DT sends via encrypted email.                                          |

### Sample Authentication Responses

The Reporting API responds to with both successful and unsuccessful authentication token requests.

#### Successful Response

When an authentication request is successful, you receive the following response in JSON format:

```json
{
        "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NzAwMTY5MDAsImV4cCI6MTU3MDAyMDUwMCwiYXVkIjoic3BlZWRiYWxsIiwic3ViIjoiMjEwMjYzIn0.hDo1waTytSys_oRhFNUPqZPom26bL05rxgtSt3XYHqI",
        "tokenType": "bearer",
        "expiresIn": 3600
}
```

| RESPONSE PARAMETER | TYPE   | DESCRIPTION                                                                                         |
| ------------------ | ------ | --------------------------------------------------------------------------------------------------- |
| `accessToken`      | string | Access token required for Reporting API requests                                                    |
| `tokenType`        | string | Type of token issued.                                                                               |
| `expiresIn`        | number | Time in seconds that the token is valid. All tokens expire one hour after successful token request. |

#### Unsuccessful Response

When a token request is unsuccessful, the Reporting API returns the following response:

```json
{
  "error": "internal_server_error"
}
```

The following table provides possible errors that result in an unsuccessful response.

| HTTP STATUS CODE           | ERROR                    | CAUSE                                                                                                                                                                                                                                                             |
| -------------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 405 (Method\_Not\_Allowed) | N/A                      | The request method is not `POST`                                                                                                                                                                                                                                  |
| 400 (Bad\_Request)         | 400 (Bad\_Request)       | Empty request body or incorrect `Content-Type` header                                                                                                                                                                                                             |
| 400 (Bad\_Request)         | invalid\_request         | <p>This error occurs for the following reasons:<br>- Error while parsing JSON request body<br>- Missing <code>grant\_type</code> parameter in the request<br>- Missing or invalid <code>client\_id</code><br>- Missing or invalid <code>client\_secret</code></p> |
| 400 (Bad\_Request)         | unsupported\_grant\_type | Invalid `grant_type`. Always specify `client_credentials`.                                                                                                                                                                                                        |
| 400 (Bad\_Request)         | invalid\_client          | <p>This error occurs for the following reasons:<br>- The requested credentials were not found<br>- The requested credentials are incorrect or cannot be recognized<br>- Your account has been disabled<br>- Your credentials have been revoked</p>                |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.digitalturbine.com/dt-growth/reporting-api/reporting-api-endpoints/api-v1-token.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
