# Mandate routes: update, delete

URL: /code/api/mandate/records-update · Id: `page:code/api/mandate/records-update`

> The Mandate Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.

Reference for [Mandate](/business/nouns/mandate), one group of [Mandate routes](/code/api/mandate).

### Mandate.update
Changes the given properties of a Mandate. [Verb page](/business/nouns/mandate/update?interface=api).

```text
PATCH /{namespace}/mandates/{id}
```

Path: `id`. Body, as JSON: the other inputs. Emits `Mandate.updated`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Mandate. |
| `expiresAt` | `datetime` | No | When it lapses. |
| `limit` | [Limit](/business/nouns/limit) | No | The Limit that bounds it. |
| `verb` | `string` | No | The Verb it covers, as `Noun.verb`. |
| `topics` | `string[]` | No | What it may act on; an Action outside them becomes an Approval. |
| `channels` | list of [Channel](/business/nouns/channel) | No | The Channels it may send through. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `mandate` | [Mandate](/business/nouns/mandate) | Yes | The Mandate. |

**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. |

**Example**

```bash
curl -X PATCH https://api.sb/leaseline.app/mandates/mandate_mKKPrmFQYD \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"expiresAt":"2026-10-22T12:00:00Z"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "mandate": {
    "$id": "https://api.sb/leaseline.app/mandates/mandate_mKKPrmFQYD",
    "$type": "Mandate",
    "expiresAt": "2026-10-22T12:00:00Z",
    "status": "active"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Mandate.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

### Mandate.delete
Deletes a Mandate: a soft delete that keeps its history, undone by `Thing.restore`. [Verb page](/business/nouns/mandate/delete?interface=api).

```text
DELETE /{namespace}/mandates/{id}
```

Path: `id`. Emits `Mandate.deleted`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Mandate. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `mandate` | [Mandate](/business/nouns/mandate) | Yes | The Mandate. |

**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. |

**Example**

```bash
curl -X DELETE https://api.sb/leaseline.app/mandates/mandate_mKKPrmFQYD \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "mandate": {
    "$id": "https://api.sb/leaseline.app/mandates/mandate_mKKPrmFQYD",
    "$type": "Mandate",
    "expiresAt": "2026-10-22T12:00:00Z",
    "status": "active"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Mandate.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```