Skip to main content
POST
/
api
/
v1
/
projects
/
{project_slug}
/
api-keys
Create Api Key
curl --request POST \
  --url https://api.example.com/api/v1/projects/{project_slug}/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>"
}
'
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({name: '<string>'})
};

fetch('https://api.example.com/api/v1/projects/{project_slug}/api-keys', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
import requests

url = "https://api.example.com/api/v1/projects/{project_slug}/api-keys"

payload = { "name": "<string>" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "key": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "prefix": "<string>",
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

project_slug
string
required

Body

application/json
name
string
required

Response

201 - application/json

Created

key
string
required
id
string<uuid>
required
name
string
required
prefix
string
required
created_at
string<date-time>
required