> This is the Markdown version of the page. For the complete Lattice Developers documentation index, fetch https://developer.anduril.com/llms.txt. Append .md to any page URL for its clean Markdown.

# Get OAuth2 token

POST https://example.developer.anduril.com/api/v1/oauth/token
Content-Type: application/x-www-form-urlencoded

Gets a new short-lived token using the specified client credentials

Reference: https://developer.anduril.com/reference/rest/oauth/get-token

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/x-www-form-urlencoded)

This endpoint expects an object.

- `grant_type` ("client_credentials", required) — The type of grant being requested
- `client_id` (string, optional) — The client identifier
- `client_secret` (string, optional) — The client secret

## Response

### 200

Access token response

- `access_token` (string, required) — The access token
- `token_type` (string, required) — The type of token (typically "Bearer")
- `expires_in` (integer, optional) — Lifetime of the access token in seconds
- `refresh_expires_in` (integer, optional) — Lifetime of the refresh token
- `not-before-policy` (integer, optional) — Enforce that a token cannot be used before a specific unixtime
- `scope` (string, optional) — The scope of the access token

## Errors

### 400 Bad Request Error

Bad request or invalid request

- `error` (string, required)
- `error_description` (string, optional)

### 401 Unauthorized Error

Unauthorized - client authentication failed

- `error` (string, required)
- `error_description` (string, optional)

## Examples

**Request**

```json
{
  "grant_type": "client_credentials"
}
```

**Response**

```json
{
  "access_token": "string",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_expires_in": 1,
  "not-before-policy": 1,
  "scope": "string"
}
```