---
title: "Create API key"
method: POST
path: "/users/apikeys"
tags: ["users"]
---

# Create API key

`POST /users/apikeys`

Create a new API key for a user

## Request body

- UsersCreateAPIKeyRequest
  - `expires_in_days` integer
  - `name` string, required

## Response `200`

OK

- UserAPIKey
  - `created_at` string
  - `expires_at` string
  - `id` string
  - `key` string
  - `last_used_at` string
  - `name` string
  - `user_id` string

## Other responses

- `400` — Bad Request

---

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