---
search:
  tags:
    - Authentication
    - POST
seo:
  description: >-
    Exchange credentials for a JWT access token. Reference for the POST
    /auth/access-token endpoint in the Streamkap REST API.
sidebar:
  label: Access Token
  badge: POST
title: Access Token
type: openapi-operation
---
Exchange credentials for a JWT access token.

Accepts either:
- `client_id` + `secret` (classic API token flow)
- `project_key`: a Streamkap Project Key credential file (raw JSON or base64-encoded)

For `project_key` input, the API credentials are extracted from the bundle and used
to issue the JWT. Kafka-only Project Keys (no API credentials) cannot be exchanged
for a JWT.

`POST /auth/access-token`

**Request body** (`application/json`)

- `client_id` (string | null)
- `secret` (string | null)
- `project_key` (string | null)

Request body example:

```json
{
  "client_id": "string",
  "secret": "string",
  "project_key": "string"
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

Response example, 200:

```json
{
  "expires": "string",
  "expiresIn": 0,
  "accessToken": "string",
  "refreshToken": "string"
}
```
