# Implementation routes: update, delete

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

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

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

### Implementation.update
Changes the given properties of an Implementation. [Verb page](/business/nouns/implementation/update?interface=api).

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

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

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Implementation. |
| `kind` | `string` | No | One of `managed`, `custom`, or `external`. |
| `endpoint` | `url` | No | For an external Implementation, where api.sb routes each call. |
| `deliverBy` | `date` | No | For a `declared` Implementation: when a Function runs the Verb; a missed date refunds every reserve. |

**Returns**

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

**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/implementations/implementation_gnulUgZJ7A \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind":"managed"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "implementation": {
    "$id": "https://api.sb/leaseline.app/implementations/implementation_gnulUgZJ7A",
    "$type": "Implementation",
    "kind": "managed"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Implementation.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

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

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

Path: `id`. Emits `Implementation.deleted`.

**Inputs**

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

**Returns**

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

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

```json
{
  "api": "https://api.sb/leaseline.app",
  "implementation": {
    "$id": "https://api.sb/leaseline.app/implementations/implementation_gnulUgZJ7A",
    "$type": "Implementation",
    "kind": "managed"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Implementation.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```