---
title: "Create Api Key"
method: POST
path: "/api/v1/workspaces/{workspace_id}/api-keys"
tags: ["api-keys"]
---

# Create Api Key

`POST /api/v1/workspaces/{workspace_id}/api-keys`

## Path parameters

- `workspace_id` string, required

## Headers

- `authorization` string, required

## Request body

- CreateAPIKeyRequest
  - `name` string
  - `scopes` string[]
  - `expires_in_days` integer, nullable

## Response `201`

Successful Response

- APIKeyCreatedResponse
  - `id` string, required
  - `name` string, required
  - `key_prefix` string, required
  - `raw_key` string, required
  - `scopes` string, required
  - `created_at` string, date-time, required
  - `expires_at` string, date-time, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/tomeku-development/apis/mesh-platform-api.md) · [All operations](https://skmtc.dev/tomeku-development/apis/mesh-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/tomeku-development/mesh-platform-api/revisions/08ace1bb7b09/schema)
