# Incident routes: create, get

URL: /code/api/incident/records · Id: `page:code/api/incident/records`

> The Incident Verbs create, get as api.sb routes, with inputs, result, refusals and an example.

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

### Incident.create
Creates an Incident. [Verb page](/business/nouns/incident/create?interface=api).

```text
POST /{namespace}/incidents
```

Body, as JSON: the inputs. Emits `Incident.created`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `by` | [Worker](/business/nouns/worker) | No | The Worker that performed it. |
| `for` | [Party](/business/nouns/party) | No | The Party it was done on behalf of. |
| `via` | `string` | No | The Interface or request it arrived through. |
| `on` | `string` | No | The Action or Event that caused it, such as the failed attempt a retry follows. |
| `thing` | `string` | No | The record, at the Version the Action was decided against. |
| `input` | `json` | No | The input it was called with. |
| `createdAt` | `datetime` | No | When it was called. |
| `reserved` | `money` | No | The most this Action may cost, held against its Limits from the check until it settles, billed misses included. |
| `due` | `datetime` | No | When the Task is due. |
| `priority` | `integer` | No | Its rank in the inbox, highest first. |
| `recurrence` | `string` | No | The schedule a recurring duty repeats on. |
| `kind` | `string` | No | One of `bug`, `request`, or `question`. |
| `advisory` | `string` | No | For a vulnerability: the public advisory it matches, with the affected package and range. |
| `severity` | `string` | Yes | One of `minor`, `major`, or `critical`. |
| `detectedAt` | `datetime` | Yes | When monitoring or a Customer first reported it. |
| `resolvedAt` | `datetime` | No | When service was restored. |
| `personalData` | `boolean` | No | True when the Incident exposed personal data, which starts the breach-notice clock. |
| `monitor` | [Monitor](/business/nouns/monitor) | No | A failing internal Monitor opens an Incident, which names the Monitor that saw it first. |

**Returns**

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

**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 POST https://api.sb/leaseline.app/incidents \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"severity":"minor","detectedAt":"2026-10-22T12:00:00Z"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "incident": {
    "$id": "https://api.sb/leaseline.app/incidents/incident_2XOYkIEno0",
    "$type": "Incident",
    "status": "pending",
    "mode": "try",
    "severity": "minor",
    "detectedAt": "2026-10-22T12:00:00Z"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Incident.create",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

### Incident.get
Returns one Incident by id. [Verb page](/business/nouns/incident/get?interface=api).

```text
GET /{namespace}/incidents/{id}
```

Path: `id`. Query: the other inputs. Reads only: it emits no Event.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Incident. |
| `at` | `string` | No | A time or Version name: the record as it stood then. Unset: as it stands now. |

**Returns**

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

**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 https://api.sb/leaseline.app/incidents/incident_2XOYkIEno0 \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "$type": "Incident",
  "$id": "https://api.sb/leaseline.app/incidents/incident_2XOYkIEno0",
  "incident": {
    "$id": "https://api.sb/leaseline.app/incidents/incident_2XOYkIEno0",
    "$type": "Incident",
    "status": "pending",
    "mode": "try",
    "severity": "minor",
    "detectedAt": "2026-10-22T12:00:00Z"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/incidents/incident_2XOYkIEno0",
    "up": "https://api.sb/leaseline.app/incidents"
  },
  "actions": {
    "acknowledge": "https://api.sb/leaseline.app/incidents/incident_2XOYkIEno0/acknowledge",
    "resolve": "https://api.sb/leaseline.app/incidents/incident_2XOYkIEno0/resolve"
  }
}
```