Revoke an API key
Marks the key revoked. Future requests using its token will fail; the row is preserved for audit.
Required scope: write_api_keys (for API-key authentication).
PATCH
Spree Admin SDK
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Marks the key revoked. Future requests using its token will fail; the row is preserved for audit.
Required scope: write_api_keys (for API-key authentication).
import { createAdminClient } from '@spree/admin-sdk'
const client = createAdminClient({
baseUrl: 'https://your-store.com',
secretKey: 'sk_xxx',
})
const key = await client.apiKeys.revoke('key_xxx')spree api patch /api_keys/{id}/revoke -d '{ ... }'{
"id": "key_gbHJdmfrXB",
"name": "Backend integration",
"key_type": "secret",
"token_prefix": "sk_TiYvmwsZg",
"scopes": [
"write_all"
],
"created_at": "2026-07-27T20:00:04.193Z",
"updated_at": "2026-07-27T20:00:04.470Z",
"revoked_at": "2026-07-27T20:00:04.470Z",
"last_used_at": null,
"channel_id": null,
"plaintext_token": null,
"created_by_email": null
}Was this page helpful?
import { createAdminClient } from '@spree/admin-sdk'
const client = createAdminClient({
baseUrl: 'https://your-store.com',
secretKey: 'sk_xxx',
})
const key = await client.apiKeys.revoke('key_xxx')spree api patch /api_keys/{id}/revoke -d '{ ... }'{
"id": "key_gbHJdmfrXB",
"name": "Backend integration",
"key_type": "secret",
"token_prefix": "sk_TiYvmwsZg",
"scopes": [
"write_all"
],
"created_at": "2026-07-27T20:00:04.193Z",
"updated_at": "2026-07-27T20:00:04.470Z",
"revoked_at": "2026-07-27T20:00:04.470Z",
"last_used_at": null,
"channel_id": null,
"plaintext_token": null,
"created_by_email": null
}