---
docId: doc_c8bc8a034a2d428aa75828cb1da77bf5
title: Revoke a secret
description: Stop all uses of a secret right away. The record is kept and still appears in the list.
api:
  group: herramientas/secretos
  auth: bearer
  operations:
    - operationId: revokeSecret
      method: POST
      path: '/v1/secrets/{secretId}/revoke'
      postmanName: Revoke a secret
---

<script>
  import { Ways, Note } from '$lib/components';
</script>

# Revoke a secret

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.

<Note type="warning">

There is no operation to reactivate a revoked secret, and it cannot be rotated. The tools and webhooks that used it stop working until you bind another secret to them.

</Note>

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X POST https://api.platic.ai/v1/secrets/$SECRET_ID/revoke \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

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

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `secretId` | string | Id of the secret | ✓ |

## Request body

It has no body.

## Response

```json
{
  "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](/api-reference/secrets/list#response-fields).

## 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 |
| `409` | `SECRET_USE_REVOKED` | The secret is being deleted |

## Notes

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