---
title: "Create an API Key"
method: POST
path: "/api_keys"
tags: ["API Keys"]
---

# Create an API Key

`POST /api_keys`

## Request body

- object
  - `type` string
  - `name` string, required
  - `description` string, nullable
  - `subject` string, required
  - `claims` unknown
  - `scopes` string[]
  - `created_by` string, nullable
  - `seconds_until_expiration` number, nullable

## Response `200`

200 OK

- object
  - `object` 'api_key', required
  - `id` string, required
  - `type` string, required
  - `subject` string, required
  - `name` string, required
  - `description` string, nullable
  - `claims` unknown, required
  - `scopes` string[], required
  - `secret` string, required
  - `revoked` boolean, required
  - `revocation_reason` string, nullable, required
  - `expired` boolean, required
  - `expiration` number, nullable, required — The timestamp for when the API key will expire, in milliseconds
  - `created_by` string, nullable, required
  - `last_used_at` number, nullable, required — The timestamp for when the API key was last used, in milliseconds
  - `created_at` number, required — The timestamp for when the API key was created, in milliseconds
  - `updated_at` number, required — The timestamp for when the API key was last updated, in milliseconds

## Other responses

- `400` — 400 Bad Request
- `409` — 409 Conflict

---

[API](https://skmtc.net/clerk/apis/clerk-backend-api.md) · [All operations](https://skmtc.net/clerk/apis/clerk-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clerk/clerk-backend-api/versions/cf036e7951d3/schema)
