---
title: "Create an api token"
method: POST
path: "/api-tokens"
tags: ["api token"]
---

# Create an api token

`POST /api-tokens`

## Request body

- APITokenAPIModifyAPIToken
  - `allowedCIDRBlocks` string[] — The set of CIDR blocks that are allowed to use this API token. If empty, all CIDR blocks are allowed
  - `name` string, required — The name of the token
  - `permissions` string[], required

## Response `200`

OK response.

- APITokenAPIAPIToken
  - `allowedCIDRBlocks` string[] — The set of CIDR blocks that are allowed to use this API token. If empty, all CIDR blocks are allowed
  - `createdAt` string, required — Time when the API token was created
  - `createdBy` object — The actor who created the token
    - `id` 'user' | 'api-token' | 'system'
    - `type` string
  - `expiresAt` string — Time when the API token will expire. Will be null if the token is non-expiring
  - `id` string, required — The unique identifier of the token
  - `lastUsedAt` string — The last time this token was used to authenticate
  - `name` string, required — The name of the token
  - `permissions` string[], required
  - `rotatedAt` string — Time when the API token was rotated
  - `updatedAt` string — Time when the API token was updated
  - `updatedBy` object — The actor who updated the token
    - `id` 'user' | 'api-token' | 'system'
    - `type` string
  - `value` string — The API token value, only populated during create and rotate actions

## Other responses

- `400` — bad_request: Bad Request response.

---

[API](https://skmtc.dev/panther/apis/panther-rest-api.md) · [All operations](https://skmtc.dev/panther/apis/panther-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/panther/panther-rest-api/revisions/eb177cb9d6a1/schema)
