Skip to main content

API Keys — client.api_keys

Programmatically manage keys for your organization.

create(**params) → APIKeyCreated

POST /v1/api-keys

ParamTypeRequiredDefaultDescription
namestryesFriendly name.
scopeslist[str]no["*"]e.g. ["agents:read","calls:write"]. ["*"] = full access.
expires_in_daysintno3651–730.
rate_limit_tierstrno"starter"free, starter, professional, enterprise.
ip_allowlistlist[str]no[]IPs/CIDRs allowed to use the key. Empty = all.

Returns APIKeyCreated: includes key — the full plaintext key, shown only once. Store it immediately.

Others

  • list(skip=0, limit=20, include_inactive=False) → list[APIKey] (masked — only key_prefix shown)
  • get(key_id) → APIKey
  • update(key_id, name=…, scopes=…, rate_limit_tier=…, ip_allowlist=…, is_active=…) → APIKey
  • delete(key_id) → None — revoke immediately.
  • rotate(key_id, grace_period_hours=24) → APIKeyCreated — new key; old one stays valid during the grace period.
  • get_usage(key_id) → APIKeyUsage

Valid scopes: agents:{read,write,delete}, calls:{read,write,delete}, phone_numbers:{read,write,delete}, batch_calls:{read,write,delete}, workflows:{read,write,delete}, analytics:read, knowledge_bases:{read,write,delete}, webhooks:{read,write}, config:read, api_keys:{read,write,delete}, *. (write implies read; delete implies write+read.)