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

# Task Management

## Search Tasks

> \### Example overview\
> \
> Search tasks by many parameters\
> \
> \> Default behaviour for requests by user: return list of tasks, where current user is assignee or watcher. \
> &#x20; \
> \
> \### HTTP Request\
> \
> \*\*Method\*\*: \_\*\*GET\*\*\_\
> \
> \*\*Endpoint\*\*: \`{url}/{tenantName}/{instanceName}/tasks\`\
> \
> in our example it would be: \`<https://api.live.welkincloud.io/gh/sb-demo/tasks\\`\\>
> \
> \*\*Deprecated parameters\*\*\
> \
> \| Name | Located in | Description | Required | Type |\
> \| --- | --- | --- | --- | --- |\
> \| assigneeId | path | replased to assigneeIds | No | UUID (or comma separated list of UUID) |\
> \| patientId | path | replased to patientIds | No | UUID |\
> \| status | path | replased to statuses | No | \\\[\`TODO\`, \`IN\_PROGRESS\`, \`COMPLETED\`, \`CANCELED\`\\] - one or more comma separated |\
> \| priority | path | replased to priorities | No | \\\[\`LOW\`, \`MEDIUM\`, \`HIGH\`, \`URGENT\`\\] - one or more comma separated |\
> \
> \*\*Responses\*\*\
> \
> \| Code | Description |\
> \| --- | --- |\
> \| 200 | OK |\
> \| 401 | Unauthorized |\
> \| 403 | Forbidden |\
> \| 404 | Not Found |

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Task management","description":""}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}}},"schemas":{"TaskPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"metaInfo":{"$ref":"#/components/schemas/PageMetaInfo"}}},"Task":{"type":"object","required":["name","status","priority","assignee"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdBy":{"type":"string","format":"uuid","readOnly":true},"updatedBy":{"type":"string","format":"uuid","readOnly":true},"createdByName":{"type":"string","readOnly":true},"updatedByName":{"type":"string","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"status":{"$ref":"#/components/schemas/TaskStatus"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"patient":{"$ref":"#/components/schemas/IndexedNamed","description":"Set automatically from the path patientId when created via the Goal Task endpoint."},"assignee":{"$ref":"#/components/schemas/TaskUser"},"watchers":{"type":"array","items":{"$ref":"#/components/schemas/TaskUser"}},"comments":{"type":"array","items":{"$ref":"#/components/schemas/TaskComment"}},"goalId":{"type":"string","format":"uuid","nullable":true,"readOnly":true},"templateName":{"type":"string","nullable":true},"createdType":{"$ref":"#/components/schemas/TaskCreatedType"},"sourceId":{"type":"string","format":"uuid","nullable":true},"sourceType":{"$ref":"#/components/schemas/TaskSourceType"},"hiddenPhi":{"type":"boolean"},"watchersType":{"$ref":"#/components/schemas/WatchersType","default":"POINT_OF_CONTACT"}}},"TaskStatus":{"type":"string","enum":["TODO","IN_PROGRESS","COMPLETED","CANCELED"]},"TaskPriority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"]},"IndexedNamed":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}}},"TaskUser":{"allOf":[{"$ref":"#/components/schemas/IndexedNamed"},{"type":"object","properties":{"enabled":{"type":"boolean","nullable":true}}}]},"TaskComment":{"type":"object","required":["text"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"author":{"$ref":"#/components/schemas/TaskUser"},"text":{"type":"string"},"patient":{"$ref":"#/components/schemas/IndexedNamed"},"user":{"$ref":"#/components/schemas/IndexedNamed"}}},"TaskCreatedType":{"type":"string","enum":["AUTOMATION","USER"]},"TaskSourceType":{"type":"string","enum":["ASSESSMENT"]},"WatchersType":{"type":"string","enum":["POINT_OF_CONTACT","CARE_TEAM"]},"PageMetaInfo":{"type":"object","properties":{"page":{"type":"integer"},"pageSize":{"type":"integer"},"totalElements":{"type":"integer"},"numberOfElements":{"type":"integer"}}}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/tasks":{"get":{"summary":"Search Tasks","tags":["Task management"],"operationId":"Search_Tasks","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"},{"name":"templates","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Looks for tasks with template. String (or comma separated list of string)"},{"name":"withoutTemplate","in":"query","required":false,"schema":{"type":"boolean"},"description":"Looks for tasks without template"},{"name":"assigneeIds","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"assigneeIds"},{"name":"patientIds","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Looks for tasks related to patient. UUID (or comma separated list of UUID)"},{"name":"statuses","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Looks for tasks with status [TODO, IN_PROGRESS, COMPLETED, CANCELED] - one or more comma separated"},{"name":"priorities","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Looks for tasks with priority [LOW, MEDIUM, HIGH, URGENT] - one or more comma separated"},{"name":"dueBefore","in":"query","required":false,"schema":{"type":"string"},"description":"Looks for tasks whose deadline is up to the specified day. Datetime in ISO-8601 format"},{"name":"dueAfter","in":"query","required":false,"schema":{"type":"string"},"description":"Looks for tasks whose deadline is after the specified day. Datetime in ISO-8601 format"},{"name":"authorId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Looks for tasks created by user (\tUUID)"},{"name":"dueDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Looks for tasks whose deadline is on the specified day. Datetime in ISO-8601 format"},{"name":"search","in":"query","required":false,"schema":{"type":"string"},"description":"Search by name or description"},{"name":"description","in":"query","required":false,"schema":{"type":"string"},"description":"Looks for tasks whose descriptions partially matches the specified one"},{"name":"watcherId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Looks for tasks monitored by the specified user (UUID)"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","default":20}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":0,"minimum":0}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated search results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskPage"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"### Example overview\n\nSearch tasks by many parameters\n\n> Default behaviour for requests by user: return list of tasks, where current user is assignee or watcher. \n  \n\n### HTTP Request\n\n**Method**: _**GET**_\n\n**Endpoint**: `{url}/{tenantName}/{instanceName}/tasks`\n\nin our example it would be: `https://api.live.welkincloud.io/gh/sb-demo/tasks`\n\n**Deprecated parameters**\n\n| Name | Located in | Description | Required | Type |\n| --- | --- | --- | --- | --- |\n| assigneeId | path | replased to assigneeIds | No | UUID (or comma separated list of UUID) |\n| patientId | path | replased to patientIds | No | UUID |\n| status | path | replased to statuses | No | \\[`TODO`, `IN_PROGRESS`, `COMPLETED`, `CANCELED`\\] - one or more comma separated |\n| priority | path | replased to priorities | No | \\[`LOW`, `MEDIUM`, `HIGH`, `URGENT`\\] - one or more comma separated |\n\n**Responses**\n\n| Code | Description |\n| --- | --- |\n| 200 | OK |\n| 401 | Unauthorized |\n| 403 | Forbidden |\n| 404 | Not Found |"}}}}
```

## Create new Task

> \### Example overview\
> \
> A new task is created with the name \`Patient Review\` with the description \`New Patient Profile Review\` and the priority \`URGENT\` and comment \`Lorem ipsum...\`. The task assigned to user with id \`20eb246e-8099-4c7c-854c-5e0f9a366ddb\`. The task visible for users specified in the fields \`author\`, \`assignee\`, \`watchers\` (in our example, this is the same user). The task must be completed by \`May 20, 2021\`.\
> \
> The method allows you to add a comment to the task being created. This update allows adding comments to tasks through the API on behalf of a patient. If patient information is not included, the comment will default to being attributed to the API client.\
> \
> \### HTTP Request\
> \
> \*\*Method\*\*: \_\*\*POST\*\*\_\
> \
> \*\*Endpoint\*\*: \`{url}/{tenantName}/{instanceName}/tasks\`\
> \
> in our example it would be: \`<https://api.live.welkincloud.io/gh/sb-demo/tasks\\`\\>
> \
> \*\*Parameters\*\*\
> \
> \| Name | Located in | Description | Required | Type |\
> \| --- | --- | --- | --- | --- |\
> \| tenantName | path | Name of tenant | Yes | string |\
> \| instanceName | path | Name of instance | Yes | string |\
> \| name | body | Short name of the task | Yes | string |\
> \| description | body | Detailed text description of the task | No | string |\
> \| priority | body | task priority | Yes | \`LOW\`, \`MEDIUM\`, \`HIGH\`, \`URGENT\` |\
> \| status | body | task status | Yes | \`TODO\`, \`IN\_PROGRESS\`, \`COMPLETED\`, \`CANCELED\` |\
> \| dueDate | body | deadline for the task | No | Datetime in \[ISO-8601]\(<https://en.wikipedia.org/wiki/ISO\\_8601>) format |\
> \| assignee | body | user responsible for the task | Yes | \`{"id": ""}\` |\
> \| patient | body | task-related patient | No | \`{"id": ""}\` |\
> \| watchers | body | users subscribed to task notifications | No | \\\[\`{"id": ""}\`\\] |\
> \| comments | body | simple text comments to task | No | \\\[\`{"text": ""}\`\\] |\
> \
> \*\*Responses\*\*\
> \
> \| Code | Description |\
> \| --- | --- |\
> \| 201 | Created |\
> \| 401 | Unauthorized |\
> \| 403 | Forbidden |\
> \| 404 | Not Found |

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Task management","description":""}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}}},"schemas":{"Task":{"type":"object","required":["name","status","priority","assignee"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdBy":{"type":"string","format":"uuid","readOnly":true},"updatedBy":{"type":"string","format":"uuid","readOnly":true},"createdByName":{"type":"string","readOnly":true},"updatedByName":{"type":"string","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"status":{"$ref":"#/components/schemas/TaskStatus"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"patient":{"$ref":"#/components/schemas/IndexedNamed","description":"Set automatically from the path patientId when created via the Goal Task endpoint."},"assignee":{"$ref":"#/components/schemas/TaskUser"},"watchers":{"type":"array","items":{"$ref":"#/components/schemas/TaskUser"}},"comments":{"type":"array","items":{"$ref":"#/components/schemas/TaskComment"}},"goalId":{"type":"string","format":"uuid","nullable":true,"readOnly":true},"templateName":{"type":"string","nullable":true},"createdType":{"$ref":"#/components/schemas/TaskCreatedType"},"sourceId":{"type":"string","format":"uuid","nullable":true},"sourceType":{"$ref":"#/components/schemas/TaskSourceType"},"hiddenPhi":{"type":"boolean"},"watchersType":{"$ref":"#/components/schemas/WatchersType","default":"POINT_OF_CONTACT"}}},"TaskStatus":{"type":"string","enum":["TODO","IN_PROGRESS","COMPLETED","CANCELED"]},"TaskPriority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"]},"IndexedNamed":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}}},"TaskUser":{"allOf":[{"$ref":"#/components/schemas/IndexedNamed"},{"type":"object","properties":{"enabled":{"type":"boolean","nullable":true}}}]},"TaskComment":{"type":"object","required":["text"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"author":{"$ref":"#/components/schemas/TaskUser"},"text":{"type":"string"},"patient":{"$ref":"#/components/schemas/IndexedNamed"},"user":{"$ref":"#/components/schemas/IndexedNamed"}}},"TaskCreatedType":{"type":"string","enum":["AUTOMATION","USER"]},"TaskSourceType":{"type":"string","enum":["ASSESSMENT"]},"WatchersType":{"type":"string","enum":["POINT_OF_CONTACT","CARE_TEAM"]}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/tasks":{"post":{"summary":"Create new Task","tags":["Task management"],"operationId":"Create_new_Task","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"}],"responses":{"201":{"description":"Task created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"### Example overview\n\nA new task is created with the name `Patient Review` with the description `New Patient Profile Review` and the priority `URGENT` and comment `Lorem ipsum...`. The task assigned to user with id `20eb246e-8099-4c7c-854c-5e0f9a366ddb`. The task visible for users specified in the fields `author`, `assignee`, `watchers` (in our example, this is the same user). The task must be completed by `May 20, 2021`.\n\nThe method allows you to add a comment to the task being created. This update allows adding comments to tasks through the API on behalf of a patient. If patient information is not included, the comment will default to being attributed to the API client.\n\n### HTTP Request\n\n**Method**: _**POST**_\n\n**Endpoint**: `{url}/{tenantName}/{instanceName}/tasks`\n\nin our example it would be: `https://api.live.welkincloud.io/gh/sb-demo/tasks`\n\n**Parameters**\n\n| Name | Located in | Description | Required | Type |\n| --- | --- | --- | --- | --- |\n| tenantName | path | Name of tenant | Yes | string |\n| instanceName | path | Name of instance | Yes | string |\n| name | body | Short name of the task | Yes | string |\n| description | body | Detailed text description of the task | No | string |\n| priority | body | task priority | Yes | `LOW`, `MEDIUM`, `HIGH`, `URGENT` |\n| status | body | task status | Yes | `TODO`, `IN_PROGRESS`, `COMPLETED`, `CANCELED` |\n| dueDate | body | deadline for the task | No | Datetime in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format |\n| assignee | body | user responsible for the task | Yes | `{\"id\": \"\"}` |\n| patient | body | task-related patient | No | `{\"id\": \"\"}` |\n| watchers | body | users subscribed to task notifications | No | \\[`{\"id\": \"\"}`\\] |\n| comments | body | simple text comments to task | No | \\[`{\"text\": \"\"}`\\] |\n\n**Responses**\n\n| Code | Description |\n| --- | --- |\n| 201 | Created |\n| 401 | Unauthorized |\n| 403 | Forbidden |\n| 404 | Not Found |","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}}}}}}
```

## Bulk update of Tasks status

> \### Example overview\
> \
> Update tasks status for list of tasks (only one task in example). Method returns a list of updated tasks.\
> \
> \### HTTP Request\
> \
> \*\*Method\*\*: \*\*\*PATCH\*\*\*\
> \
> \*\*Endpoint\*\*: \`{url}/{tenantName}/{instanceName}/tasks\`\
> \
> in our example it would be: \`<https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a\\`\\>
> \
> \*\*Parameters\*\*\
> \
> \| Name | Located in | Description | Required | Type |\
> \| --- | --- | --- | --- | --- |\
> \| tenantName | path | Name of tenant | Yes | string |\
> \| instanceName | path | Name of instance | Yes | string |\
> \| taskIds | body | Task identifiers | Yes | \\\[\`UUID\`\\] |\
> \| status | body | task status | Yes | \`TODO\`, \`IN\_PROGRESS\`, \`COMPLETED\`, \`CANCELED\` |\
> \
> \*\*Responses\*\*\
> \
> \| Code | Description |\
> \| --- | --- |\
> \| 200 | OK |\
> \| 401 | Unauthorized |\
> \| 403 | Forbidden |\
> \| 404 | Not Found |

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Task management","description":""}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}}},"schemas":{"Task":{"type":"object","required":["name","status","priority","assignee"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdBy":{"type":"string","format":"uuid","readOnly":true},"updatedBy":{"type":"string","format":"uuid","readOnly":true},"createdByName":{"type":"string","readOnly":true},"updatedByName":{"type":"string","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"status":{"$ref":"#/components/schemas/TaskStatus"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"patient":{"$ref":"#/components/schemas/IndexedNamed","description":"Set automatically from the path patientId when created via the Goal Task endpoint."},"assignee":{"$ref":"#/components/schemas/TaskUser"},"watchers":{"type":"array","items":{"$ref":"#/components/schemas/TaskUser"}},"comments":{"type":"array","items":{"$ref":"#/components/schemas/TaskComment"}},"goalId":{"type":"string","format":"uuid","nullable":true,"readOnly":true},"templateName":{"type":"string","nullable":true},"createdType":{"$ref":"#/components/schemas/TaskCreatedType"},"sourceId":{"type":"string","format":"uuid","nullable":true},"sourceType":{"$ref":"#/components/schemas/TaskSourceType"},"hiddenPhi":{"type":"boolean"},"watchersType":{"$ref":"#/components/schemas/WatchersType","default":"POINT_OF_CONTACT"}}},"TaskStatus":{"type":"string","enum":["TODO","IN_PROGRESS","COMPLETED","CANCELED"]},"TaskPriority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"]},"IndexedNamed":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}}},"TaskUser":{"allOf":[{"$ref":"#/components/schemas/IndexedNamed"},{"type":"object","properties":{"enabled":{"type":"boolean","nullable":true}}}]},"TaskComment":{"type":"object","required":["text"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"author":{"$ref":"#/components/schemas/TaskUser"},"text":{"type":"string"},"patient":{"$ref":"#/components/schemas/IndexedNamed"},"user":{"$ref":"#/components/schemas/IndexedNamed"}}},"TaskCreatedType":{"type":"string","enum":["AUTOMATION","USER"]},"TaskSourceType":{"type":"string","enum":["ASSESSMENT"]},"WatchersType":{"type":"string","enum":["POINT_OF_CONTACT","CARE_TEAM"]},"TaskBulkUpdateRequest":{"type":"object","required":["taskIds","status"],"properties":{"taskIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1},"status":{"$ref":"#/components/schemas/TaskStatus"}}}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/tasks":{"patch":{"summary":"Bulk update of Tasks status","tags":["Task management"],"operationId":"Bulk_update_of_Tasks_status","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"}],"responses":{"200":{"description":"Updated tasks","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Task"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"### Example overview\n\nUpdate tasks status for list of tasks (only one task in example). Method returns a list of updated tasks.\n\n### HTTP Request\n\n**Method**: ***PATCH***\n\n**Endpoint**: `{url}/{tenantName}/{instanceName}/tasks`\n\nin our example it would be: `https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a`\n\n**Parameters**\n\n| Name | Located in | Description | Required | Type |\n| --- | --- | --- | --- | --- |\n| tenantName | path | Name of tenant | Yes | string |\n| instanceName | path | Name of instance | Yes | string |\n| taskIds | body | Task identifiers | Yes | \\[`UUID`\\] |\n| status | body | task status | Yes | `TODO`, `IN_PROGRESS`, `COMPLETED`, `CANCELED` |\n\n**Responses**\n\n| Code | Description |\n| --- | --- |\n| 200 | OK |\n| 401 | Unauthorized |\n| 403 | Forbidden |\n| 404 | Not Found |","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskBulkUpdateRequest"}}}}}}}}
```

## Get Task by ID

> \### Example overview\
> \
> Get complete information about one task by ID\
> \
> \### HTTP Request\
> \
> \*\*Method\*\*: \*\*\*GET\*\*\*\
> \
> \*\*Endpoint\*\*: \`{url}/{tenantName}/{instanceName}/tasks/{taskId}\`\
> \
> in our example it would be: \`<https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a\\`\\>
> \
> \*\*Responses\*\*\
> \
> \| Code | Description |\
> \| --- | --- |\
> \| 200 | OK |\
> \| 401 | Unauthorized |\
> \| 403 | Forbidden |\
> \| 404 | Not Found |

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Task management","description":""}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}},"TaskId":{"name":"taskId","in":"path","required":true,"description":"UUID of the task","schema":{"type":"string","format":"uuid"}}},"schemas":{"Task":{"type":"object","required":["name","status","priority","assignee"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdBy":{"type":"string","format":"uuid","readOnly":true},"updatedBy":{"type":"string","format":"uuid","readOnly":true},"createdByName":{"type":"string","readOnly":true},"updatedByName":{"type":"string","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"status":{"$ref":"#/components/schemas/TaskStatus"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"patient":{"$ref":"#/components/schemas/IndexedNamed","description":"Set automatically from the path patientId when created via the Goal Task endpoint."},"assignee":{"$ref":"#/components/schemas/TaskUser"},"watchers":{"type":"array","items":{"$ref":"#/components/schemas/TaskUser"}},"comments":{"type":"array","items":{"$ref":"#/components/schemas/TaskComment"}},"goalId":{"type":"string","format":"uuid","nullable":true,"readOnly":true},"templateName":{"type":"string","nullable":true},"createdType":{"$ref":"#/components/schemas/TaskCreatedType"},"sourceId":{"type":"string","format":"uuid","nullable":true},"sourceType":{"$ref":"#/components/schemas/TaskSourceType"},"hiddenPhi":{"type":"boolean"},"watchersType":{"$ref":"#/components/schemas/WatchersType","default":"POINT_OF_CONTACT"}}},"TaskStatus":{"type":"string","enum":["TODO","IN_PROGRESS","COMPLETED","CANCELED"]},"TaskPriority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"]},"IndexedNamed":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}}},"TaskUser":{"allOf":[{"$ref":"#/components/schemas/IndexedNamed"},{"type":"object","properties":{"enabled":{"type":"boolean","nullable":true}}}]},"TaskComment":{"type":"object","required":["text"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"author":{"$ref":"#/components/schemas/TaskUser"},"text":{"type":"string"},"patient":{"$ref":"#/components/schemas/IndexedNamed"},"user":{"$ref":"#/components/schemas/IndexedNamed"}}},"TaskCreatedType":{"type":"string","enum":["AUTOMATION","USER"]},"TaskSourceType":{"type":"string","enum":["ASSESSMENT"]},"WatchersType":{"type":"string","enum":["POINT_OF_CONTACT","CARE_TEAM"]}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/tasks/{taskId}":{"get":{"summary":"Get Task by ID","tags":["Task management"],"operationId":"Get_Task_by_ID","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"},{"$ref":"#/components/parameters/TaskId"}],"responses":{"200":{"description":"Task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"### Example overview\n\nGet complete information about one task by ID\n\n### HTTP Request\n\n**Method**: ***GET***\n\n**Endpoint**: `{url}/{tenantName}/{instanceName}/tasks/{taskId}`\n\nin our example it would be: `https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a`\n\n**Responses**\n\n| Code | Description |\n| --- | --- |\n| 200 | OK |\n| 401 | Unauthorized |\n| 403 | Forbidden |\n| 404 | Not Found |"}}}}
```

## Partial update Task

> \### Example overview\
> \
> Updated \`name\`, \`dueDate\`, \`status\`, \`priority\` fields\
> \
> \### HTTP Request\
> \
> \*\*Method\*\*: \*\*\*PATCH\*\*\*\
> \
> \*\*Endpoint\*\*: \`{url}/{tenantName}/{instanceName}/tasks/{taskId}\`\
> \
> in our example it would be: \`<https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a\\`\\>
> \
> \*\*Parameters\*\*\
> \
> \| Name | Located in | Description | Required | Type |\
> \| --- | --- | --- | --- | --- |\
> \| tenantName | path | Name of tenant | Yes | string |\
> \| instanceName | path | Name of instance | Yes | string |\
> \| taskId | path | Task identifier | Yes | UUID |\
> \| name | body | Short name of the task | Yes | string |\
> \| description | body | Detailed text description of the task | No | string |\
> \| priority | body | task priority | Yes | \`LOW\`, \`MEDIUM\`, \`HIGH\`, \`URGENT\` |\
> \| status | body | task status | Yes | \`TODO\`, \`IN\_PROGRESS\`, \`COMPLETED\`, \`CANCELED\` |\
> \| dueDate | body | deadline for the task | No | Datetime in \[ISO-8601]\(<https://en.wikipedia.org/wiki/ISO\\_8601>) format |\
> \| assignee | body | user responsible for the task | Yes | \`{"id": ""}\` |\
> \| patient | body | task-related patient | No | \`{"id": ""}\` |\
> \
> \*\*Responses\*\*\
> \
> \| Code | Description |\
> \| --- | --- |\
> \| 200 | OK |\
> \| 401 | Unauthorized |\
> \| 403 | Forbidden |\
> \| 404 | Not Found |

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Task management","description":""}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}},"TaskId":{"name":"taskId","in":"path","required":true,"description":"UUID of the task","schema":{"type":"string","format":"uuid"}}},"schemas":{"Task":{"type":"object","required":["name","status","priority","assignee"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdBy":{"type":"string","format":"uuid","readOnly":true},"updatedBy":{"type":"string","format":"uuid","readOnly":true},"createdByName":{"type":"string","readOnly":true},"updatedByName":{"type":"string","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"status":{"$ref":"#/components/schemas/TaskStatus"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"patient":{"$ref":"#/components/schemas/IndexedNamed","description":"Set automatically from the path patientId when created via the Goal Task endpoint."},"assignee":{"$ref":"#/components/schemas/TaskUser"},"watchers":{"type":"array","items":{"$ref":"#/components/schemas/TaskUser"}},"comments":{"type":"array","items":{"$ref":"#/components/schemas/TaskComment"}},"goalId":{"type":"string","format":"uuid","nullable":true,"readOnly":true},"templateName":{"type":"string","nullable":true},"createdType":{"$ref":"#/components/schemas/TaskCreatedType"},"sourceId":{"type":"string","format":"uuid","nullable":true},"sourceType":{"$ref":"#/components/schemas/TaskSourceType"},"hiddenPhi":{"type":"boolean"},"watchersType":{"$ref":"#/components/schemas/WatchersType","default":"POINT_OF_CONTACT"}}},"TaskStatus":{"type":"string","enum":["TODO","IN_PROGRESS","COMPLETED","CANCELED"]},"TaskPriority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"]},"IndexedNamed":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}}},"TaskUser":{"allOf":[{"$ref":"#/components/schemas/IndexedNamed"},{"type":"object","properties":{"enabled":{"type":"boolean","nullable":true}}}]},"TaskComment":{"type":"object","required":["text"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"author":{"$ref":"#/components/schemas/TaskUser"},"text":{"type":"string"},"patient":{"$ref":"#/components/schemas/IndexedNamed"},"user":{"$ref":"#/components/schemas/IndexedNamed"}}},"TaskCreatedType":{"type":"string","enum":["AUTOMATION","USER"]},"TaskSourceType":{"type":"string","enum":["ASSESSMENT"]},"WatchersType":{"type":"string","enum":["POINT_OF_CONTACT","CARE_TEAM"]},"TaskPartialUpdateRequest":{"type":"object","description":"Partial update — all fields optional.","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"status":{"$ref":"#/components/schemas/TaskStatus"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"patient":{"$ref":"#/components/schemas/IndexedNamed","nullable":true},"assignee":{"$ref":"#/components/schemas/IndexedNamed"}}}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/tasks/{taskId}":{"patch":{"summary":"Partial update Task","tags":["Task management"],"operationId":"Partial_update_Task","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"},{"$ref":"#/components/parameters/TaskId"}],"responses":{"200":{"description":"Updated task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"### Example overview\n\nUpdated `name`, `dueDate`, `status`, `priority` fields\n\n### HTTP Request\n\n**Method**: ***PATCH***\n\n**Endpoint**: `{url}/{tenantName}/{instanceName}/tasks/{taskId}`\n\nin our example it would be: `https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a`\n\n**Parameters**\n\n| Name | Located in | Description | Required | Type |\n| --- | --- | --- | --- | --- |\n| tenantName | path | Name of tenant | Yes | string |\n| instanceName | path | Name of instance | Yes | string |\n| taskId | path | Task identifier | Yes | UUID |\n| name | body | Short name of the task | Yes | string |\n| description | body | Detailed text description of the task | No | string |\n| priority | body | task priority | Yes | `LOW`, `MEDIUM`, `HIGH`, `URGENT` |\n| status | body | task status | Yes | `TODO`, `IN_PROGRESS`, `COMPLETED`, `CANCELED` |\n| dueDate | body | deadline for the task | No | Datetime in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format |\n| assignee | body | user responsible for the task | Yes | `{\"id\": \"\"}` |\n| patient | body | task-related patient | No | `{\"id\": \"\"}` |\n\n**Responses**\n\n| Code | Description |\n| --- | --- |\n| 200 | OK |\n| 401 | Unauthorized |\n| 403 | Forbidden |\n| 404 | Not Found |","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskPartialUpdateRequest"}}}}}}}}
```

## Add watcher to Task

> \### Example overview\
> \
> The method allows you to subscribe the specified user to task update notifications. Method returns task with new watchers.\
> \
> \### HTTP Request\
> \
> \*\*Method\*\*: \*\*\*PATCH\*\*\*\
> \
> \*\*Endpoint\*\*: \`{url}/{tenantName}/{instanceName}/tasks/{taskId}/watchers\`\
> \
> in our example it would be: \`<https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a/watchers\\`\\>
> \
> \*\*Responses\*\*\
> \
> \| Code | Description |\
> \| --- | --- |\
> \| 200 | OK |\
> \| 401 | Unauthorized |\
> \| 403 | Forbidden |\
> \| 404 | Not Found |

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Task management","description":""}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}},"TaskId":{"name":"taskId","in":"path","required":true,"description":"UUID of the task","schema":{"type":"string","format":"uuid"}}},"schemas":{"Task":{"type":"object","required":["name","status","priority","assignee"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdBy":{"type":"string","format":"uuid","readOnly":true},"updatedBy":{"type":"string","format":"uuid","readOnly":true},"createdByName":{"type":"string","readOnly":true},"updatedByName":{"type":"string","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"status":{"$ref":"#/components/schemas/TaskStatus"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"patient":{"$ref":"#/components/schemas/IndexedNamed","description":"Set automatically from the path patientId when created via the Goal Task endpoint."},"assignee":{"$ref":"#/components/schemas/TaskUser"},"watchers":{"type":"array","items":{"$ref":"#/components/schemas/TaskUser"}},"comments":{"type":"array","items":{"$ref":"#/components/schemas/TaskComment"}},"goalId":{"type":"string","format":"uuid","nullable":true,"readOnly":true},"templateName":{"type":"string","nullable":true},"createdType":{"$ref":"#/components/schemas/TaskCreatedType"},"sourceId":{"type":"string","format":"uuid","nullable":true},"sourceType":{"$ref":"#/components/schemas/TaskSourceType"},"hiddenPhi":{"type":"boolean"},"watchersType":{"$ref":"#/components/schemas/WatchersType","default":"POINT_OF_CONTACT"}}},"TaskStatus":{"type":"string","enum":["TODO","IN_PROGRESS","COMPLETED","CANCELED"]},"TaskPriority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"]},"IndexedNamed":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}}},"TaskUser":{"allOf":[{"$ref":"#/components/schemas/IndexedNamed"},{"type":"object","properties":{"enabled":{"type":"boolean","nullable":true}}}]},"TaskComment":{"type":"object","required":["text"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"author":{"$ref":"#/components/schemas/TaskUser"},"text":{"type":"string"},"patient":{"$ref":"#/components/schemas/IndexedNamed"},"user":{"$ref":"#/components/schemas/IndexedNamed"}}},"TaskCreatedType":{"type":"string","enum":["AUTOMATION","USER"]},"TaskSourceType":{"type":"string","enum":["ASSESSMENT"]},"WatchersType":{"type":"string","enum":["POINT_OF_CONTACT","CARE_TEAM"]}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/tasks/{taskId}/watchers":{"patch":{"summary":"Add watcher to Task","tags":["Task management"],"operationId":"Add_watcher_to_Task","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"},{"$ref":"#/components/parameters/TaskId"}],"responses":{"200":{"description":"Task with watcher added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"### Example overview\n\nThe method allows you to subscribe the specified user to task update notifications. Method returns task with new watchers.\n\n### HTTP Request\n\n**Method**: ***PATCH***\n\n**Endpoint**: `{url}/{tenantName}/{instanceName}/tasks/{taskId}/watchers`\n\nin our example it would be: `https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a/watchers`\n\n**Responses**\n\n| Code | Description |\n| --- | --- |\n| 200 | OK |\n| 401 | Unauthorized |\n| 403 | Forbidden |\n| 404 | Not Found |","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndexedNamed"}}}}}}}}
```

## Remove watcher from Task

> \### Example overview\
> \
> The method allows you to unsubscribe the specified user from task. Method returns task without removed watchers.\
> \
> \### HTTP Request\
> \
> \*\*Method\*\*: \*\*\*DELETE\*\*\*\
> \
> \*\*Endpoint\*\*: \`{url}/{tenantName}/{instanceName}/tasks/{taskId}/watchers/{watcherId}\`\
> \
> in our example it would be: \`<https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a/watchers/20745195-bf3d-46af-9e74-db60c19b7e7b\\`\\>
> \
> \*\*Responses\*\*\
> \
> \| Code | Description |\
> \| --- | --- |\
> \| 200 | OK |\
> \| 401 | Unauthorized |\
> \| 403 | Forbidden |\
> \| 404 | Not Found |

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Task management","description":""}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}},"TaskId":{"name":"taskId","in":"path","required":true,"description":"UUID of the task","schema":{"type":"string","format":"uuid"}}},"schemas":{"Task":{"type":"object","required":["name","status","priority","assignee"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdBy":{"type":"string","format":"uuid","readOnly":true},"updatedBy":{"type":"string","format":"uuid","readOnly":true},"createdByName":{"type":"string","readOnly":true},"updatedByName":{"type":"string","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"status":{"$ref":"#/components/schemas/TaskStatus"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"patient":{"$ref":"#/components/schemas/IndexedNamed","description":"Set automatically from the path patientId when created via the Goal Task endpoint."},"assignee":{"$ref":"#/components/schemas/TaskUser"},"watchers":{"type":"array","items":{"$ref":"#/components/schemas/TaskUser"}},"comments":{"type":"array","items":{"$ref":"#/components/schemas/TaskComment"}},"goalId":{"type":"string","format":"uuid","nullable":true,"readOnly":true},"templateName":{"type":"string","nullable":true},"createdType":{"$ref":"#/components/schemas/TaskCreatedType"},"sourceId":{"type":"string","format":"uuid","nullable":true},"sourceType":{"$ref":"#/components/schemas/TaskSourceType"},"hiddenPhi":{"type":"boolean"},"watchersType":{"$ref":"#/components/schemas/WatchersType","default":"POINT_OF_CONTACT"}}},"TaskStatus":{"type":"string","enum":["TODO","IN_PROGRESS","COMPLETED","CANCELED"]},"TaskPriority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"]},"IndexedNamed":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}}},"TaskUser":{"allOf":[{"$ref":"#/components/schemas/IndexedNamed"},{"type":"object","properties":{"enabled":{"type":"boolean","nullable":true}}}]},"TaskComment":{"type":"object","required":["text"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"author":{"$ref":"#/components/schemas/TaskUser"},"text":{"type":"string"},"patient":{"$ref":"#/components/schemas/IndexedNamed"},"user":{"$ref":"#/components/schemas/IndexedNamed"}}},"TaskCreatedType":{"type":"string","enum":["AUTOMATION","USER"]},"TaskSourceType":{"type":"string","enum":["ASSESSMENT"]},"WatchersType":{"type":"string","enum":["POINT_OF_CONTACT","CARE_TEAM"]}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/tasks/{taskId}/watchers/{watcherId}":{"delete":{"summary":"Remove watcher from Task","tags":["Task management"],"operationId":"Remove_watcher_from_Task","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"},{"$ref":"#/components/parameters/TaskId"},{"name":"watcherId","in":"path","required":true,"description":"`watcherId` path parameter","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Task with watcher removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"### Example overview\n\nThe method allows you to unsubscribe the specified user from task. Method returns task without removed watchers.\n\n### HTTP Request\n\n**Method**: ***DELETE***\n\n**Endpoint**: `{url}/{tenantName}/{instanceName}/tasks/{taskId}/watchers/{watcherId}`\n\nin our example it would be: `https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a/watchers/20745195-bf3d-46af-9e74-db60c19b7e7b`\n\n**Responses**\n\n| Code | Description |\n| --- | --- |\n| 200 | OK |\n| 401 | Unauthorized |\n| 403 | Forbidden |\n| 404 | Not Found |"}}}}
```

## Add comment to Task

> \### Example overview\
> \
> The method allows you to add a comment to a specific task.\
> \
> If only "text" is passed in the request body, the Care Portal will display that the comment was added by an API-client.\
> \
> If a “user” block is passed in the request body, the Care Portal will display that the comment was added by the user whose id is specified in the request\
> \
> If a “patient” block is passed in the request body, the Care Portal will display that the comment was added by the patient whose id is specified in the request\
> \
> \### HTTP Request\
> \
> \*\*Method\*\*: \_\*\*PATCH\*\*\_\
> \
> \*\*Endpoint\*\*: \`{url}/{tenantName}/{instanceName}/tasks/{taskId}/comments\`\
> \
> in our example it would be: \`<https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a/comments\\`\\>
> \
> \*\*Responses\*\*\
> \
> \| Code | Description |\
> \| --- | --- |\
> \| 200 | OK |\
> \| 401 | Unauthorized |\
> \| 403 | Forbidden |\
> \| 404 | Not Found |

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Task management","description":""}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}},"TaskId":{"name":"taskId","in":"path","required":true,"description":"UUID of the task","schema":{"type":"string","format":"uuid"}}},"schemas":{"Task":{"type":"object","required":["name","status","priority","assignee"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdBy":{"type":"string","format":"uuid","readOnly":true},"updatedBy":{"type":"string","format":"uuid","readOnly":true},"createdByName":{"type":"string","readOnly":true},"updatedByName":{"type":"string","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"status":{"$ref":"#/components/schemas/TaskStatus"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"patient":{"$ref":"#/components/schemas/IndexedNamed","description":"Set automatically from the path patientId when created via the Goal Task endpoint."},"assignee":{"$ref":"#/components/schemas/TaskUser"},"watchers":{"type":"array","items":{"$ref":"#/components/schemas/TaskUser"}},"comments":{"type":"array","items":{"$ref":"#/components/schemas/TaskComment"}},"goalId":{"type":"string","format":"uuid","nullable":true,"readOnly":true},"templateName":{"type":"string","nullable":true},"createdType":{"$ref":"#/components/schemas/TaskCreatedType"},"sourceId":{"type":"string","format":"uuid","nullable":true},"sourceType":{"$ref":"#/components/schemas/TaskSourceType"},"hiddenPhi":{"type":"boolean"},"watchersType":{"$ref":"#/components/schemas/WatchersType","default":"POINT_OF_CONTACT"}}},"TaskStatus":{"type":"string","enum":["TODO","IN_PROGRESS","COMPLETED","CANCELED"]},"TaskPriority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"]},"IndexedNamed":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}}},"TaskUser":{"allOf":[{"$ref":"#/components/schemas/IndexedNamed"},{"type":"object","properties":{"enabled":{"type":"boolean","nullable":true}}}]},"TaskComment":{"type":"object","required":["text"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"author":{"$ref":"#/components/schemas/TaskUser"},"text":{"type":"string"},"patient":{"$ref":"#/components/schemas/IndexedNamed"},"user":{"$ref":"#/components/schemas/IndexedNamed"}}},"TaskCreatedType":{"type":"string","enum":["AUTOMATION","USER"]},"TaskSourceType":{"type":"string","enum":["ASSESSMENT"]},"WatchersType":{"type":"string","enum":["POINT_OF_CONTACT","CARE_TEAM"]}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/tasks/{taskId}/comments":{"patch":{"summary":"Add comment to Task","tags":["Task management"],"operationId":"Add_comment_to_Task","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"},{"$ref":"#/components/parameters/TaskId"}],"responses":{"200":{"description":"Task with comment added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"### Example overview\n\nThe method allows you to add a comment to a specific task.\n\nIf only \"text\" is passed in the request body, the Care Portal will display that the comment was added by an API-client.\n\nIf a “user” block is passed in the request body, the Care Portal will display that the comment was added by the user whose id is specified in the request\n\nIf a “patient” block is passed in the request body, the Care Portal will display that the comment was added by the patient whose id is specified in the request\n\n### HTTP Request\n\n**Method**: _**PATCH**_\n\n**Endpoint**: `{url}/{tenantName}/{instanceName}/tasks/{taskId}/comments`\n\nin our example it would be: `https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a/comments`\n\n**Responses**\n\n| Code | Description |\n| --- | --- |\n| 200 | OK |\n| 401 | Unauthorized |\n| 403 | Forbidden |\n| 404 | Not Found |","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskComment"}}}}}}}}
```

## Remove comment from Task

> \### Example overview\
> \
> The method allows you to remove unnecessary comments. Method returns task without removed watchers.\
> \
> \### HTTP Request\
> \
> \*\*Method\*\*: \*\*\*DELETE\*\*\*\
> \
> \*\*Endpoint\*\*: \`{url}/{tenantName}/{instanceName}/tasks/{taskId}/comments/{commentId}\`\
> \
> in our example it would be: \`<https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a/comments/20745195-bf3d-46af-9e74-db60c19b7e7b\\`\\>
> \
> \*\*Responses\*\*\
> \
> \| Code | Description |\
> \| --- | --- |\
> \| 200 | OK |\
> \| 401 | Unauthorized |\
> \| 403 | Forbidden |\
> \| 404 | Not Found |

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Task management","description":""}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}},"TaskId":{"name":"taskId","in":"path","required":true,"description":"UUID of the task","schema":{"type":"string","format":"uuid"}}},"schemas":{"Task":{"type":"object","required":["name","status","priority","assignee"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdBy":{"type":"string","format":"uuid","readOnly":true},"updatedBy":{"type":"string","format":"uuid","readOnly":true},"createdByName":{"type":"string","readOnly":true},"updatedByName":{"type":"string","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"status":{"$ref":"#/components/schemas/TaskStatus"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"patient":{"$ref":"#/components/schemas/IndexedNamed","description":"Set automatically from the path patientId when created via the Goal Task endpoint."},"assignee":{"$ref":"#/components/schemas/TaskUser"},"watchers":{"type":"array","items":{"$ref":"#/components/schemas/TaskUser"}},"comments":{"type":"array","items":{"$ref":"#/components/schemas/TaskComment"}},"goalId":{"type":"string","format":"uuid","nullable":true,"readOnly":true},"templateName":{"type":"string","nullable":true},"createdType":{"$ref":"#/components/schemas/TaskCreatedType"},"sourceId":{"type":"string","format":"uuid","nullable":true},"sourceType":{"$ref":"#/components/schemas/TaskSourceType"},"hiddenPhi":{"type":"boolean"},"watchersType":{"$ref":"#/components/schemas/WatchersType","default":"POINT_OF_CONTACT"}}},"TaskStatus":{"type":"string","enum":["TODO","IN_PROGRESS","COMPLETED","CANCELED"]},"TaskPriority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"]},"IndexedNamed":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}}},"TaskUser":{"allOf":[{"$ref":"#/components/schemas/IndexedNamed"},{"type":"object","properties":{"enabled":{"type":"boolean","nullable":true}}}]},"TaskComment":{"type":"object","required":["text"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"author":{"$ref":"#/components/schemas/TaskUser"},"text":{"type":"string"},"patient":{"$ref":"#/components/schemas/IndexedNamed"},"user":{"$ref":"#/components/schemas/IndexedNamed"}}},"TaskCreatedType":{"type":"string","enum":["AUTOMATION","USER"]},"TaskSourceType":{"type":"string","enum":["ASSESSMENT"]},"WatchersType":{"type":"string","enum":["POINT_OF_CONTACT","CARE_TEAM"]}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/tasks/{taskId}/comments/{commentId}":{"delete":{"summary":"Remove comment from Task","tags":["Task management"],"operationId":"Remove_comment_from_Task","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"},{"$ref":"#/components/parameters/TaskId"},{"name":"commentId","in":"path","required":true,"description":"`commentId` path parameter","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Task with comment removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"### Example overview\n\nThe method allows you to remove unnecessary comments. Method returns task without removed watchers.\n\n### HTTP Request\n\n**Method**: ***DELETE***\n\n**Endpoint**: `{url}/{tenantName}/{instanceName}/tasks/{taskId}/comments/{commentId}`\n\nin our example it would be: `https://api.live.welkincloud.io/gh/sb-demo/tasks/28b38060-db66-4183-bcaa-34751308573a/comments/20745195-bf3d-46af-9e74-db60c19b7e7b`\n\n**Responses**\n\n| Code | Description |\n| --- | --- |\n| 200 | OK |\n| 401 | Unauthorized |\n| 403 | Forbidden |\n| 404 | Not Found |"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.welkinhealth.com/api-reference/task-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
