Talk with Archie
API reference › Connect Keys
API reference › Connect Keys

Create a New API Key

POST/api/v1/connect-keys
Mint a new WorkOS-managed sk_* key + INSERT canonical mirror row.

Body shape — all fields optional except name::

{ "name": "label string", # required "permissions": ["topics:read"], # optional, default [] "workspace_id": "<uuid>", # optional, pins key to a workspace "rate_limit_per_minute": 60, # optional, per-key override "description": "free text" # optional }

Mirror INSERT is part of the success contract — if it fails, we rollback by deleting the just-created WorkOS key. The caller never sees a key that exists in WorkOS but not in our mirror.

Response includes the full value (sk_…) once — caller MUST surface it to the developer and never store it. WorkOS will not return it again. Response also includes the full merged shape (mirror fields populated with whatever the body set).

expires_in_days (optional): when present and > 0 the mirror row's expires_at is stamped now() + N days so the reaper revokes the key on schedule. Omit (or 0/null) for a non-expiring key — the product surface's "permanent" / permakey-style key. expires_at IS NULL is the reaper's untouched state.

Returns

Successful Response

curl https://uk.heyarchie.com/api/v1/connect-keys \
  -X POST \
  -H "Authorization: Bearer sk_..."
import requests

headers = {"Authorization": "Bearer sk_..."}

r = requests.post("https://uk.heyarchie.com/api/v1/connect-keys", headers=headers)
print(r.json())
const r = await fetch("https://uk.heyarchie.com/api/v1/connect-keys", {
  method: "POST",
  headers: { "Authorization": "Bearer sk_..." },
});
const data = await r.json();
console.log(data);
Response

Every response also carries X-Request-ID. Quote it if you write to us about a call.