# Startup routes: update, delete

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

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

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

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

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

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

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Startup. |
| `name` | `string` | No | The name the Startup trades under. |
| `domain` | `url` | No | The canonical hostname of the Startup. |
| `launchedAt` | `datetime` | No | When the Startup went live. |
| `template` | `string` | No | The slug of the template it extends; the root one when none is named. |
| `idea` | `text` | No | The Idea it starts from, in a sentence, recorded as its Idea. |
| `spendState` | `string` | No | How freely money Limits allow spend: `free`, `tight` (discretionary Limits halved) or `hold` (one-way spend stops). |

**Returns**

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

**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/startups/startup_l3hr1EnUGY \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Leaseline"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "startup": {
    "$id": "https://api.sb/leaseline.app/startups/startup_l3hr1EnUGY",
    "$type": "Startup",
    "name": "Leaseline"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Startup.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

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

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

Path: `id`. Emits `Startup.deleted`.

**Inputs**

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

**Returns**

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

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

```json
{
  "api": "https://api.sb/leaseline.app",
  "startup": {
    "$id": "https://api.sb/leaseline.app/startups/startup_l3hr1EnUGY",
    "$type": "Startup",
    "name": "Leaseline"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Startup.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```