Revoke a secret

SDK platic.secrets.revoke()

Stop using an exposed credential by sending its secretId, with no body. Platica stops sending its value to any destination and keeps the record in the list.

Example

await platic.secrets.revoke("secret_123");

Path parameters

ParameterTypeDescriptionRequired
secretIdstringId of the secret✓

Request body

It has no body.

Response

{
  "status": "success",
  "message": "Secret revoked successfully",
  "data": {
    "id": "5d0c7a1e9b3f4a6c8e2d1f0b7a9c3e5d6f8a0b2c4d6e8f1a3b5c7d9e0f2a4b6c",
    "name": "Acme Store · Orders API",
    "kind": "bearer",
    "status": "revoked",
    "revision": 4,
    "createdAt": "2026-10-28T12:05:00.000Z",
    "updatedAt": "2026-11-06T08:02:11.000Z"
  }
}

Response fields

data has the secret with status: "revoked" and the fields in list secrets.

Errors

Statusdetails.codeWhen it happens
403FORBIDDENThe person behind the token cannot manage secrets
404SECRET_NOT_FOUNDThe secret does not exist in this workspace or was already deleted
409SECRET_CHANGEDAnother change arrived at the same time. Repeat the call
409SECRET_USE_REVOKEDThe secret is being deleted

Notes

  • Before revoking, check usedBy with get a secret.
  • To replace the credential without interrupting anything, use rotate a secret instead of revoking.
  • A revoked secret still appears in list secrets. To remove it, delete it.
  • Revoking the secret in Platica does not invalidate the credential with your provider: do that there too.