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.
Warning
This cannot be undone. The APIs, MCP servers, and webhooks that used the secret stop working until you bind another one to them.
Example
curl -X DELETE https://api.platic.ai/v1/secrets/$SECRET_ID \
-H "Authorization: Bearer $PLATIC_API_KEY" await platic.secrets.delete("secret_123"); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
secretId | string | Id of the secret | ✓ |
Response
{
"status": "success",
"message": "Secret deleted successfully",
"data": {
"id": "5d0c7a1e9b3f4a6c8e2d1f0b7a9c3e5d6f8a0b2c4d6e8f1a3b5c7d9e0f2a4b6c"
}
} Response fields
| Field | Type | Description |
|---|---|---|
id | string | Id of the deleted secret |
Errors
| Status | details.code | When it happens |
|---|---|---|
403 | FORBIDDEN | The person behind the token cannot manage secrets |
404 | SECRET_NOT_FOUND | The secret does not exist in this workspace or was already deleted |
409 | SECRET_CHANGED | Another change arrived at the same time. Repeat the call |
Notes
- Before deleting, check
usedBywith 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
404on all its routes, the same as one that never existed.