---
title: "Create Workspace API Key"
method: POST
path: "/v1/{workspace}/ws_api_key/"
---

# Create Workspace API Key

`POST /v1/{workspace}/ws_api_key/`

Create a new API key scoped to this workspace.

The full `api_key` secret is returned **only once** in the create response. Store it securely - it cannot be retrieved later.

## Path parameters

- `workspace` string, required

## Request body

- WorkspaceApiKeyCreateRequest
  - `name` string, required — Label for the API key.
  - `description` string, nullable — Optional notes for operators.

## Response `201`

API key created. `api_key` is returned only once - store it securely.

- ManagementWorkspaceApiKeyCreateResponse — Workspace-scoped REST API key (server-side secret).
  - `id` string — Unique identifier of the API key.
  - `masked_api_key` string — Masked preview of the API key used in list responses.
  - `is_deleted` boolean — Indicates whether the API key has been deleted.
  - `name` string — Label for the API key.
  - `allowed_domains` string[] — Domains allowed to use this key.
  - `created_at` string, date-time — Timestamp when the API key was created.
  - `created_by` ManagementActor, nullable — Identity that performed an action (created, updated, rolled, deleted, rotated).
    - `name` string — Display name of the actor.
    - `email` string — Email address of the actor.
  - `deleted_at` string, date-time, nullable — Timestamp when the API key was deleted, if applicable.
  - `deleted_by` ManagementActor, nullable — Identity that performed an action (created, updated, rolled, deleted, rotated).
    - `name` string — Display name of the actor.
    - `email` string — Email address of the actor.
  - `api_key` string — Full secret API key. Returned only once at creation - store it securely and never commit to source control.

## Other responses

- `400` — Validation error - data validation failed
- `401` — Authentication failed
- `404` — Resource not found

---

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