---
title: "Mint End User Token"
method: POST
path: "/api/v1/end-users/{external_id}/tokens"
tags: ["end-users"]
---

# Mint End User Token

`POST /api/v1/end-users/{external_id}/tokens`

## Request

- Base URL: `https://api.maritime.sh` (the document declares no server; this is the origin it was published from)
- URL: `https://api.maritime.sh/api/v1/end-users/{external_id}/tokens`
- Auth: HTTP bearer

Mints a short-lived token the end user's own client uses to reach one of its agents.

Defaults: the end user's oldest agent, scope ``chat``, 900 seconds. Scopes:
chat, files, console, logs, app. The token is shown once. A suspended end
user's tokens stop working at once.

## Path parameters

- `external_id` string, required

## Request body

- EndUserTokenRequest: Body of ``POST /api/v1/end-users/{external_id}/tokens``.
  - `agentId` string, nullable
  - `scopes` string[], nullable
  - `ttlSeconds` integer, nullable

## Response `201`

Successful Response

- EndUserTokenResponse: A minted token. ``token`` is shown once.
  - `token` string, required
  - `agentId` string, required
  - `scopes` string[], required
  - `expiresAt` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/maritime/apis/maritime-api.md) - [All operations](https://skmtc.dev/maritime/apis/maritime-api/llms.txt) - [OpenAPI document](https://skmtc.dev/maritime/apis/maritime-api/revisions/acd712090ad6?raw)
