# revoke

URL: /business/nouns/secret/revoke · Id: `verb:Secret.revoke` · Call: `await $.Secret.revoke({ … })` (SDK) or the `do` tool at `https://api.sb/mcp`. Inputs says what to pass, Outputs what returns, When it waits who approves.

> Revoke ends a Secret so no call fills it again; the record and its history stay.

Revoke ends a [Secret](/business/nouns/secret) so no call fills it again; the record and its history stay.

## Inputs
| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `secret` | [Secret](/business/nouns/secret) | Yes | The Secret to revoke. |
| `reason` | `text` | No | Why, such as a leaked value. |

## Outputs
| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `secret` | [Secret](/business/nouns/secret) | Yes | The revoked Secret. |

## Effects
- Emits [`Secret.revoked`](/business/events/Secret.revoked).
- Performed by the [Security Engineer](/agents/engineering/security-engineer).
- One-way (customer): it waits out its delay window, and runs in the `send` and `do` modes.
- A leaked value revokes at once: a brake never waits.

## Refuses when
| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | [Secret.revoke](/business/nouns/secret/revoke) |

## When it waits
| Gate | Default |
| --- | --- |
| Decision class | Medium: one-way, bounded (customer) |
| [Delay window](/systems/trust-and-governance/controls/one-way-windows) | 1 business hour, in which a watcher can pause, redirect or cancel it; then it runs. |
| Limit | The call [Limit](/business/nouns/limit) of the [Permission](/business/nouns/permission) it runs under. |
| Over the Limit | It waits `pending` for an [Approval](/business/nouns/approval) from the [Founder](/agents/founding/founder). Approved, it runs; refused, it ends `refused` with [`limit-exceeded`](/code/api/errors/limit-exceeded); unanswered by its deadline, it ends `canceled`. |

## Example

**Ask**

```text
Revoke the latest secret.
```

**API**

```bash
curl -X POST https://api.sb/tutorloop.com/secrets/secret_1/revoke \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/tutorloop.com",
  "secret": {
    "$id": "https://api.sb/tutorloop.com/secrets/secret_1",
    "$type": "Secret",
    "name": "MAPS_KEY",
    "environment": "test",
    "scope": "startup"
  },
  "action": {
    "$id": "https://api.sb/tutorloop.com/actions/action_1",
    "operation": "Secret.revoke",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/tutorloop.com/actions/action_1"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const secret = await $.Secret.revoke({ secret: 'secret_1' })
```

**CLI**

```bash
npx startup-builder do Secret.revoke --json '{"secret":"secret_1"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Secret.revoke({ secret: 'secret_1' })"
  }
}
```