# create

URL: /business/nouns/availability/create · Id: `verb:Availability.create` · Call: `await $.Availability.create({ … })` (SDK) or the `do` tool at `https://api.sb/mcp`. Inputs says what to pass, Outputs what returns, When it waits who approves.

> Creates an Availability.

Create makes a new [Availability](/business/nouns/availability) from the inputs below. It is inherited: every [Noun](/business/nouns/noun) has `get`, `list`, `create`, `update` and `delete`.

## Inputs
| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `worker` | [Worker](/business/nouns/worker) | Yes | Who is booked: a Human, or an Agent that takes calls. |
| `hours` | `json` | Yes | Open hours by weekday, in its time zone. |
| `timezone` | `string` | Yes | 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. |

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

## Effects
| Fact | Value |
| --- | --- |
| Action class | None: it runs within its seat's Limits |
| Door | Two-way: it runs at once |
| Modes | `try` previews it and stores nothing; `send` returns a pending Action; `do` (default) waits for the result |
| Idempotent | With a key: a repeat with the same `Idempotency-Key` returns the first Action, and a repeat without one runs again |
| Undo | [Action.undo](/business/nouns/action/undo) reverses it |
| Emits | `Availability.created` |

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

## When it waits
| Gate | Default |
| --- | --- |
| Decision class | Low: two-way, nothing at stake |
| [Delay window](/systems/trust-and-governance/controls/one-way-windows) | None: it runs once review passes. |
| Limit | The call [Limit](/business/nouns/limit) of the [Permission](/business/nouns/permission) it runs under. |
| Over the Limit | It waits `pending` for an [Approval](/business/nouns/approval) from the [Founder](/agents/founding/founder). Approved, it runs; refused, it ends `refused` with [`limit-exceeded`](/code/api/errors/limit-exceeded); unanswered by its deadline, it ends `canceled`. |

## Example

**Ask**

```text
Add an availability to Leaseline with a worker.
```

**API**

```bash
curl -X POST https://api.sb/leaseline.app/availabilities \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"worker":"worker_whZFpOKWIV","hours":{"mon":["09:00-12:00"],"thu":["13:00-17:00"]},"timezone":"America/Chicago"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "availability": {
    "$id": "https://api.sb/leaseline.app/availabilities/availability_8Zj0a7vvRl",
    "$type": "Availability",
    "worker": "worker_whZFpOKWIV",
    "hours": {
      "mon": [
        "09:00-12:00"
      ],
      "thu": [
        "13:00-17:00"
      ]
    },
    "timezone": "America/Chicago"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Availability.create",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

**SDK**

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

const availability = await $.Availability.create({ worker: 'worker_whZFpOKWIV', hours: { mon: ['09:00-12:00'], thu: ['13:00-17:00'] }, timezone: 'America/Chicago' })
```

**CLI**

```bash
npx startup-builder do Availability.create --json '{"worker":"worker_whZFpOKWIV","hours":{"mon":["09:00-12:00"],"thu":["13:00-17:00"]},"timezone":"America/Chicago"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Availability.create({ worker: 'worker_whZFpOKWIV', hours: { mon: ['09:00-12:00'], thu: ['13:00-17:00'] }, timezone: 'America/Chicago' })"
  }
}
```