# Software routes: update, delete

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

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

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

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

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

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

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Software. |
| `name` | `string` | No | The name of the Product. |
| `promise` | `text` | No | What the Customer can rely on. |
| `headless` | `boolean` | No | True when it ships without screens of its own. |

**Returns**

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

**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/software/software_D5qhJn6mF5 \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"headless":true}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "software": {
    "$id": "https://api.sb/leaseline.app/software/software_D5qhJn6mF5",
    "$type": "Software",
    "name": "Leaseline",
    "promise": "No renewal slips past its date.",
    "status": "draft",
    "headless": true
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Software.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

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

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

Path: `id`. Emits `Software.deleted`.

**Inputs**

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

**Returns**

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

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

```json
{
  "api": "https://api.sb/leaseline.app",
  "software": {
    "$id": "https://api.sb/leaseline.app/software/software_D5qhJn6mF5",
    "$type": "Software",
    "name": "Leaseline",
    "promise": "No renewal slips past its date.",
    "status": "draft"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Software.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```