# Interface commands: deprecate, sunset

URL: /code/cli/interface/verbs · Id: `page:code/cli/interface/verbs`

> The Interface Verbs deprecate, sunset as CLI commands, with inputs, result, refusals and an example.

Reference for [Interface](/business/nouns/interface), one group of [Interface commands](/code/cli/interface).

### Interface.deprecate
Deprecate marks an API version for retirement, posts its sunset date and lists each Tenant still pinned to it. [Verb page](/business/nouns/interface/deprecate?interface=cli).

```text
npx startup-builder do Interface.deprecate --data '<input>' [--try | --send | --do]
```

Emits [`Interface.deprecated`](/business/events/Interface.deprecated).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `interface` | [Interface](/business/nouns/interface) | Yes | The API. |
| `version` | `string` | Yes | The version to retire, such as `v1`. |
| `sunsetAt` | `date` | Yes | The date it stops serving, once no Tenant pins it. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `interface` | [Interface](/business/nouns/interface) | Yes | The API, with the version deprecated. |

**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. | None. |
| `interface` is missing, or is not a interface | [`invalid-input`](/code/api/errors/invalid-input) | Send `interface` as a interface, then call it again. | None. |
| `version` is missing, or is not a string | [`invalid-input`](/code/api/errors/invalid-input) | Send `version` as a string, then call it again. | None. |
| `sunsetAt` is missing, or is not a date | [`invalid-input`](/code/api/errors/invalid-input) | Send `sunsetAt` as a date, then call it again. | None. |
| The `Idempotency-Key` was sent before with another operation or other input | [`idempotency-mismatch`](/code/api/errors/idempotency-mismatch) | Send a new key for new input; reuse a key only to retry the same request. | None. |

**Example**

```bash
npx startup-builder do Interface.deprecate --data '{"interface":"interface_TMyQ3kh9uX","version":"Example version","sunsetAt":"2026-10-22"}' \
  --idempotency-key leaseline-interface-deprecate-1
```

### Interface.sunset
Sunset stops serving a deprecated API version once no Tenant pins it. [Verb page](/business/nouns/interface/sunset?interface=cli).

```text
npx startup-builder do Interface.sunset --data '<input>' [--try | --send | --do]
```

Emits [`Interface.sunsetted`](/business/events/Interface.sunsetted).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `interface` | [Interface](/business/nouns/interface) | Yes | The API. |
| `version` | `string` | Yes | The deprecated version. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `interface` | [Interface](/business/nouns/interface) | Yes | The API, without the version. |

**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. | None. |
| Any Tenant still pins the version | [`refused`](/code/api/errors/refused) | Clear what the check names, then call it again. | None. |
| `interface` is missing, or is not a interface | [`invalid-input`](/code/api/errors/invalid-input) | Send `interface` as a interface, then call it again. | None. |
| `version` is missing, or is not a string | [`invalid-input`](/code/api/errors/invalid-input) | Send `version` as a string, then call it again. | None. |
| The `Idempotency-Key` was sent before with another operation or other input | [`idempotency-mismatch`](/code/api/errors/idempotency-mismatch) | Send a new key for new input; reuse a key only to retry the same request. | None. |

**Example**

```bash
npx startup-builder do Interface.sunset --data '{"interface":"interface_TMyQ3kh9uX","version":"Example version"}' \
  --idempotency-key leaseline-interface-sunset-1
```