> For the complete documentation index, see [llms.txt](https://docs.cubicl.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cubicl.io/api-integration/tasks.md).

# Tasks

Definitions of the types and formats of the data used in the endpoints can be found at the bottom of the page.

## Endpoints

### Get Tasks

<mark style="color:blue;">`GET`</mark> `https://cubicl.io/api/v1/tasks`

Gets tasks matching the given search criteria. Some details won't be returned in the response. Use Get Task By Id to get all details.

**Query Parameters**

| Name             | Type   | Description                                                                                                                                                                                     |
| ---------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| group            | string | Project ID. If omitted, accessible tasks across the organization. If set, the project must exist and `viewAll` permission is required.                                                          |
| assignee         | string | Assignee ID                                                                                                                                                                                     |
| assignedBy       | string | Task owner ID                                                                                                                                                                                   |
| customer         | string | Client ID                                                                                                                                                                                       |
| tag              | string | Tag **ID**                                                                                                                                                                                      |
| startDate        | number | Task start date in Unix seconds. Required together with `endDate`.                                                                                                                              |
| endDate          | number | Task end date in Unix seconds. Required if `startDate` is set.                                                                                                                                  |
| archived         | string | `true`: archived. `false`: not archived. `all`: both. Default: `false`.                                                                                                                         |
| completed        | string | `true`: tasks with `completedAt` set. `false`: all tasks.                                                                                                                                       |
| search           | string | Text to search in the task name                                                                                                                                                                 |
| trackingNumber   | string | Only used together with `search`. Does not filter on its own. Use with `search` to find support-request or email tasks by tracking number. Example: `{ search: "#601", trackingNumber: "601" }` |
| recursive        | string | `true`: include child projects. Leave empty for the given project only. Default: `false`.                                                                                                       |
| state            | string | State name                                                                                                                                                                                      |
| unassigned       | string | `true`: tasks with no assignee                                                                                                                                                                  |
| supportRequest   | string | `true`: support-request or email tasks                                                                                                                                                          |
| hideSubtasks     | string | `true`: tasks with no `parent`                                                                                                                                                                  |
| completedAtStart | number | `completedAt` greater than this instant                                                                                                                                                         |
| completedAtEnd   | number | `completedAt` less than or equal to this instant                                                                                                                                                |
| createdAtStart   | number | `createdAt` greater than this instant                                                                                                                                                           |
| createdAtEnd     | number | `createdAt` less than or equal to this instant                                                                                                                                                  |
| archivedAtStart  | number | `archivedAt` greater than this instant                                                                                                                                                          |
| archivedAtEnd    | number | `archivedAt` less than or equal to this instant                                                                                                                                                 |
| startedAtStart   | number | `start` greater than this instant                                                                                                                                                               |
| startedAtEnd     | number | `start` less than or equal to this instant                                                                                                                                                      |
| deadlineStart    | number | `deadline` greater than this instant                                                                                                                                                            |
| deadlineEnd      | number | `deadline` less than or equal to this instant                                                                                                                                                   |
| skip             | number |                                                                                                                                                                                                 |
| limit            | number |                                                                                                                                                                                                 |
| orderBy          | string | Sort field. `_id`, `name`, `createdAt`, or `priority`. Used with `orderDirection`.                                                                                                              |
| orderDirection   | string | `asc` or `desc`                                                                                                                                                                                 |
| include          | string | Comma-separated fields to include                                                                                                                                                               |
| exclude          | string | Comma-separated fields to exclude. Cannot be used with `include`.                                                                                                                               |

{% tabs %}
{% tab title="200: OK List of tasks" %}

```typescript
Task[]
```

{% endtab %}

{% tab title="403: Forbidden You don't have the permission to get tasks." %}

```javascript
{ code: 4 }
```

{% endtab %}
{% endtabs %}

### Get Tasks By IDs

<mark style="color:green;">`POST`</mark> `https://cubicl.io/api/v1/tasks/by-ids`

Returns tasks for the given IDs. POST is used because the ID list can exceed URL length limits.

If `recursive` is `"true"`, subtasks of each task are included in the response.

`include` and `exclude` must not be used together. These fields must be **arrays**, not comma-separated strings.

**Request Body**

| Name                                        | Type      | Description                                                |
| ------------------------------------------- | --------- | ---------------------------------------------------------- |
| taskIds<mark style="color:red;">\*</mark>   | string\[] | List of task IDs                                           |
| recursive<mark style="color:red;">\*</mark> | string    | `"true"`: include subtasks. `"false"`: only the given IDs. |
| include                                     | string\[] | Field names to include                                     |
| exclude                                     | string\[] | Field names to exclude. Cannot be used with `include`.     |

{% tabs %}
{% tab title="200: OK List of tasks" %}

```typescript
Task[]
```

{% endtab %}
{% endtabs %}

### Get Task By Id

<mark style="color:blue;">`GET`</mark> `https://cubicl.io/api/v1/tasks/:id`

Returns the task with the given ID.

**Path Parameters**

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | string | Task ID     |

**Query Parameters**

| Name      | Type   | Description                                                                                                                        |
| --------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| fetch     | string | Comma-separated extra data. Examples: `parent`, `subtasks`                                                                         |
| onlyNames | string | `true`: return a subset of fields (`name`, `org`, `group`, `assignees`, `assignedBy`, `followers`). `false` or omitted: full task. |

{% tabs %}
{% tab title="200: OK Task details" %}

```javascript
Task
```

{% endtab %}

{% tab title="403: Forbidden You don't have the permission to get the task." %}

```javascript
{ code: 4 }
```

{% endtab %}

{% tab title="404: Not Found Task not found" %}

{% endtab %}
{% endtabs %}

### Create Task

<mark style="color:green;">`POST`</mark> `https://cubicl.io/api/v1/tasks`

#### Request Body

| Name                                    | Type                     | Description                                                                                                                                                                                                                                        |
| --------------------------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| group<mark style="color:red;">\*</mark> | string                   | Project id                                                                                                                                                                                                                                         |
| workFlowId                              | string                   | Set when task is being created with a workflow.                                                                                                                                                                                                    |
| parent                                  | string                   | Parent task id. Set when task is being created a subtask of another task.                                                                                                                                                                          |
| private                                 | boolean                  | Default is false                                                                                                                                                                                                                                   |
| recurrence                              | Recurrence               | If 'recurrent' is true, this should be set. Check below for recurrence details.                                                                                                                                                                    |
| recurrent                               | boolean                  | Default is false.                                                                                                                                                                                                                                  |
| steps                                   | CheckList \| ProgressBar | <p>If 'stepType' is 'steps', provide steps in CheckList format. Id field is not required. It will be set in the server.</p><p>If 'stepType' is 'progress', provide steps in ProgressBar format.</p><p>If 'stepType' is 'none', don't set this.</p> |
| stepType                                | string                   | <p>'none' for no task steps</p><p>'steps' for checklist</p><p>'progress' for progress bar</p><p>Default is 'none'</p>                                                                                                                              |
| files                                   | string\[]                | List of file ids. In order to create a file with files, you need to upload files before creating the task and set their ids here.                                                                                                                  |
| customer                                | string                   | Client id                                                                                                                                                                                                                                          |
| tags                                    | string\[]                | Tag ids                                                                                                                                                                                                                                            |
| priority                                | number                   | 1 to 5. 5 is highest. Default is 3.                                                                                                                                                                                                                |
| assignees                               | string\[]                | List of assignee ids                                                                                                                                                                                                                               |
| deadline                                | number                   |                                                                                                                                                                                                                                                    |
| start                                   | number                   | Start date                                                                                                                                                                                                                                         |
| desc                                    | string                   | Task description                                                                                                                                                                                                                                   |
| name<mark style="color:red;">\*</mark>  | string                   | Task name                                                                                                                                                                                                                                          |
| state                                   | string                   | State name. If not given, default state set in the project details will be used.                                                                                                                                                                   |
| estimatedTime                           | number                   | Estimated time of the task in seconds. Shown in the UI only when enabled in the project settings.                                                                                                                                                  |
| customFields                            | object                   | An object where keys are the custom field names and values are the values of those fields.                                                                                                                                                         |
| followers                               | string\[]                | Ids of task followers. If not set, task owner and assignees will be followers.                                                                                                                                                                     |

{% tabs %}
{% tab title="200: OK New task details" %}

```javascript
Task
```

{% endtab %}

{% tab title="422: Unprocessable Entity Invalid operation" %}

<pre class="language-javascript"><code class="lang-javascript"><strong>// Empty response
</strong><strong>// Potential causes:
</strong><strong>// - Invalid project
</strong><strong>// - Invalid parent task
</strong></code></pre>

{% endtab %}

{% tab title="403: Forbidden You don't have the permission" %}

```javascript
{ code: 4 }
```

{% endtab %}

{% tab title="422: Unprocessable Entity Task state does not exists" %}

```javascript
{ code: 503 }
```

{% endtab %}
{% endtabs %}

### Update Task

<mark style="color:orange;">`PUT`</mark> `https://cubicl.io/api/v1/tasks/:id`

Updates a task with given details. All details are optional. Only given fields are updated. If you need to unset a field, set its values to null or appropriate falsy value. For example, an empty string for strings.

#### Path Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | string | Task id     |

#### Request Body

| Name           | Type                     | Description                                                                                                                                      |
| -------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| assignees      | string\[]                | Assignee id list                                                                                                                                 |
| followers      | string\[]                | Follower id list                                                                                                                                 |
| customer       | string                   | Client id                                                                                                                                        |
| deadline       | number                   | Deadline                                                                                                                                         |
| desc           | string                   | Description                                                                                                                                      |
| group          | string                   | The project id to which the task is to be moved                                                                                                  |
| files          | string\[]                | File id list                                                                                                                                     |
| recurrent      | boolean                  | Boolean                                                                                                                                          |
| recurrence     | Recurrence               | Task recurrence details                                                                                                                          |
| name           | string                   | Task name                                                                                                                                        |
| workflowId     | string                   | Workflow id                                                                                                                                      |
| start          | number                   | Start date                                                                                                                                       |
| steps          | Checklist \| ProgressBar | Required when 'stepType' is 'steps' or 'progress'                                                                                                |
| stepType       | string                   | 'none', 'steps' or 'progress'                                                                                                                    |
| private        | boolean                  |                                                                                                                                                  |
| state          | string                   | Task state name. Required when moving the task to a different project and changing to a different state within that project.                     |
| subtasks       | string\[]                | Subtask id list                                                                                                                                  |
| estimatedTime  | number                   | Estimated task duration in seconds                                                                                                               |
| customFields   | object                   | An object where keys are field names and values are field values.                                                                                |
| updateTemplate | boolean                  | If task is recurrent this field will determine whether to update the details only on the task itself or including the future copies of the task. |

{% tabs %}
{% tab title="200: OK Updated task details and task update activity" %}

```javascript
{
    activity: TaskActivity,
    task: Task
}
```

{% endtab %}

{% tab title="403: Forbidden You don't have the permission" %}

```javascript
{
    // 4: No permission to update task details
    // 804: No permission to move the task out of the project
    // 805: No permission to move the task into the project
    code: number
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity Invalid operation" %}

```javascript
// Following object or empty response for unknown error
{
    // 403: This update changes the Gantt Chart and you have no permission for that
    // 406: Task in the Gantt Chart must have dates.
    // 503: Task state does not exist
    // 604: Archived tasks cannot be updated
    code: number
}
```

{% endtab %}
{% endtabs %}

### Delete Task

<mark style="color:red;">`DELETE`</mark> `https://cubicl.io/api/v1/tasks/:id`

Deletes the task with given id.

#### Path Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | string | Task id     |

{% tabs %}
{% tab title="200: OK Empty response" %}

```javascript
```

{% endtab %}

{% tab title="403: Forbidden You don't have the permission." %}

```javascript
{ code: 4 }
```

{% endtab %}

{% tab title="422: Unprocessable Entity Invalid operation" %}

```javascript
// Following object or empty response for unknown error
{
    // 4: This operation requires to delete subtasks but you have no permission for that
    // 403: This update changes the Gantt Chart and you have no permission for that
    code: number
}
```

{% endtab %}
{% endtabs %}

### Add Subtask to Task

<mark style="color:green;">`POST`</mark> `https://cubicl.io/api/v1/tasks/:id/subtasks`

#### Path Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | string | Task ID     |

#### Request Body

| Name                                      | Type   | Description                                  |
| ----------------------------------------- | ------ | -------------------------------------------- |
| subtask<mark style="color:red;">\*</mark> | string | The ID of the task to be added as a subtask. |

{% tabs %}
{% tab title="200: OK Empty response" %}

```javascript
```

{% endtab %}

{% tab title="403: Forbidden You don't have the permission." %}

```javascript
{ code: 4 }
```

{% endtab %}

{% tab title="422: Unprocessable Entity A task higher in the hierarchy cannot be added as a subtask." %}

```javascript
{ code: 802 }
```

{% endtab %}
{% endtabs %}

### Update Task State

<mark style="color:orange;">`PUT`</mark> `https://cubicl.io/api/v1/tasks/:id/state`

Changes the state of a task to the given state. The default states for a project are Pending, Active, Completed, and Suspended. These states are recorded in the system as `cb_waiting`, `cb_active`, `cb_completed`, and `cb_suspended`, respectively. When using default states, the recorded values must be sent.

#### Path Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | string | Task id     |

#### Request Body

| Name                                    | Type   | Description          |
| --------------------------------------- | ------ | -------------------- |
| value<mark style="color:red;">\*</mark> | string | New task state name. |

{% tabs %}
{% tab title="200: OK Task State Activity" %}

```javascript
TaskStateActivity
```

{% endtab %}

{% tab title="403: Forbidden You don't have the permission" %}

```javascript
{ code: 4 }
```

{% endtab %}

{% tab title="422: Unprocessable Entity Task state does not exists" %}

```javascript
{ code: 503 }
```

{% endtab %}

{% tab title="422: Unprocessable Entity Invalid operation" %}

```javascript
// Error message
// Potential causes:
// - Archived tasks cannot have their state updated.
// - The task is already in the desired state.
```

{% endtab %}
{% endtabs %}

### Create Task Comment

<mark style="color:green;">`POST`</mark> `https://cubicl.io/api/v1/tasks/:id/activities`

Creates a comment on a task.

#### Path Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | string | Task ID     |

#### Request Body

| Name      | Type       | Description                                                                                                                                                                                 |
| --------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| content   | string     | The content of the comment. Either 'content' or 'fileIds' must be provided.                                                                                                                 |
| fileIds   | string\[]  | List of file IDs. In order to create a comment with files, you need to upload the files before creating the comment and set their IDs here. Either 'fileIds' or 'content' must be provided. |
| mentions  | Mention\[] | List of users mentioned in the comment.                                                                                                                                                     |
| replyToId | string     | The ID of the comment you want to reply to.                                                                                                                                                 |

{% tabs %}
{% tab title="200: OK Task Activity" %}

```javascript
TaskActivity
```

{% endtab %}

{% tab title="403: Forbidden You don't have the permission." %}

```javascript
{ code: 4 }
```

{% endtab %}
{% endtabs %}

### Change Task Comment Visibility

<mark style="color:orange;">`PUT`</mark> `https://cubicl.io/api/v1/tasks/:taskId/activities/:activityId/visible`

In support requests and tasks shared with your client, you can change the visibility of your comment for your portal client. When comments in email tasks are made visible, the comment is sent as an email.

#### Path Parameters

| Name                                         | Type   | Description                                               |
| -------------------------------------------- | ------ | --------------------------------------------------------- |
| taskId<mark style="color:red;">\*</mark>     | string | Task ID                                                   |
| activityId<mark style="color:red;">\*</mark> | string | The ID of the activity whose visibility is to be changed. |

#### Request Body

| Name                                    | Type    | Description                                                                                        |
| --------------------------------------- | ------- | -------------------------------------------------------------------------------------------------- |
| value<mark style="color:red;">\*</mark> | boolean | Determines the visibility of the comment. `true` makes it visible, `false` removes the visibility. |

{% tabs %}
{% tab title="200: OK Empty response" %}

```javascript
```

{% endtab %}

{% tab title="403: Forbidden You don't have the permission." %}

```javascript
{ code: 4 }
```

{% endtab %}

{% tab title="422: Unprocessable Entity Invalid operation" %}

```javascript
// Error message
// Potential causes:
// - Only activities of type "post" can have their visibility changed.
// - Visibility can only be changed for support requests, tasks shared with customers, or email tasks.
// - The visibility of comments created by portal or email users cannot be changed.
// - The visibility of comments made visible in email tasks cannot be removed.
```

{% endtab %}
{% endtabs %}

### Get Task Activities

<mark style="color:blue;">`GET`</mark> `https://cubicl.io/api/v1/tasks/:id/activities`

#### Path Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | string | Task id     |

{% tabs %}
{% tab title="200: OK Task Activities" %}

```javascript
TaskActivity[]
```

{% endtab %}

{% tab title="403: Forbidden You don't have the permission" %}

```javascript
{ code: 4 }
```

{% endtab %}
{% endtabs %}

## Data

### Data

**Task**

Details of a task.

```typescript
type Task = {
    _id: string;
    name: string;
    desc: string;
    // Whether the description was written with the rich text editor
    descIsRichText: boolean;
    state: string;
    // Start date
    start: number | null;
    deadline: number | null;
    private: boolean;
    // Assignee IDs
    assignees: string[];
    // Owner ID
    assignedBy: string;
    followers: string[];
    // IDs of portal users who follow this task if it is shared in the client portal
    portalFollowers?: string[];
    // From 1 to 5. 5 is the highest.
    priority: number;
    // Score used to order tasks that have the same priority.
    // Lowest score is shown at the top.
    priorityScore: number;
    // Project ID
    group: string;
    // none: no steps
    // steps: checklist
    // progress: progress bar
    stepType: 'none' | 'steps' | 'progress';
    // See Task Steps below
    steps?: CheckList | ProgressBar;
    customer: {
        _id: string;
        name: string;
    } | null,
    files: {
        _id: string;
        name: string;
        size: string;
    }[];
    tags: string[];
    subtasks: string[];
    parent: string | null;
    // Some fields of all parent tasks.
    // If the task has no parent, this is the task itself.
    breadcrumbs: {
        id: string;
        name: string;
        group: string;
    }[];
    // Present if the task was created from an incoming email.
    // An ID is created for the email sender.
    email?: {
        emailUserId: string;
    };
    // Present if the task was created as a support request through the Client Portal.
    support?: {
        // Client portal user ID
        portalUser: string;
    };
    sharedWithCustomer?: boolean;
    // Present if a workflow is attached to the task
    workflowId?: string;
    workflowTaskCounts?: number;
    // Unlike workflowId, present on workflow stage tasks
    workflow?: {
        id: string;
        templateId: string;
        isCompleted: boolean;
        taskflowId: string;
    };
    // Duration in seconds
    estimatedTime?: number;
    // If the task has custom fields, name and value of each field
    customFields?: {[fieldName: string]: string};
    // If the task is recurrent, whether this is the newest copy
    lastCopy?: boolean;
    // Number assigned by the system for support-request or email tasks
    trackingNumber?: number;
    createdAt: number;
    updatedAt: number;
    completedAt: number;
    archivedAt?: number | null;
}
```

**Task Steps**

Tasks can have a checklist or a progress bar for steps / overall progress.

```typescript
type ProgressBar = {
    completed: number;
    total: number;
}

type CheckList = TaskStep[];

type TaskStep = {
    id: string;
    name: string;
    desc?: string;
    // IDs of users assigned to the step
    assignees: string[];
    // Task steps are recursive. They can have sub-steps.
    // If not set, the step has no sub-steps.
    stepType?: "steps" | "progress";
    steps?: CheckList;
    // If stepType is "progress", the total number of steps in the bar.
    // Otherwise a boolean for completion.
    completed: boolean | number;
    // Present when stepType is "progress"
    total?: number;
}
```

**Recurrence**

```typescript
type Recurrence = {
    type: "daily" | "weekly" | "monthly";
    // Example: 3 means a copy every 3 days/weeks/months.
    period: number;
    // When a new copy is created:
    // after-deadline: after the task deadline
    // completed: when the task is completed
    // on-start-date: when the task start date is reached
    createWhen: "after-deadline" | "completed" | "on-start-date";
    // If true, recurrence continues. Otherwise it is paused.
    active: boolean;
    // none: continues indefinitely
    // date: continues until the date in "end"
    // count: continues until "maxCount" copies are created.
    // The task itself is the first copy. If maxCount is 1, no copies are created.
    stopCondition: "none" | "date" | "count";
    end?: number;
    maxCount?: number;
    currentCount?: number;
    // If type is "weekly", which days of the week a copy should be created.
    // Starts on Monday.
    days?: boolean[];
    // Whether subtasks also recur
    recurSubtasks?: boolean;
}
```

**Task Activity**

Updates, progress actions, and messages on tasks create task activities.

```typescript
type TaskActivity = {
    _id: string;
    // ID of the user who created the activity
    user: string;
    // ID of the portal user. Present only when created in the Client Portal by a client.
    portalUser?: string;
    // ID of the email sender. Present when the activity was created from an incoming email.
    emailUser?: string;
    type:
        | 'post'           // A post (comment) on the task
        | 'update'         // Task was updated
        | 'progress'       // Step completed/uncompleted, or progress changed
        | 'archive'        // Task was archived
        | 'restore'        // Task was restored from the archive
        | 'state-change'   // Task state was changed
        | 'delete'         // Task was deleted
        | 'task-shared'    // Task was shared with a client
        | 'task-unshared'; // Client sharing was stopped
    // Details of the update. Shape depends on type.
    data?: Record<string, any>;
    // Comment content when type is "post"
    content?: string;
    // Whether the comment was written with the rich text editor
    contentIsRichText?: boolean;
    // File details when type is "post"
    files?: File[] = [];
    createdAt: number;
    // If this activity is a reply to a previous post, that activity ID
    replyToId?: string;
    // Whether the activity (post) is shared with a Client Portal user
    customerCanSee: boolean;
    // Users mentioned in the post
    mentions: Mention[];
    customFields?: {
        fieldName: string;
        value: string;
    }[];
    // Present if a task was created from an incoming email
    emailDetails?: EmailActivityDetails;
    // If the task was created from an incoming email, posts can be sent as email.
    // This is the mail status.
    mailStatus?: 'not-sent' | 'sending' | 'sent' | 'mail-box-error' | 'error';
}

type Mention = {
    // Value depends on type:
    // type = user: user ID
    // type = group: project ID
    // type = custom: "everyone" or "task-assignees"
    id: string;
    // Text used to mention in the post
    name: string;
    type: "user" | "group" | "custom"
}

type EmailActivityDetails = {
    to: EmailPersonDetails[];
    cc: EmailPersonDetails[];
    from: EmailPersonDetails;
    emailBoxId?: string;
    // Present if the sender is blocked
    isIgnored?: boolean;
}

type EmailPersonDetails = {
    name: string;
    emailAddress: string;
}
```

**Task State**

```typescript
type TaskState = {
    name: string;
    type: 'waiting' | 'active' | 'completed' | 'suspended' | 'cancelled';
    color: string;
    textColor: string;
    isDefault?: boolean;
}

type TaskStateActivity = {
    _id: string;
    // ID of the user who created the activity
    user: string;
    task: string;
    type: 'state-change';
    data: {
        oldState: TaskState;
        newState: TaskState;
    };
}
```

**Default Task States**

If task states are not customized for the project, the default states are used. These values are translated into the user's language in the UI.

| State value   | Translation in UI |
| ------------- | ----------------- |
| cb\_waiting   | Pending           |
| cb\_active    | Active            |
| cb\_completed | Completed         |
| cb\_suspended | Suspended         |
| cb\_cancelled | Cancelled         |

You can check the project object to see whether task states are customized or the defaults are used.
