---
title: "Create a new API key"
method: POST
path: "/v1/apikeys"
tags: ["API Keys"]
---

# Create a new API key

`POST /v1/apikeys`

Creates a new API key for the authenticated user. The complete API key is returned only once and cannot be retrieved later.

## Request body

- ApiKeyCreateRequest
  - `name` string
  - `permissions` string
  - `expirationDays` integer

## Response `201`

API key created successfully

- ApiKeyResponse
  - `id` string
  - `name` string
  - `key` string
  - `active` boolean
  - `expiresAt` string, date-time
  - `permissions` string
  - `created` integer

## Other responses

- `400` — Invalid request data
- `401` — User is not authorized to access this endpoint
- `500` — Internal server error

---

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