# Renewal routes: update, delete

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

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

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

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

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

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

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Renewal. |
| `value` | `money` | No | What the Deal is worth if won. |
| `owner` | [Worker](/business/nouns/worker) | No | The Worker who runs it. |
| `closesOn` | `date` | No | The date the buyer expects to decide. |
| `nextStep` | `text` | No | The next dated step agreed with the buyer. |
| `termEndsAt` | `datetime` | No | When the current term ends, read from the Subscription. |
| `openedAt` | `datetime` | No | When it opened: by default 90 days before the term ends. |
| `usageReview` | `text` | No | Usage against each Entitlement over the term, written before any Quote. |
| `noticeSentAt` | `datetime` | No | When the renewal notice the legal floor requires went out, with the date, Price and cancel link. |
| `saveOffer` | `text` | No | The one save offer shown on cancel; it never blocks the cancel. |

**Returns**

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

**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/renewals/renewal_NrJC9bDcII \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"termEndsAt":"2026-10-22T12:00:00Z"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "renewal": {
    "$id": "https://api.sb/leaseline.app/renewals/renewal_NrJC9bDcII",
    "$type": "Renewal",
    "status": "Open",
    "termEndsAt": "2026-10-22T12:00:00Z",
    "openedAt": "2026-10-22T12:00:00Z"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Renewal.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

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

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

Path: `id`. Emits `Renewal.deleted`.

**Inputs**

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

**Returns**

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

**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/renewals/renewal_NrJC9bDcII \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "renewal": {
    "$id": "https://api.sb/leaseline.app/renewals/renewal_NrJC9bDcII",
    "$type": "Renewal",
    "status": "Open",
    "termEndsAt": "2026-10-22T12:00:00Z",
    "openedAt": "2026-10-22T12:00:00Z"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Renewal.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```