Proxy Keys
Toggle Proxy Key Status
Enable or disable a proxy key without deleting it
POST
Toggle the active status of a proxy key you own between enabled and disabled. The proxy key is identified by the
proxy_key field in the request body so the URL is static and can be exact-matched at the edge (Cloudflare, etc.), making it immune to path-traversal-append DDoS abuse.
The legacy POST /v1/auth/proxy/toggle/{proxy_key} still works for backward compatibility but is discouraged for new integrations.
Request Body
The proxy key to toggle (starts with
ek-proxy-). Must be a string between 1 and 256 characters and must be a proxy key you own — cross-account toggles return 403 Forbidden.Response Fields
Confirmation message that the status was updated.
The new status of the proxy key (
true = active, false = inactive).Behavior
The toggle endpoint switches the proxy key between two states:- Active (
true) — the proxy key can be used for API requests. - Inactive (
false) — the proxy key is rejected with authentication errors.
Use Cases
Temporary Suspension
Quickly disable access during maintenance or investigations.
Conditional Access
Enable/disable keys based on business logic or schedules.
Security Response
Immediately block suspicious activity without permanent deletion.
Testing
Safely test key revocation and restoration workflows.
Advantages Over Deletion
Preservation
Preservation
All key settings (name, expiration, credits, restrictions) are preserved.
Reversibility
Reversibility
Can be quickly re-enabled without reconfiguring settings.
Audit Trail
Audit Trail
Key history and usage statistics remain intact.
Credit Protection
Credit Protection
Allocated credits stay with the key and are not returned to the main balance.
Example Workflow
Python - Automated Key Management
Error Codes
Unauthorized — missing, malformed, or invalid
Authorization header. JWT tokens are not accepted on this endpoint.Forbidden — the proxy key exists but is owned by a different account.
Not Found — no proxy key with that value exists.
Unprocessable Entity — the request body is missing
proxy_key or violates the length constraint (1 <= len <= 256).Rate Limited — too many requests, please slow down.
Notes
- Requires an API key (
ek-...) in theAuthorizationheader. JWT tokens are intentionally rejected. - Proxy keys themselves (
ek-proxy-...) cannot call this endpoint — only the parent account that owns the proxy key can toggle it.
Related Endpoints
- List Proxy Keys — view current status of all keys.
- Lookup Proxy Key — read a single key’s metadata.
- Update Proxy Key — modify key configuration.
- Delete Proxy Key — permanently remove a key.
Authorizations
Enter your API key (starts with 'ek-')
Body
application/json
The proxy key to look up / toggle / delete (must be one you own)
Required string length:
1 - 256Example:
"ek-proxy-1234567890abcdef"
