> 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

Data types and formats used by these endpoints are defined in **Models**.

## List tasks

> Returns tasks matching the search criteria. Some details are omitted in the response. Use \*\*Get task by ID\*\* for full details.\<br>\<br>To find request #601, send \`search=#601\` and \`trackingNumber=601\`. \`trackingNumber\` can only be sent together with \`search\`.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Data types and formats used by these endpoints are defined in **Models**."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"},"TaskList":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"Task":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/ObjectId"},"name":{"type":"string"},"desc":{"type":"string"},"descIsRichText":{"type":"boolean"},"state":{"type":"string"},"start":{"type":"number","nullable":true},"deadline":{"type":"number","nullable":true},"private":{"type":"boolean"},"assignees":{"type":"array","items":{"type":"string"}},"assignedBy":{"type":"string"},"followers":{"type":"array","items":{"type":"string"}},"portalFollowers":{"type":"array","items":{"type":"string"}},"priority":{"type":"number","minimum":1,"maximum":5},"priorityScore":{"type":"number"},"group":{"type":"string"},"stepType":{"type":"string","enum":["none","steps","progress"]},"steps":{"oneOf":[{"$ref":"#/components/schemas/ProgressBar"},{"type":"array","items":{"$ref":"#/components/schemas/TaskStep"}}]},"customer":{"type":"object","nullable":true,"properties":{"_id":{"type":"string"},"name":{"type":"string"}}},"files":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"size":{"type":"string"}}}},"tags":{"type":"array","items":{"type":"string"}},"subtasks":{"type":"array","items":{"type":"string"}},"parent":{"type":"string","nullable":true},"breadcrumbs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"group":{"type":"string"}}}},"email":{"type":"object","properties":{"emailUserId":{"type":"string"}}},"support":{"type":"object","properties":{"portalUser":{"type":"string"}}},"sharedWithCustomer":{"type":"boolean"},"workflowId":{"type":"string"},"workflowTaskCounts":{"type":"number"},"workflow":{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string"},"isCompleted":{"type":"boolean"},"taskflowId":{"type":"string"}}},"estimatedTime":{"type":"number"},"customFields":{"type":"object","additionalProperties":{"type":"string"}},"lastCopy":{"type":"boolean"},"trackingNumber":{"type":"number"},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"updatedAt":{"$ref":"#/components/schemas/UnixTimestamp"},"completedAt":{"$ref":"#/components/schemas/UnixTimestamp"},"archivedAt":{"type":"number","nullable":true}}},"ProgressBar":{"type":"object","properties":{"completed":{"type":"number"},"total":{"type":"number"}}},"TaskStep":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"desc":{"type":"string"},"assignees":{"type":"array","items":{"type":"string"}},"stepType":{"type":"string","enum":["steps","progress"]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/TaskStep"}},"completed":{"oneOf":[{"type":"boolean"},{"type":"number"}]},"total":{"type":"number"}}},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"NotFound":{"description":"Not found"},"ValidationFailed":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"paths":{"/tasks":{"get":{"tags":["Tasks"],"summary":"List tasks","description":"Returns tasks matching the search criteria. Some details are omitted in the response. Use **Get task by ID** for full details.<br><br>To find request #601, send `search=#601` and `trackingNumber=601`. `trackingNumber` can only be sent together with `search`.","operationId":"listTasks","parameters":[{"name":"group","in":"query","description":"Project ID. If omitted, tasks accessible across the organization. If set, `viewAll` permission is required.","schema":{"$ref":"#/components/schemas/ObjectId"}},{"name":"assignee","in":"query","description":"Assignee ID","schema":{"$ref":"#/components/schemas/ObjectId"}},{"name":"assignedBy","in":"query","description":"Task owner ID","schema":{"$ref":"#/components/schemas/ObjectId"}},{"name":"customer","in":"query","description":"Customer ID","schema":{"$ref":"#/components/schemas/ObjectId"}},{"name":"tag","in":"query","description":"Tag ID","schema":{"$ref":"#/components/schemas/ObjectId"}},{"name":"startDate","in":"query","description":"Unix seconds. Required together with `endDate`.","schema":{"$ref":"#/components/schemas/UnixTimestamp"}},{"name":"endDate","in":"query","description":"Unix seconds. Required if `startDate` is set.","schema":{"$ref":"#/components/schemas/UnixTimestamp"}},{"name":"archived","in":"query","description":"`true` / `false` / `all`. Default `false`.","schema":{"type":"string","enum":["true","false","all"],"default":"false"}},{"name":"completed","in":"query","description":"`true`: tasks with `completedAt` set. `false`: all tasks.","schema":{"type":"string","enum":["true","false"]}},{"name":"search","in":"query","description":"Text to search in the task name","schema":{"type":"string"}},{"name":"trackingNumber","in":"query","description":"Only together with `search`. Tracking number of a support request or email task.","schema":{"type":"string"}},{"name":"recursive","in":"query","description":"`true`: include subprojects. Default `false`.","schema":{"type":"string","enum":["true","false"],"default":"false"}},{"name":"state","in":"query","description":"Stage name","schema":{"type":"string"}},{"name":"unassigned","in":"query","description":"`true`: unassigned tasks","schema":{"type":"string"}},{"name":"supportRequest","in":"query","description":"`true`: support request or email tasks","schema":{"type":"string"}},{"name":"hideSubtasks","in":"query","description":"`true`: tasks with no `parent`","schema":{"type":"string"}},{"name":"completedAtStart","in":"query","schema":{"$ref":"#/components/schemas/UnixTimestamp"},"description":"`completedAt` > this time"},{"name":"completedAtEnd","in":"query","schema":{"$ref":"#/components/schemas/UnixTimestamp"},"description":"`completedAt` ≤ this time"},{"name":"createdAtStart","in":"query","schema":{"$ref":"#/components/schemas/UnixTimestamp"},"description":"`createdAt` > this time"},{"name":"createdAtEnd","in":"query","schema":{"$ref":"#/components/schemas/UnixTimestamp"},"description":"`createdAt` ≤ this time"},{"name":"archivedAtStart","in":"query","schema":{"$ref":"#/components/schemas/UnixTimestamp"},"description":"`archivedAt` > this time"},{"name":"archivedAtEnd","in":"query","schema":{"$ref":"#/components/schemas/UnixTimestamp"},"description":"`archivedAt` ≤ this time"},{"name":"startedAtStart","in":"query","schema":{"$ref":"#/components/schemas/UnixTimestamp"},"description":"`start` > this time"},{"name":"startedAtEnd","in":"query","schema":{"$ref":"#/components/schemas/UnixTimestamp"},"description":"`start` ≤ this time"},{"name":"deadlineStart","in":"query","schema":{"$ref":"#/components/schemas/UnixTimestamp"},"description":"`deadline` > this time"},{"name":"deadlineEnd","in":"query","schema":{"$ref":"#/components/schemas/UnixTimestamp"},"description":"`deadline` ≤ this time"},{"name":"skip","in":"query","schema":{"type":"number"},"description":"Number of records to skip"},{"name":"limit","in":"query","schema":{"type":"number"},"description":"Number of records to return"},{"name":"orderBy","in":"query","description":"`_id`, `name`, `createdAt`, or `priority`. Use with `orderDirection`.","schema":{"type":"string","enum":["_id","name","createdAt","priority"]}},{"name":"orderDirection","in":"query","schema":{"type":"string","enum":["asc","desc"]},"description":"`asc` or `desc`. Use with `orderBy`."},{"name":"include","in":"query","description":"Comma-separated list of fields to include in the response","schema":{"type":"string"}},{"name":"exclude","in":"query","description":"Cannot be used together with `include`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Task list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskList"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"}}}}}}
```

## Create task

> Creates a new task.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Data types and formats used by these endpoints are defined in **Models**."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"CreateTaskRequest":{"type":"object","required":["group","name"],"properties":{"group":{"type":"string","description":"Project ID"},"name":{"type":"string","description":"Task name"},"state":{"type":"string","description":"Stage name. If omitted, the project's default stage is used."},"desc":{"type":"string","description":"Task description"},"start":{"type":"number","description":"Start date (Unix seconds)"},"deadline":{"type":"number","description":"Due date (Unix seconds)"},"assignees":{"type":"array","items":{"type":"string"},"description":"Assignee ID list"},"priority":{"type":"number","minimum":1,"maximum":5,"default":3,"description":"1–5. Highest: 5. Default: 3"},"tags":{"type":"array","items":{"type":"string"},"description":"Tag ID list"},"customer":{"type":"string","description":"Customer ID"},"files":{"type":"array","items":{"type":"string"},"description":"File ID list. For a task with files, first **Upload file**, then set the IDs here."},"stepType":{"type":"string","enum":["none","steps","progress"],"default":"none","description":"Task step type. Default: `none`."},"steps":{"oneOf":[{"$ref":"#/components/schemas/ProgressBar"},{"type":"array","items":{"$ref":"#/components/schemas/TaskStep"}}],"description":"If `stepType=steps`, a checklist (IDs are set by the server). If `stepType=progress`, a progress bar. Omit when `none`."},"recurrent":{"type":"boolean","default":false,"description":"Default: `false`"},"recurrence":{"allOf":[{"$ref":"#/components/schemas/Recurrence"}],"description":"Required if `recurrent=true`. Recurrence details."},"private":{"type":"boolean","default":false,"description":"Default: `false`"},"parent":{"type":"string","description":"Parent task ID when created as a subtask."},"workflowId":{"type":"string","description":"Workflow ID if created by a workflow"},"estimatedTime":{"type":"number","description":"Estimated time (seconds). Shown in the UI only if enabled in project settings."},"customFields":{"type":"object","additionalProperties":true,"description":"Custom field names and values"},"followers":{"type":"array","items":{"type":"string"},"description":"Follower ID list. If omitted, the owner and assignees become followers."}}},"ProgressBar":{"type":"object","properties":{"completed":{"type":"number"},"total":{"type":"number"}}},"TaskStep":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"desc":{"type":"string"},"assignees":{"type":"array","items":{"type":"string"}},"stepType":{"type":"string","enum":["steps","progress"]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/TaskStep"}},"completed":{"oneOf":[{"type":"boolean"},{"type":"number"}]},"total":{"type":"number"}}},"Recurrence":{"type":"object","properties":{"type":{"type":"string","enum":["daily","weekly","monthly"],"description":"Recurrence period type"},"period":{"type":"number","description":"Every N days/weeks/months. Example: 3 for every 3 days"},"createWhen":{"type":"string","enum":["after-deadline","completed","on-start-date"],"description":"When the new copy is created."},"active":{"type":"boolean","description":"`true` keeps recurrence active; otherwise it is paused."},"stopCondition":{"type":"string","enum":["none","date","count"],"description":"When recurrence stops."},"end":{"type":"number","description":"End date (Unix seconds) when `stopCondition=date`"},"maxCount":{"type":"number","description":"Number of copies when `stopCondition=count`. If 1, no extra copy is created."},"currentCount":{"type":"number","description":"Number of copies already created"},"days":{"type":"array","items":{"type":"boolean"},"description":"When `type=weekly`, days of the week (Monday first). Whether a copy is created that day."},"recurSubtasks":{"type":"boolean","description":"Whether subtasks also recur"}}},"Task":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/ObjectId"},"name":{"type":"string"},"desc":{"type":"string"},"descIsRichText":{"type":"boolean"},"state":{"type":"string"},"start":{"type":"number","nullable":true},"deadline":{"type":"number","nullable":true},"private":{"type":"boolean"},"assignees":{"type":"array","items":{"type":"string"}},"assignedBy":{"type":"string"},"followers":{"type":"array","items":{"type":"string"}},"portalFollowers":{"type":"array","items":{"type":"string"}},"priority":{"type":"number","minimum":1,"maximum":5},"priorityScore":{"type":"number"},"group":{"type":"string"},"stepType":{"type":"string","enum":["none","steps","progress"]},"steps":{"oneOf":[{"$ref":"#/components/schemas/ProgressBar"},{"type":"array","items":{"$ref":"#/components/schemas/TaskStep"}}]},"customer":{"type":"object","nullable":true,"properties":{"_id":{"type":"string"},"name":{"type":"string"}}},"files":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"size":{"type":"string"}}}},"tags":{"type":"array","items":{"type":"string"}},"subtasks":{"type":"array","items":{"type":"string"}},"parent":{"type":"string","nullable":true},"breadcrumbs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"group":{"type":"string"}}}},"email":{"type":"object","properties":{"emailUserId":{"type":"string"}}},"support":{"type":"object","properties":{"portalUser":{"type":"string"}}},"sharedWithCustomer":{"type":"boolean"},"workflowId":{"type":"string"},"workflowTaskCounts":{"type":"number"},"workflow":{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string"},"isCompleted":{"type":"boolean"},"taskflowId":{"type":"string"}}},"estimatedTime":{"type":"number"},"customFields":{"type":"object","additionalProperties":{"type":"string"}},"lastCopy":{"type":"boolean"},"trackingNumber":{"type":"number"},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"updatedAt":{"$ref":"#/components/schemas/UnixTimestamp"},"completedAt":{"$ref":"#/components/schemas/UnixTimestamp"},"archivedAt":{"type":"number","nullable":true}}},"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"ErrorCode":{"type":"object","required":["code"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"NotFound":{"description":"Not found"}}},"paths":{"/tasks":{"post":{"tags":["Tasks"],"summary":"Create task","operationId":"createTask","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskRequest"}}}},"responses":{"200":{"description":"New task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"Invalid operation","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ErrorCode"},{"$ref":"#/components/schemas/ErrorCodeMessage"}]}}}}},"description":"Creates a new task."}}}}
```

## List tasks by IDs

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

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Data types and formats used by these endpoints are defined in **Models**."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ListTasksByIdsRequest":{"type":"object","required":["taskIds","recursive"],"properties":{"taskIds":{"type":"array","items":{"type":"string"},"description":"Task ID list"},"recursive":{"type":"string","enum":["true","false"],"description":"`\"true\"`: include subtasks. `\"false\"`: the given IDs only."},"include":{"type":"array","items":{"type":"string"},"description":"Field names to include in the response. Must be an array; cannot be used with `exclude`."},"exclude":{"type":"array","items":{"type":"string"},"description":"Field names to exclude from the response. Must be an array; cannot be used with `include`."}}},"TaskList":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"Task":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/ObjectId"},"name":{"type":"string"},"desc":{"type":"string"},"descIsRichText":{"type":"boolean"},"state":{"type":"string"},"start":{"type":"number","nullable":true},"deadline":{"type":"number","nullable":true},"private":{"type":"boolean"},"assignees":{"type":"array","items":{"type":"string"}},"assignedBy":{"type":"string"},"followers":{"type":"array","items":{"type":"string"}},"portalFollowers":{"type":"array","items":{"type":"string"}},"priority":{"type":"number","minimum":1,"maximum":5},"priorityScore":{"type":"number"},"group":{"type":"string"},"stepType":{"type":"string","enum":["none","steps","progress"]},"steps":{"oneOf":[{"$ref":"#/components/schemas/ProgressBar"},{"type":"array","items":{"$ref":"#/components/schemas/TaskStep"}}]},"customer":{"type":"object","nullable":true,"properties":{"_id":{"type":"string"},"name":{"type":"string"}}},"files":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"size":{"type":"string"}}}},"tags":{"type":"array","items":{"type":"string"}},"subtasks":{"type":"array","items":{"type":"string"}},"parent":{"type":"string","nullable":true},"breadcrumbs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"group":{"type":"string"}}}},"email":{"type":"object","properties":{"emailUserId":{"type":"string"}}},"support":{"type":"object","properties":{"portalUser":{"type":"string"}}},"sharedWithCustomer":{"type":"boolean"},"workflowId":{"type":"string"},"workflowTaskCounts":{"type":"number"},"workflow":{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string"},"isCompleted":{"type":"boolean"},"taskflowId":{"type":"string"}}},"estimatedTime":{"type":"number"},"customFields":{"type":"object","additionalProperties":{"type":"string"}},"lastCopy":{"type":"boolean"},"trackingNumber":{"type":"number"},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"updatedAt":{"$ref":"#/components/schemas/UnixTimestamp"},"completedAt":{"$ref":"#/components/schemas/UnixTimestamp"},"archivedAt":{"type":"number","nullable":true}}},"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"ProgressBar":{"type":"object","properties":{"completed":{"type":"number"},"total":{"type":"number"}}},"TaskStep":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"desc":{"type":"string"},"assignees":{"type":"array","items":{"type":"string"}},"stepType":{"type":"string","enum":["steps","progress"]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/TaskStep"}},"completed":{"oneOf":[{"type":"boolean"},{"type":"number"}]},"total":{"type":"number"}}},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"ValidationFailed":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"paths":{"/tasks/by-ids":{"post":{"tags":["Tasks"],"summary":"List tasks by IDs","description":"Returns tasks for the given task IDs. POST is used because the ID list may exceed URL length limits.","operationId":"listTasksByIds","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTasksByIdsRequest"}}}},"responses":{"200":{"description":"Task list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskList"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"}}}}}}
```

## Get task by ID

> Returns full details of the task with the given ID.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Data types and formats used by these endpoints are defined in **Models**."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"Task":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/ObjectId"},"name":{"type":"string"},"desc":{"type":"string"},"descIsRichText":{"type":"boolean"},"state":{"type":"string"},"start":{"type":"number","nullable":true},"deadline":{"type":"number","nullable":true},"private":{"type":"boolean"},"assignees":{"type":"array","items":{"type":"string"}},"assignedBy":{"type":"string"},"followers":{"type":"array","items":{"type":"string"}},"portalFollowers":{"type":"array","items":{"type":"string"}},"priority":{"type":"number","minimum":1,"maximum":5},"priorityScore":{"type":"number"},"group":{"type":"string"},"stepType":{"type":"string","enum":["none","steps","progress"]},"steps":{"oneOf":[{"$ref":"#/components/schemas/ProgressBar"},{"type":"array","items":{"$ref":"#/components/schemas/TaskStep"}}]},"customer":{"type":"object","nullable":true,"properties":{"_id":{"type":"string"},"name":{"type":"string"}}},"files":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"size":{"type":"string"}}}},"tags":{"type":"array","items":{"type":"string"}},"subtasks":{"type":"array","items":{"type":"string"}},"parent":{"type":"string","nullable":true},"breadcrumbs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"group":{"type":"string"}}}},"email":{"type":"object","properties":{"emailUserId":{"type":"string"}}},"support":{"type":"object","properties":{"portalUser":{"type":"string"}}},"sharedWithCustomer":{"type":"boolean"},"workflowId":{"type":"string"},"workflowTaskCounts":{"type":"number"},"workflow":{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string"},"isCompleted":{"type":"boolean"},"taskflowId":{"type":"string"}}},"estimatedTime":{"type":"number"},"customFields":{"type":"object","additionalProperties":{"type":"string"}},"lastCopy":{"type":"boolean"},"trackingNumber":{"type":"number"},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"updatedAt":{"$ref":"#/components/schemas/UnixTimestamp"},"completedAt":{"$ref":"#/components/schemas/UnixTimestamp"},"archivedAt":{"type":"number","nullable":true}}},"ProgressBar":{"type":"object","properties":{"completed":{"type":"number"},"total":{"type":"number"}}},"TaskStep":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"desc":{"type":"string"},"assignees":{"type":"array","items":{"type":"string"}},"stepType":{"type":"string","enum":["steps","progress"]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/TaskStep"}},"completed":{"oneOf":[{"type":"boolean"},{"type":"number"}]},"total":{"type":"number"}}},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"NotFound":{"description":"Not found"},"ValidationFailed":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"paths":{"/tasks/{id}":{"get":{"tags":["Tasks"],"summary":"Get task by ID","operationId":"getTask","parameters":[{"name":"id","in":"path","required":true,"description":"Task ID","schema":{"$ref":"#/components/schemas/ObjectId"}}],"responses":{"200":{"description":"Task details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"}},"description":"Returns full details of the task with the given ID."}}}}
```

## Update task

> Updates the task with the given fields. Only sent fields change. To clear a field, use \`null\` or an empty value. If \`customFields\` is sent, the object is replaced as a whole; sending a single custom field removes the others. To change one custom field, include the existing \`customFields\` values as well.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Data types and formats used by these endpoints are defined in **Models**."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"UpdateTaskRequest":{"type":"object","properties":{"updateTemplate":{"type":"boolean","description":"On a recurring task, whether to update only this copy or future copies as well."},"assignees":{"type":"array","items":{"type":"string"},"description":"Assignee ID list"},"customer":{"type":"string","description":"Customer ID"},"customFields":{"type":"object","additionalProperties":true,"description":"Custom field names and values. If sent, the object is replaced as a whole; sending a single field removes the others."},"deadline":{"type":"number","description":"Due date (Unix seconds)"},"desc":{"type":"string","description":"Description"},"estimatedTime":{"type":"number","description":"Estimated time (seconds)"},"files":{"type":"array","items":{"type":"string"},"description":"File ID list"},"followers":{"type":"array","items":{"type":"string"},"description":"Follower ID list"},"group":{"type":"string","description":"Target project ID when moving the task"},"name":{"type":"string","description":"Task name"},"private":{"type":"boolean","description":"Private task"},"recurrence":{"allOf":[{"$ref":"#/components/schemas/Recurrence"}],"description":"Recurrence details"},"recurrent":{"type":"boolean","description":"Whether recurrence is enabled"},"start":{"type":"number","description":"Start date (Unix seconds)"},"state":{"type":"string","description":"Task state. Required when moving to a project to switch to a state in the new project."},"steps":{"oneOf":[{"$ref":"#/components/schemas/ProgressBar"},{"type":"array","items":{"$ref":"#/components/schemas/TaskStep"}}],"description":"Required when `stepType` is `steps` or `progress`."},"stepType":{"type":"string","enum":["none","steps","progress"],"description":"`none`, `steps`, or `progress`."},"subtasks":{"type":"array","items":{"type":"string"},"description":"Subtask ID list"},"workflowId":{"type":"string","description":"Workflow ID"}}},"Recurrence":{"type":"object","properties":{"type":{"type":"string","enum":["daily","weekly","monthly"],"description":"Recurrence period type"},"period":{"type":"number","description":"Every N days/weeks/months. Example: 3 for every 3 days"},"createWhen":{"type":"string","enum":["after-deadline","completed","on-start-date"],"description":"When the new copy is created."},"active":{"type":"boolean","description":"`true` keeps recurrence active; otherwise it is paused."},"stopCondition":{"type":"string","enum":["none","date","count"],"description":"When recurrence stops."},"end":{"type":"number","description":"End date (Unix seconds) when `stopCondition=date`"},"maxCount":{"type":"number","description":"Number of copies when `stopCondition=count`. If 1, no extra copy is created."},"currentCount":{"type":"number","description":"Number of copies already created"},"days":{"type":"array","items":{"type":"boolean"},"description":"When `type=weekly`, days of the week (Monday first). Whether a copy is created that day."},"recurSubtasks":{"type":"boolean","description":"Whether subtasks also recur"}}},"ProgressBar":{"type":"object","properties":{"completed":{"type":"number"},"total":{"type":"number"}}},"TaskStep":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"desc":{"type":"string"},"assignees":{"type":"array","items":{"type":"string"}},"stepType":{"type":"string","enum":["steps","progress"]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/TaskStep"}},"completed":{"oneOf":[{"type":"boolean"},{"type":"number"}]},"total":{"type":"number"}}},"UpdateTaskResponse":{"type":"object","properties":{"activity":{"$ref":"#/components/schemas/TaskActivity"},"task":{"$ref":"#/components/schemas/Task"}}},"TaskActivity":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"portalUser":{"type":"string"},"emailUser":{"type":"string"},"type":{"type":"string","enum":["post","update","progress","archive","restore","state-change","delete","task-shared","task-unshared"]},"data":{"type":"object","additionalProperties":true},"content":{"type":"string"},"contentIsRichText":{"type":"boolean"},"files":{"type":"array","items":{"$ref":"#/components/schemas/File"}},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"replyToId":{"type":"string"},"customerCanSee":{"type":"boolean"},"mentions":{"type":"array","items":{"$ref":"#/components/schemas/Mention"}},"customFields":{"type":"array","items":{"type":"object","properties":{"fieldName":{"type":"string"},"value":{"type":"string"}}}},"emailDetails":{"$ref":"#/components/schemas/EmailActivityDetails"},"mailStatus":{"type":"string","enum":["not-sent","sending","sent","mail-box-error","error"]}}},"File":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"thumbnail":{"type":"string"},"google":{"type":"object","properties":{"id":{"type":"string"},"extension":{"type":"string"},"webViewLink":{"type":"string"},"mimeType":{"type":"string"}}},"dropbox":{"type":"object","properties":{"id":{"type":"string"},"webViewLink":{"type":"string"}}}}},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"},"Mention":{"type":"object","properties":{"id":{"type":"string","description":"`user`: user ID, `group`: project ID, `custom`: `everyone` or `task-assignees`"},"name":{"type":"string"},"type":{"type":"string","enum":["user","group","custom"]}}},"EmailActivityDetails":{"type":"object","properties":{"to":{"type":"array","items":{"$ref":"#/components/schemas/EmailPersonDetails"}},"cc":{"type":"array","items":{"$ref":"#/components/schemas/EmailPersonDetails"}},"from":{"$ref":"#/components/schemas/EmailPersonDetails"},"emailBoxId":{"type":"string"},"isIgnored":{"type":"boolean"}}},"EmailPersonDetails":{"type":"object","properties":{"name":{"type":"string"},"emailAddress":{"type":"string"}}},"Task":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/ObjectId"},"name":{"type":"string"},"desc":{"type":"string"},"descIsRichText":{"type":"boolean"},"state":{"type":"string"},"start":{"type":"number","nullable":true},"deadline":{"type":"number","nullable":true},"private":{"type":"boolean"},"assignees":{"type":"array","items":{"type":"string"}},"assignedBy":{"type":"string"},"followers":{"type":"array","items":{"type":"string"}},"portalFollowers":{"type":"array","items":{"type":"string"}},"priority":{"type":"number","minimum":1,"maximum":5},"priorityScore":{"type":"number"},"group":{"type":"string"},"stepType":{"type":"string","enum":["none","steps","progress"]},"steps":{"oneOf":[{"$ref":"#/components/schemas/ProgressBar"},{"type":"array","items":{"$ref":"#/components/schemas/TaskStep"}}]},"customer":{"type":"object","nullable":true,"properties":{"_id":{"type":"string"},"name":{"type":"string"}}},"files":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"size":{"type":"string"}}}},"tags":{"type":"array","items":{"type":"string"}},"subtasks":{"type":"array","items":{"type":"string"}},"parent":{"type":"string","nullable":true},"breadcrumbs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"group":{"type":"string"}}}},"email":{"type":"object","properties":{"emailUserId":{"type":"string"}}},"support":{"type":"object","properties":{"portalUser":{"type":"string"}}},"sharedWithCustomer":{"type":"boolean"},"workflowId":{"type":"string"},"workflowTaskCounts":{"type":"number"},"workflow":{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string"},"isCompleted":{"type":"boolean"},"taskflowId":{"type":"string"}}},"estimatedTime":{"type":"number"},"customFields":{"type":"object","additionalProperties":{"type":"string"}},"lastCopy":{"type":"boolean"},"trackingNumber":{"type":"number"},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"updatedAt":{"$ref":"#/components/schemas/UnixTimestamp"},"completedAt":{"$ref":"#/components/schemas/UnixTimestamp"},"archivedAt":{"type":"number","nullable":true}}},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ErrorCode":{"type":"object","required":["code"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."}}},"ErrorMessage":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"NotFound":{"description":"Not found"}}},"paths":{"/tasks/{id}":{"put":{"tags":["Tasks"],"summary":"Update task","description":"Updates the task with the given fields. Only sent fields change. To clear a field, use `null` or an empty value. If `customFields` is sent, the object is replaced as a whole; sending a single custom field removes the others. To change one custom field, include the existing `customFields` values as well.","operationId":"updateTask","parameters":[{"name":"id","in":"path","required":true,"description":"Task ID","schema":{"$ref":"#/components/schemas/ObjectId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskRequest"}}}},"responses":{"200":{"description":"Updated task and activity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorCodeMessage"},{"$ref":"#/components/schemas/ErrorCode"}]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"Invalid operation","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorCodeMessage"},{"$ref":"#/components/schemas/ErrorCode"},{"$ref":"#/components/schemas/ErrorMessage"},{"$ref":"#/components/schemas/ValidationError"}]}}}}}}}}}
```

## Delete task

> Deletes the task with the given ID.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Data types and formats used by these endpoints are defined in **Models**."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"NotFound":{"description":"Not found"},"ValidationFailed":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"paths":{"/tasks/{id}":{"delete":{"tags":["Tasks"],"summary":"Delete task","operationId":"deleteTask","parameters":[{"name":"id","in":"path","required":true,"description":"Task ID","schema":{"$ref":"#/components/schemas/ObjectId"}}],"responses":{"200":{"description":"Empty response"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"}},"description":"Deletes the task with the given ID."}}}}
```

## Add subtask

> Adds an existing task as a subtask of the specified task.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Data types and formats used by these endpoints are defined in **Models**."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"AddSubtaskRequest":{"type":"object","required":["subtask"],"properties":{"subtask":{"type":"string","description":"ID of the existing task to add as a subtask"}}},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ErrorCode":{"type":"object","required":["code"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."}}},"ErrorMessage":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"NotFound":{"description":"Not found"}}},"paths":{"/tasks/{id}/subtasks":{"post":{"tags":["Tasks"],"summary":"Add subtask","operationId":"addSubtask","parameters":[{"name":"id","in":"path","required":true,"description":"Task ID","schema":{"$ref":"#/components/schemas/ObjectId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddSubtaskRequest"}}}},"responses":{"200":{"description":"Empty response"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"Invalid operation","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorCode"},{"$ref":"#/components/schemas/ErrorMessage"}]}}}}},"description":"Adds an existing task as a subtask of the specified task."}}}}
```

## Update task state

> Changes the task state. If there are no custom states, use \`cb\_waiting\`, \`cb\_active\`, \`cb\_completed\`, \`cb\_suspended\`, \`cb\_cancelled\`.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Data types and formats used by these endpoints are defined in **Models**."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"UpdateTaskStateRequest":{"type":"object","required":["value"],"properties":{"value":{"type":"string","description":"New task state name. Default states: `cb_waiting`, `cb_active`, `cb_completed`, `cb_suspended`, `cb_cancelled`."}}},"TaskStateActivity":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"task":{"type":"string"},"type":{"type":"string","enum":["state-change"]},"data":{"type":"object","properties":{"oldState":{"$ref":"#/components/schemas/TaskState"},"newState":{"$ref":"#/components/schemas/TaskState"}}}}},"TaskState":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["waiting","active","completed","suspended","cancelled"]},"color":{"type":"string","description":"Hex color"},"textColor":{"type":"string"},"isDefault":{"type":"boolean"}}},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ErrorPlain":{"type":"string"},"ErrorCode":{"type":"object","required":["code"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"NotFound":{"description":"Not found"}}},"paths":{"/tasks/{id}/state":{"put":{"tags":["Tasks"],"summary":"Update task state","description":"Changes the task state. If there are no custom states, use `cb_waiting`, `cb_active`, `cb_completed`, `cb_suspended`, `cb_cancelled`.","operationId":"updateTaskState","parameters":[{"name":"id","in":"path","required":true,"description":"Task ID","schema":{"$ref":"#/components/schemas/ObjectId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskStateRequest"}}}},"responses":{"200":{"description":"Task state activity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskStateActivity"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"Invalid operation","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorPlain"},{"$ref":"#/components/schemas/ErrorCode"},{"$ref":"#/components/schemas/ValidationError"}]}}}}}}}}}
```

## List task activities

> Returns activities of the task.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Data types and formats used by these endpoints are defined in **Models**."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"TaskActivityList":{"type":"array","items":{"$ref":"#/components/schemas/TaskActivity"}},"TaskActivity":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"portalUser":{"type":"string"},"emailUser":{"type":"string"},"type":{"type":"string","enum":["post","update","progress","archive","restore","state-change","delete","task-shared","task-unshared"]},"data":{"type":"object","additionalProperties":true},"content":{"type":"string"},"contentIsRichText":{"type":"boolean"},"files":{"type":"array","items":{"$ref":"#/components/schemas/File"}},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"replyToId":{"type":"string"},"customerCanSee":{"type":"boolean"},"mentions":{"type":"array","items":{"$ref":"#/components/schemas/Mention"}},"customFields":{"type":"array","items":{"type":"object","properties":{"fieldName":{"type":"string"},"value":{"type":"string"}}}},"emailDetails":{"$ref":"#/components/schemas/EmailActivityDetails"},"mailStatus":{"type":"string","enum":["not-sent","sending","sent","mail-box-error","error"]}}},"File":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"thumbnail":{"type":"string"},"google":{"type":"object","properties":{"id":{"type":"string"},"extension":{"type":"string"},"webViewLink":{"type":"string"},"mimeType":{"type":"string"}}},"dropbox":{"type":"object","properties":{"id":{"type":"string"},"webViewLink":{"type":"string"}}}}},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"},"Mention":{"type":"object","properties":{"id":{"type":"string","description":"`user`: user ID, `group`: project ID, `custom`: `everyone` or `task-assignees`"},"name":{"type":"string"},"type":{"type":"string","enum":["user","group","custom"]}}},"EmailActivityDetails":{"type":"object","properties":{"to":{"type":"array","items":{"$ref":"#/components/schemas/EmailPersonDetails"}},"cc":{"type":"array","items":{"$ref":"#/components/schemas/EmailPersonDetails"}},"from":{"$ref":"#/components/schemas/EmailPersonDetails"},"emailBoxId":{"type":"string"},"isIgnored":{"type":"boolean"}}},"EmailPersonDetails":{"type":"object","properties":{"name":{"type":"string"},"emailAddress":{"type":"string"}}},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"NotFound":{"description":"Not found"},"ValidationFailed":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"paths":{"/tasks/{id}/activities":{"get":{"tags":["Tasks"],"summary":"List task activities","operationId":"listTaskActivities","parameters":[{"name":"id","in":"path","required":true,"description":"Task ID","schema":{"$ref":"#/components/schemas/ObjectId"}}],"responses":{"200":{"description":"Task activities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskActivityList"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"}},"description":"Returns activities of the task."}}}}
```

## Create task post

> Creates a post on the task.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Data types and formats used by these endpoints are defined in **Models**."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"CreateTaskPostRequest":{"type":"object","properties":{"content":{"type":"string","description":"Post content. `content` or `fileIds` is required."},"fileIds":{"type":"array","items":{"type":"string"},"description":"File ID list. First **Upload file**. `fileIds` or `content` is required."},"mentions":{"type":"array","items":{"$ref":"#/components/schemas/Mention"},"description":"Mentioned users"},"replyToId":{"type":"string","description":"ID of the post being replied to"}}},"Mention":{"type":"object","properties":{"id":{"type":"string","description":"`user`: user ID, `group`: project ID, `custom`: `everyone` or `task-assignees`"},"name":{"type":"string"},"type":{"type":"string","enum":["user","group","custom"]}}},"TaskActivity":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"portalUser":{"type":"string"},"emailUser":{"type":"string"},"type":{"type":"string","enum":["post","update","progress","archive","restore","state-change","delete","task-shared","task-unshared"]},"data":{"type":"object","additionalProperties":true},"content":{"type":"string"},"contentIsRichText":{"type":"boolean"},"files":{"type":"array","items":{"$ref":"#/components/schemas/File"}},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"replyToId":{"type":"string"},"customerCanSee":{"type":"boolean"},"mentions":{"type":"array","items":{"$ref":"#/components/schemas/Mention"}},"customFields":{"type":"array","items":{"type":"object","properties":{"fieldName":{"type":"string"},"value":{"type":"string"}}}},"emailDetails":{"$ref":"#/components/schemas/EmailActivityDetails"},"mailStatus":{"type":"string","enum":["not-sent","sending","sent","mail-box-error","error"]}}},"File":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"thumbnail":{"type":"string"},"google":{"type":"object","properties":{"id":{"type":"string"},"extension":{"type":"string"},"webViewLink":{"type":"string"},"mimeType":{"type":"string"}}},"dropbox":{"type":"object","properties":{"id":{"type":"string"},"webViewLink":{"type":"string"}}}}},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"},"EmailActivityDetails":{"type":"object","properties":{"to":{"type":"array","items":{"$ref":"#/components/schemas/EmailPersonDetails"}},"cc":{"type":"array","items":{"$ref":"#/components/schemas/EmailPersonDetails"}},"from":{"$ref":"#/components/schemas/EmailPersonDetails"},"emailBoxId":{"type":"string"},"isIgnored":{"type":"boolean"}}},"EmailPersonDetails":{"type":"object","properties":{"name":{"type":"string"},"emailAddress":{"type":"string"}}},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"NotFound":{"description":"Not found"},"ValidationFailed":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"paths":{"/tasks/{id}/activities":{"post":{"tags":["Tasks"],"summary":"Create task post","description":"Creates a post on the task.","operationId":"createTaskPost","parameters":[{"name":"id","in":"path","required":true,"description":"Task ID","schema":{"$ref":"#/components/schemas/ObjectId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskPostRequest"}}}},"responses":{"200":{"description":"Task activity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskActivity"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"}}}}}}
```

## Change task post visibility

> Changes post visibility on a support request, a task shared with a customer, or an email task. Making it visible on an email task sends the post as email.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Data types and formats used by these endpoints are defined in **Models**."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"UpdateTaskActivityVisibilityRequest":{"type":"object","required":["value"],"properties":{"value":{"type":"boolean","description":"`true` makes it visible, `false` hides it."}}},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ErrorCode":{"type":"object","required":["code"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."}}},"ErrorPlain":{"type":"string"}},"responses":{"NotFound":{"description":"Not found"}}},"paths":{"/tasks/{taskId}/activities/{activityId}/visible":{"put":{"tags":["Tasks"],"summary":"Change task post visibility","description":"Changes post visibility on a support request, a task shared with a customer, or an email task. Making it visible on an email task sends the post as email.","operationId":"updateTaskActivityVisibility","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ObjectId"},"description":"Task ID"},{"name":"activityId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ObjectId"},"description":"ID of the activity whose visibility will change"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskActivityVisibilityRequest"}}}},"responses":{"200":{"description":"Empty response"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorCodeMessage"},{"$ref":"#/components/schemas/ErrorCode"}]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"Invalid operation","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorPlain"},{"$ref":"#/components/schemas/ErrorCode"}]}}}}}}}}}
```
