---
title: "Generate API Key"
method: POST
path: "/api/v{version}/users/keys"
tags: ["users"]
---

# Generate API Key

`POST /api/v{version}/users/keys`

## Request

- Base URL: `https://api.zrexpress.app`
- URL: `https://api.zrexpress.app/api/v{version}/users/keys`
- Auth: HTTP bearer and API key in header `X-Api-Key`
- TypeScript: <https://skmtc.dev/zrexpress/apis/zrexpress-api/docs/api/v:version/users/keys/post.ts> (a function with typed inputs; its response is checked against the schema)

Generates a secure API key for user authentication.\n
                        Supported expiration values : 7, 30, 90, 180, 365 days.

## Path parameters

- `version` string, required

## Request body

- CreateUserKeyRequest
  - `name` string, nullable
  - `expiresInDays` integer

## Response `200`

OK

## Changes

- **2026-11-03** `652262902df9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/zrexpress/apis/zrexpress-api/changes/api/v:version/users/keys/post.md)

---

[API](https://skmtc.dev/zrexpress/apis/zrexpress-api.md) - [All operations](https://skmtc.dev/zrexpress/apis/zrexpress-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zrexpress/apis/zrexpress-api/revisions/652262902df9?raw)
