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
permissions?|null

Response Body

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,  "permissions": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "roleName": "string"}