> ## Documentation Index
> Fetch the complete documentation index at: https://trysalty.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Tasks

> To-dos. Parent is optional.

## Endpoints

| Method   | Path         | Purpose                                                                        |
| -------- | ------------ | ------------------------------------------------------------------------------ |
| `GET`    | `/tasks`     | List, paginated                                                                |
| `POST`   | `/tasks`     | Create (parent optional)                                                       |
| `GET`    | `/tasks/:id` | Fetch one                                                                      |
| `PATCH`  | `/tasks/:id` | Update — including marking complete                                            |
| `DELETE` | `/tasks/:id` | Soft-delete (moves to 30-day trash; restore via POST /trash/tasks/:id/restore) |

## Fields

| Field                | Type                                    | Notes                                      |
| -------------------- | --------------------------------------- | ------------------------------------------ |
| `id`                 | uuid                                    |                                            |
| `parent_object_type` | `person` \| `company` \| `deal` \| null | Optional                                   |
| `parent_object_id`   | uuid \| null                            | If `parent_object_type` is set, must exist |
| `title`              | string                                  | Required                                   |
| `description`        | string \| null                          |                                            |
| `status`             | string                                  | Defaults to `"open"`. Free-form            |
| `due_at`             | datetime \| null                        | ISO 8601                                   |
| `completed_at`       | datetime \| null                        | Set when the task is done                  |
| `created_at`         | datetime                                |                                            |

## Standalone task (no parent)

```bash theme={null}
curl -X POST $SALTY_API/tasks \
  -H "Authorization: Bearer $SALTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Review pipeline","due_at":"2026-06-01T09:00:00Z"}'
```

## Task on a deal

```bash theme={null}
curl -X POST $SALTY_API/tasks \
  -H "Authorization: Bearer $SALTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Send proposal",
    "parent_object_type": "deal",
    "parent_object_id": "<deal-uuid>",
    "due_at": "2026-06-01T09:00:00Z"
  }'
```

## Mark complete

```bash theme={null}
curl -X PATCH $SALTY_API/tasks/<id> \
  -H "Authorization: Bearer $SALTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"done","completed_at":"2026-05-25T10:00:00Z"}'
```
