Create an API key
curl -X POST https://api.ai.aikynetix.app/api/api-keys/ \ -H 'Authorization: Bearer <firebase-id-token>' \ -H 'Content-Type: application/json' \ -d '{"label":"production webhook"}'import requests, getpassFIREBASE_ID_TOKEN = getpass.getpass("Firebase ID token: ")r = requests.post( "https://api.ai.aikynetix.app/api/api-keys/", headers={"Authorization": f"Bearer {FIREBASE_ID_TOKEN}"}, json={"label": "production webhook"}, timeout=30,)r.raise_for_status()created = r.json()print("Save now (shown once):", created["token"]) # aik_…const r = await fetch("https://api.ai.aikynetix.app/api/api-keys/", { method: "POST", headers: { Authorization: `Bearer ${FIREBASE_ID_TOKEN}`, "Content-Type": "application/json", }, body: JSON.stringify({ label: "production webhook" }),});if (!r.ok) throw new Error(`HTTP ${r.status}`);const created = await r.json();console.log("Save now (shown once):", created.token); // aik_…Mints a new long-lived bearer token scoped to the active team. Owner-only — member-role coaches get 403. Minting also requires the Organization plan or higher (403 api_keys_require_upgraded_plan otherwise; listing and revoking stay open on every tier). The plaintext token is returned exactly once, in this response — store it immediately; we keep only a SHA-256 hash and cannot recover it. Use the returned aik_… token in Authorization: Bearer aik_… headers for server-to-server integrations. Rotate by minting a new key + revoking the old one (DELETE /api/api-keys/<id>/).
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Friendly label so the team owner can tell keys apart. Visible only to authenticated team members.
Examples
Name the key
{ "label": "production webhook"}object
Friendly label so the team owner can tell keys apart. Visible only to authenticated team members.
Examplegenerated
label=exampleobject
Friendly label so the team owner can tell keys apart. Visible only to authenticated team members.
Responses
Section titled “Responses”object
Key UUID. Pass to DELETE /api/api-keys/<id>/ to revoke.
The label supplied at creation.
The plaintext aik_… bearer token. Shown exactly once — we store only a SHA-256 hash and cannot recover it. Store it now; use it in Authorization: Bearer aik_… headers.
ISO-8601 UTC of creation.
Examples
Copy `token` now; it is never returned again
{ "id": "9b1c7e2a-4d3f-4a8b-9c0d-1e2f3a4b5c6d", "label": "production webhook", "token": "aik_S3cr3tT0k3nValueShownOnceDoNotShare1234", "created_at": "2026-04-30T08:00:00Z"}object
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Examplegenerated
{ "detail": "example"}object
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Examplegenerated
{ "detail": "example"}object
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Examples
Only the owner can mint or revoke keys
{ "detail": "Only the team owner can manage API keys"}Minting requires the Organization tier or higher (listing/revoking stay open)
{ "detail": "api_keys_require_upgraded_plan"}