Create API key
POST
/api/v1/api-keys
Authentication
Bearer Token API Key (cookie: better-auth.session_token)
Request Body
application/jsonname
string
type
string
Enum:
live, publishableproject_id
string
allowed_domains
string[]
Array of:
Responses
201
API key created (plaintext returned only once)
application/jsonid
string
REQUIRED
key
string
REQUIRED
prefix
string
REQUIRED
name
string
REQUIRED
type
string
REQUIRED
Enum:
live, publishableproject_id
string | null
REQUIRED
allowed_domains
string[]
REQUIRED
Array of:
curl -X POST 'https://littledemo.com/api/v1/api-keys' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "type": "live", "project_id": "string", "allowed_domains": [ "string" ]}'
const response = await fetch('https://littledemo.com/api/v1/api-keys', { method: 'POST', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "string", "type": "live", "project_id": "string", "allowed_domains": [ "string" ] })});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://littledemo.com/api/v1/api-keys', headers=headers, json={ "name": "string", "type": "live", "project_id": "string", "allowed_domains": [ "string" ]})print(response.json())
201
Response
{ "id": "<string>", "key": "<string>", "prefix": "<string>", "name": "<string>", "type": "live", "project_id": "<string>", "allowed_domains": [ "<string>" ]}
API Playground
Try this endpoint
POST
/api/v1/api-keys