# Waitlist routes: update, delete

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

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

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

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

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

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

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Waitlist. |
| `invited` | `integer` | No | How many Leads have been invited. |
| `rank` | `string` | No | The invite order: first come, best ICP fit, or most referrals first. |

**Returns**

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

**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/waitlists/waitlist_rBixb72HGB \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"invited":1}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "waitlist": {
    "$id": "https://api.sb/leaseline.app/waitlists/waitlist_rBixb72HGB",
    "$type": "Waitlist",
    "invited": 1,
    "rank": "signup"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Waitlist.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

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

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

Path: `id`. Emits `Waitlist.deleted`.

**Inputs**

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

**Returns**

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

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

```json
{
  "api": "https://api.sb/leaseline.app",
  "waitlist": {
    "$id": "https://api.sb/leaseline.app/waitlists/waitlist_rBixb72HGB",
    "$type": "Waitlist",
    "invited": 1,
    "rank": "signup"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Waitlist.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```