# Partner routes: update, delete

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

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

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

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

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

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

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Partner. |
| `name` | `string` | No | The name it trades under. |
| `hostname` | `string` | No | The web domain that keys it. |
| `side` | `string` | No | One of `supply`, `distribution`, or `both`. |

**Returns**

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

**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/partners/partner_YcEOEgSexq \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"side":"supply"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "partner": {
    "$id": "https://api.sb/leaseline.app/partners/partner_YcEOEgSexq",
    "$type": "Partner",
    "name": "Leaseline",
    "side": "supply"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Partner.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

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

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

Path: `id`. Emits `Partner.deleted`.

**Inputs**

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

**Returns**

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

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

```json
{
  "api": "https://api.sb/leaseline.app",
  "partner": {
    "$id": "https://api.sb/leaseline.app/partners/partner_YcEOEgSexq",
    "$type": "Partner",
    "name": "Leaseline",
    "side": "supply"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Partner.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```