For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
WebsiteDashboardGet API key
  • Get Started
    • Welcome
    • Quickstart
    • Agent onboarding
    • Service keys
    • Core Concepts
  • Guides
    • Hosted Mode
    • Webhook Mode
    • Audio Mode
    • SMS and Conversations
    • Compliance and Consent
    • Billing and Usage
    • Voice zones
    • SMS zones
  • Reference
    • Authentication
    • API Overview
    • Errors and Testing
  • API Reference
      • GETList child API keys
      • POSTMint a child API key
      • GETGet a child API key
      • DELRevoke a child API key
      • PATCHUpdate a child API key
      • POSTAtomically rotate a child API key
  • Changelog
    • Cloudflare Insights CSP
    • Agent-native key management
    • Postpaid auto-charge
    • Cents-honest pricing
    • Stripe payments foundation
    • Hosted/webhook mode rename
    • Upgrading to v0.5.7.0
LogoLogo
WebsiteDashboardGet API key
API ReferenceKeys

Revoke a child API key

DELETE
https://saperly.com/api/v1/keys/:id
DELETE
/api/v1/keys/:id
1const url = 'https://saperly.com/api/v1/keys/id';
2const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
3
4try {
5 const response = await fetch(url, options);
6 const data = await response.json();
7 console.log(data);
8} catch (error) {
9 console.error(error);
10}
1{
2 "key": {
3 "id": "string",
4 "key_prefix": "sk_live_abc",
5 "environment": "live",
6 "name": "string",
7 "agent_label": "string",
8 "line_id": "string",
9 "permissions": "full",
10 "monthly_cap_cents": 1,
11 "monthly_spend_cents": 1,
12 "created_at": "2024-01-15T09:30:00Z",
13 "revoked_at": "2024-01-15T09:30:00Z",
14 "last_used_at": "2024-01-15T09:30:00Z",
15 "rotated_from": "string",
16 "created_by_service_key_id": "string"
17 }
18}
Soft-revokes a child API key. The key cuts over IMMEDIATELY at data-plane endpoints (`/v1/calls`, `/v1/messages`, etc.) — there is no 60-second grace window for child keys. Subsequent requests with the revoked key return `invalid_api_key`. The returned row carries `revoked_at` populated; calling DELETE again returns 404 (idempotent at the user-visible level).
Was this page helpful?
Previous

Update a child API key

Next
Built with

Soft-revokes a child API key. The key cuts over IMMEDIATELY at data-plane endpoints (/v1/calls, /v1/messages, etc.) — there is no 60-second grace window for child keys. Subsequent requests with the revoked key return invalid_api_key. The returned row carries revoked_at populated; calling DELETE again returns 404 (idempotent at the user-visible level).

Authentication

AuthorizationBearer

Service keys (sk_svc_*) authenticate the /v1/keys/* management plane. Send as Authorization: Bearer <service-key>. Service keys are minted only from the portal (Settings → Service Keys); there is no API path to mint another service key.

Path parameters

idstringRequiredformat: "uuid"
Child API key ID

Response

Child API key revoked
keyobject

A child API key (sk_test_* / sk_live_*). Minted via the portal (UI) or programmatically via POST /v1/keys when authenticated as a service key.

Errors

401
Unauthorized Error
404
Not Found Error