---
title: "Create an API key"
method: POST
path: "/spaces/{space_id}/api_keys"
---

# Create an API key

`POST /spaces/{space_id}/api_keys`

Creates a new API key (client credentials) for the specified space.
Requires user authentication (JWT). API keys cannot create other API keys.

## Path parameters

- `space_id` string, required

## Request body

- CreateApiKeyRequest
  - `name` string, required

## Response `201`

API key created

- ApiKeyCredentials
  - `api_key` string, required
  - `access_key` string, required
  - `secret_key` string, required

## Other responses

- `default` — Error response

## Changes

- **2026-04-17** `a7becb6668ec` — 1 warning
  - removed the optional property `code` from the response with the `default` status

[Change history](https://skmtc.dev/timescale/apis/ghost-api/changes/spaces/:space_id/api_keys/post.md)

---

[API](https://skmtc.dev/timescale/apis/ghost-api.md) · [All operations](https://skmtc.dev/timescale/apis/ghost-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/timescale/ghost-api/revisions/a7becb6668ec/schema)
