# Project routes: update, delete

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

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

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

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

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

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

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Project. |
| `startsOn` | `date` | No | When work begins. |
| `targetDate` | `date` | No | When it should be done. |

**Returns**

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

**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/projects/project_pUWTSQuuUM \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"startsOn":"2026-10-22"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "project": {
    "$id": "https://api.sb/leaseline.app/projects/project_pUWTSQuuUM",
    "$type": "Project",
    "startsOn": "2026-10-22",
    "targetDate": "2026-10-22"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Project.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

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

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

Path: `id`. Emits `Project.deleted`.

**Inputs**

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

**Returns**

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

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

```json
{
  "api": "https://api.sb/leaseline.app",
  "project": {
    "$id": "https://api.sb/leaseline.app/projects/project_pUWTSQuuUM",
    "$type": "Project",
    "startsOn": "2026-10-22",
    "targetDate": "2026-10-22"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Project.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```