---
title: "Create a named non-expiring agent token"
method: POST
path: "/agent-tokens"
tags: ["Agent tokens"]
---

# Create a named non-expiring agent token

`POST /agent-tokens`

## Request

- Base URL: `https://api.chatdna.co/agent-push-kit/v1`
- URL: `https://api.chatdna.co/agent-push-kit/v1/agent-tokens`
- Auth: HTTP bearer

The raw `apt_` token is shown once. Store it before dismissing the response.

## Request body

- CreateAgentTokenInput
  - `name` string, required

## Response `201`

Token created

- AgentTokenCreated
  - `id` string, required
  - `name` string, required
  - `keyPrefix` string, required
  - `lastFour` string, required
  - `createdAt` string, date-time, required
  - `lastUsedAt` string, date-time, nullable
  - `revokedAt` string, date-time, nullable
  - `token` string, required

## Other responses

- `400`: Invalid request
- `401`: Missing, invalid, or revoked credentials

---

[API](https://skmtc.dev/agentpushkit/apis/agent-push-kit-api.md) · [All operations](https://skmtc.dev/agentpushkit/apis/agent-push-kit-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agentpushkit/apis/agent-push-kit-api/revisions/f522c3cf50bf?raw)
