---
title: "CreateApiKey creates a new API Key"
method: POST
path: "/users/v1/api/create"
tags: ["UsersMsgService"]
---

# CreateApiKey creates a new API Key

`POST /users/v1/api/create`

priv_key is returned only once, in this response. It isn't stored and
can't be retrieved again, only rotated via RotateApiKey

## Request body

- V1CreateApiKeyRequest
  - `expiresAt` string, date-time
  - `name` string, required
  - `scopes` string[], required

## Response `200`

A successful response.

- V1CreateApiKeyResponse
  - `apiKey` string, required
  - `privKey` string, required

## Other responses

- `default` — An unexpected error response. `details[0]` is always an AppError, see #/components/schemas/AppError

---

[API](https://skmtc.net/kiiglobal/apis/kiichain-pay-backend.md) · [All operations](https://skmtc.net/kiiglobal/apis/kiichain-pay-backend/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kiiglobal/kiichain-pay-backend/versions/8951249f5b63/schema)
