---
title: "Create an API key"
method: POST
path: "/v1/workspaces/{workspaceId}/api-keys"
tags: ["API Keys"]
---

# Create an API key

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

## Request

- Base URL: `https://api.maevesocial.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.maevesocial.com/v1/workspaces/{workspaceId}/api-keys`
- Auth: HTTP bearer

Creates a new API key. The raw key is only returned once in the response, so store it securely.

## Path parameters

- `workspaceId` string, uuid, required

## Request body

- CreateApiKeyDto
  - `name` string, required
  - `expiresAt` string, nullable: Optional timezone-qualified ISO-8601 expiration timestamp. Must be a future date.
  - `workspaceIds` string[], required: One or more workspace IDs this API key can access.

## Response `201`

API key created with the raw key included once

- object
  - `data` PublicApiKeyCreatedDto, required
    - `id` string, uuid, required
    - `name` string, required
    - `key` string, required
    - `keyPrefix` string, required
    - `createdAt` string, required
    - `expiresAt` string, nullable, required
  - `meta` unknown, required

---

[API](https://skmtc.dev/maevesocial/apis/maeve-social-api.md) · [All operations](https://skmtc.dev/maevesocial/apis/maeve-social-api/llms.txt) · [OpenAPI document](https://skmtc.dev/maevesocial/apis/maeve-social-api/revisions/1b00fd7e4b15?raw)
