Delete a secret

SDK platic.secrets.delete()

Delete a secret you no longer want to keep. First check usedBy with Get a secret to see which resources use it. Its value and all authorizations are erased; those slots need another secret to work.

Example

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

Path parameters

ParameterTypeDescriptionRequired
secretIdstringId of the secret✓

Response

{
  "status": "success",
  "message": "Secret deleted successfully",
  "data": {
    "id": "5d0c7a1e9b3f4a6c8e2d1f0b7a9c3e5d6f8a0b2c4d6e8f1a3b5c7d9e0f2a4b6c"
  }
}

Response fields

FieldTypeDescription
idstringId of the deleted secret

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

Notes

  • Before deleting, check usedBy with get a secret.
  • Deleting an API, an MCP server, or a webhook does not delete its secrets: they are deleted here.
  • Repeating the call on a secret that is already being deleted continues the deletion.
  • When it finishes, the secret answers 404 on all its routes, the same as one that never existed.