---
title: "Generate OAuth Token"
method: POST
path: "/oauth/token"
tags: ["Authentication"]
---

# Generate OAuth Token

`POST /oauth/token`

## Request

- Base URL: `https://reporting.api.later.com`
- URL: `https://reporting.api.later.com/oauth/token`
- Auth: none required
- TypeScript: <https://skmtc.dev/later/apis/later-influence-reporting-api/docs/oauth/token/post.ts> (a function with typed inputs; its response is checked against the schema)

Exchange client credentials for a JWT. Returns `jwt` on success. Failed requests return `application/problem+json` (RFC 9457) with `type`, `title`, and `detail` (no `status` in body):

- **401** (`type: ANL_00401`) — the `clientId` or `clientSecret` was not accepted. Check the credentials before retrying.
- **403** (`type: ANL_00403`) — the credentials were accepted, but the client is not permitted to issue a token. Retrying will not help; contact your Later account team.
- **415** (`type: ANL_00415`) — the request `Content-Type` is not `application/json`.

## Request body

- TokenRequestDto
  - `clientId` string, required: Client ID required to get the JWT token used for authentication
  - `clientSecret` string, required: Client Secret required to get the JWT token used for authentication

## Response `200`

Success. Returns `jwt` for use as `Authorization: Bearer <jwt>` on all reporting routes.

- TokenResponseDto
  - `jwt` string, required: JWT used as `Authorization: Bearer <jwt>` on Reporting API routes.

## Other responses

- `400`: Malformed JSON body or missing required fields
- `401`: Authentication failed — the `clientId` or `clientSecret` was not accepted (`ANL_00401`).
- `403`: Authorization failed — the credentials were accepted, but the client is not permitted to issue a token (`ANL_00403`). Retrying will not help; contact your Later account team.
- `415`: Unsupported media type — the request `Content-Type` is not `application/json` (`ANL_00415`).
- `500`: Unexpected error while issuing token

---

[API](https://skmtc.dev/later/apis/later-influence-reporting-api.md) - [All operations](https://skmtc.dev/later/apis/later-influence-reporting-api/llms.txt) - [OpenAPI document](https://skmtc.dev/later/apis/later-influence-reporting-api/revisions/690357ea985d?raw)
