# Tasks

List, create and change the tasks your team logs time under. Tasks are shared by projects. New tasks join the standard list.

HTML version: https://t.momentic.studio/docs/api/tasks

## Endpoints

- `GET /api/v2/tasks`: [List tasks](https://t.momentic.studio/docs/api/tasks#get-tasks)
- `GET /api/v2/tasks/{task_id}`: [Retrieve a task](https://t.momentic.studio/docs/api/tasks#get-tasks-task-id)
- `POST /api/v2/tasks`: [Create a task](https://t.momentic.studio/docs/api/tasks#post-tasks)
- `PATCH /api/v2/tasks/{task_id}`: [Update a task](https://t.momentic.studio/docs/api/tasks#patch-tasks-task-id)
- `DELETE /api/v2/tasks/{task_id}`: [Delete a task](https://t.momentic.studio/docs/api/tasks#delete-tasks-task-id)

## List tasks

`GET /api/v2/tasks`

Supported with differences. Scope: `reports:read`.

default_hourly_rate is 0. A member is refused (403).

Query parameters:

| Name            | Type     | Required | Description                                                                                                    |
| --------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| `is_active`     | boolean  | no       | true for active records only, false for archived only. Another value is ignored, as in Harvest.                |
| `updated_since` | datetime | no       | Only records changed at or after this ISO 8601 date-time. A value that is not a date-time is refused with 400. |
| `page`          | integer  | no       | The page to return, from 1. Default 1. A page past the end returns no records.                                 |
| `per_page`      | integer  | no       | Records per page, 1 to 2000. Default 2000. Another value is refused with 400.                                  |

Returns 200 with a page of task objects under `tasks`.

Example request:

```bash
curl "https://t.momentic.studio/api/v2/tasks" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)"
```

Example response, status 200:

```json
{
  "tasks": [
    {
      "id": 4001,
      "name": "Design",
      "billable_by_default": true,
      "default_hourly_rate": null,
      "is_default": true,
      "is_active": true,
      "created_at": "2026-01-05T15:00:00Z",
      "updated_at": "2026-01-05T15:00:00Z"
    }
  ],
  "per_page": 2000,
  "total_pages": 1,
  "total_entries": 1,
  "next_page": null,
  "previous_page": null,
  "page": 1,
  "links": {
    "first": "https://t.momentic.studio/api/v2/tasks?page=1&per_page=2000&ref=first",
    "next": null,
    "previous": null,
    "last": "https://t.momentic.studio/api/v2/tasks?page=1&per_page=2000&ref=last"
  }
}
```

## Retrieve a task

`GET /api/v2/tasks/{task_id}`

Supported with differences. Scope: `reports:read`.

Returns 200 with a task object.

Example request:

```bash
curl "https://t.momentic.studio/api/v2/tasks/4001" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)"
```

Example response, status 200:

```json
{
  "id": 4001,
  "name": "Design",
  "billable_by_default": true,
  "default_hourly_rate": null,
  "is_default": true,
  "is_active": true,
  "created_at": "2026-01-05T15:00:00Z",
  "updated_at": "2026-01-05T15:00:00Z"
}
```

## Create a task

`POST /api/v2/tasks`

Supported with differences. Scope: `projects:write`.

default_hourly_rate is ignored.

Body, as JSON or form fields:

| Name                  | Type    | Required | Description                   |
| --------------------- | ------- | -------- | ----------------------------- |
| `name`                | string  | yes      | The task's name.              |
| `billable_by_default` | boolean | no       | Default true.                 |
| `is_default`          | boolean | no       | true adds it to new projects. |
| `is_active`           | boolean | no       | false creates it archived.    |

Returns 201 with a task object.

Example request:

```bash
curl -X POST "https://t.momentic.studio/api/v2/tasks" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)" \
  -H "Content-Type: application/json" \
  -d '{"name":"Example Client"}'
```

Example response, status 201:

```json
{
  "id": 4001,
  "name": "Design",
  "billable_by_default": true,
  "default_hourly_rate": null,
  "is_default": true,
  "is_active": true,
  "created_at": "2026-01-05T15:00:00Z",
  "updated_at": "2026-01-05T15:00:00Z"
}
```

## Update a task

`PATCH /api/v2/tasks/{task_id}`

Supported with differences. Scope: `projects:write`.

Body, as JSON or form fields:

| Name                  | Type    | Required | Description                                 |
| --------------------- | ------- | -------- | ------------------------------------------- |
| `name`                | string  | no       | The task's name.                            |
| `billable_by_default` | boolean | no       | Whether new project time on it is billable. |
| `is_default`          | boolean | no       | true adds it to new projects.               |
| `is_active`           | boolean | no       | false archives it; true restores it.        |

Returns 200 with a task object.

Example request:

```bash
curl -X PATCH "https://t.momentic.studio/api/v2/tasks/4001" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)"
```

Example response, status 200:

```json
{
  "id": 4001,
  "name": "Design",
  "billable_by_default": true,
  "default_hourly_rate": null,
  "is_default": true,
  "is_active": true,
  "created_at": "2026-01-05T15:00:00Z",
  "updated_at": "2026-01-05T15:00:00Z"
}
```

## Delete a task

`DELETE /api/v2/tasks/{task_id}`

Not supported. Scope: `projects:write`.

Archive with is_active false. Deleting tasks is not offered by the app.

Returns 200 with no body.

Example request:

```bash
curl -X DELETE "https://t.momentic.studio/api/v2/tasks/4001" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Harvest-Account-Id: $ACCOUNT_ID" \
  -H "User-Agent: MyApp (admin@example.com)"
```

## The task object

| Field                 | Type           | Description                                                                                                           |
| --------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------- |
| `id`                  | integer        | The task's id.                                                                                                        |
| `name`                | string         | The task's name.                                                                                                      |
| `billable_by_default` | boolean        | Whether time on the task is billable when a project adds it.                                                          |
| `default_hourly_rate` | number or null | Null: rates are set on people and projects, not tasks. The time tracker has no such data, so this is the empty value. |
| `is_default`          | boolean        | True when the task is on the standard list or is added to new projects.                                               |
| `is_active`           | boolean        | False when the task is archived.                                                                                      |
| `created_at`          | datetime       | When the record was created.                                                                                          |
| `updated_at`          | datetime       | When the record was last changed.                                                                                     |
