ApiKeys

Create an API key

Creates a new API key for the organization and returns the created key, including the plaintext secret, with a 201 response.

POST
/v1/api-keys

Creates a new API key for the organization and returns the created key, including the plaintext secret, with a 201 response.

x-api-key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

name*string
Length1 <= length <= 32
description?string|null
expiresAt?string|null
access?||

Defaults to full access. A restricted API key creating a key defaults to its own grants and cannot issue full access.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/api-keys" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "id": "string",  "name": "string",  "key": "string",  "start": "string",  "description": "string",  "createdAt": "string",  "expiresAt": "string",  "lastUsedAt": "string",  "isActive": true,  "access": {    "mode": "full"  },  "owner": {    "id": "string",    "name": "string",    "email": "string"  }}

Related documentation