API reference / Dashboard keys
Revoke a key or purge its records
Without query parameters, revokes the key, closes sessions, cancels queued jobs and flags running jobs for cancellation.
/api/agent-keys/{keyId}Authorization
Owning dashboard session cookie + same OriginUse your signed-in dashboard session cookie. A FleetDeck API key cannot authenticate this endpoint. Browser requests must be same-origin; write requests require a matching Origin header. Authentication guide ↗
Request example
curl --request DELETE \
--url 'https://fleetdeck.co/api/agent-keys/key_123' \
--cookie "$FLEETDECK_DASHBOARD_COOKIE" \
--header 'Origin: https://fleetdeck.co'Replace example IDs with returned values. Read credentials from your private environment.
Response examples
{
"revoked": true
}Path parameters
keyIdstringrequiredExact identifier returned by this API, owned by the applicable key/account.
"key_123"Validation pattern
^[A-Za-z0-9._:-]+$Query parameters
purgestringoptionalPermanently remove a previously revoked key and associated records. Active leases block purge.
"1"Required headers
OriginstringrequiredMust match this app’s origin or configured public app origin.
"https://fleetdeck.co"Request body
This endpoint does not require a request body.
Behavior and limits
Without query parameters, revokes the key, closes sessions, cancels queued jobs and flags running jobs for cancellation. Audit metadata is retained. After revoking, add ?purge=1 to permanently remove this key, child keys and associated session/action/job records. Purge refuses active action/job leases. Responses are {revoked:true} or {removed:true}. No request body.
Response 200
KeyRemoval · application/json
Variant 1 · object
revokedbooleanalways presentTrue when the key is revoked and can no longer authenticate.
trueVariant 2 · object
removedbooleanalways presentTrue when a previously revoked key and its associated records have been permanently purged.
trueErrors
Expand a code for its recovery steps. Responses use error and code; validation errors also include issues.
401UNAUTHORIZEDMissing, malformed, expired or revoked credential; user verification/password state can also deny access.
Recovery: Use Authorization: Bearer with a valid scoped key. For dashboard routes, sign in. Job children require an active parent job and timely renewal.
Full error reference ↗403ORIGINDashboard mutation lacks an allowed Origin header.
Recovery: Use the signed-in same-origin dashboard. Cross-origin key management is not supported.
Full error reference ↗404NOT_FOUNDUnknown route or resource unavailable to this caller.
Recovery: Check method/path and use returned IDs from this account/key. Do not guess IDs.
Full error reference ↗409REVOKE_FIRSTPurge attempted on a key that is not revoked.
Recovery: Revoke the key first, then purge only if permanent record deletion is intended.
Full error reference ↗409WORK_ACTIVEPurge would delete an active action/job lease.
Recovery: Wait for work and leases to finish, then retry purge. Do not erase active work history.
Full error reference ↗500INTERNALUnexpected service error.
Recovery: Save nonsecret request context and time for support. Query action status before repeating a mutation; never assume it did not execute.
Full error reference ↗Example error messages are illustrative. Match the code and HTTP status; do not depend on exact message wording.
