# Availability methods: update, delete

URL: /code/sdk/availability/records-update · Id: `page:code/sdk/availability/records-update`

> The Availability Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.

Reference for [Availability](/business/nouns/availability), one group of [Availability methods](/code/sdk/availability).

### Availability.update
Changes the given properties of an Availability. [Verb page](/business/nouns/availability/update?interface=sdk).

```ts
interface AvailabilityVerbs {
  update(input: AvailabilityUpdateInput, options?: SB.CallOptions): SB.Call<Availability>
}
```

Emits `Availability.updated`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Availability. |
| `worker` | [Worker](/business/nouns/worker) | No | Who is booked: a Human, or an Agent that takes calls. |
| `hours` | `json` | No | Open hours by weekday, in its time zone. |
| `timezone` | `string` | No | An IANA time zone. |
| `calendars` | `string[]` | No | Connected calendars whose busy times it subtracts. |
| `buffer` | `integer` | No | Minutes kept free before and after each Meeting. |
| `notice` | `integer` | No | The fewest hours ahead a Meeting can be booked. |

**Returns**

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

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

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

const availability = await $.Availability.update({ id: 'availability_8Zj0a7vvRl', worker: 'worker_whZFpOKWIV' })
```

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

```ts
interface AvailabilityVerbs {
  delete(input: AvailabilityDeleteInput, options?: SB.CallOptions): SB.Call<Availability>
}
```

Emits `Availability.deleted`.

**Inputs**

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

**Returns**

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

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

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

const availability = await $.Availability.delete({ id: 'availability_8Zj0a7vvRl' })
```