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

# Tasks

## Get Tasks

> Returns a list of “Remedial Action“ tasks. Other types, such as “Create Assessment”, are not included.

```json
{"openapi":"3.1.1","info":{"title":"RiskBase API","version":"0.0.1"},"tags":[{"name":"Tasks","description":""}],"servers":[{"url":"https://api3.riskbase.uk"}],"security":[{"Bearer Authentication":[]}],"components":{"securitySchemes":{"Bearer Authentication":{"type":"http","scheme":"bearer","description":"`Authorization: Bearer {AuthorizationToken}`"}}},"paths":{"/tasks":{"get":{"tags":["Tasks"],"summary":"Get Tasks","description":"Returns a list of “Remedial Action“ tasks. Other types, such as “Create Assessment”, are not included.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":1000,"default":1000},"in":"query","name":"limit"},{"schema":{"type":"integer","default":1},"in":"query","name":"page"},{"schema":{"type":"string"},"in":"query","name":"task","description":"Comma separated task IDs"},{"schema":{"type":"string","default":"notstarted,inprogress"},"in":"query","name":"status","description":"Comma separated status IDs<br>See `GET /tasks/statuses`"},{"schema":{"type":"string"},"in":"query","name":"property","description":"Comma separated property IDs"},{"schema":{"type":"string"},"in":"query","name":"asset","deprecated":true,"description":"Use `property` instead"},{"schema":{"type":"boolean","default":false},"in":"query","name":"includeusers","description":"Include names and emails of assigned users"},{"schema":{"type":"boolean","default":false},"in":"query","name":"includeteams","description":"Include names of assigned teams"},{"schema":{"type":"boolean","default":false},"in":"query","name":"includecategories","description":"Include names of categories"},{"schema":{"type":"boolean","default":false},"in":"query","name":"includeseverities","description":"Include names of severities"},{"schema":{"type":"boolean","default":false},"in":"query","name":"includetimescales","description":"Include names of timescales"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"total":{"type":"integer"},"tasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"UID"},"property":{"type":"string","format":"UID","description":"ID of property this task belongs to"},"asset":{"type":"string","format":"UID","deprecated":true,"description":"Use `property` instead"},"element":{"type":["string","null"],"description":"ID of element this task is linked to","format":"UID"},"reference":{"type":"string","format":"RB-XXXXXX"},"customReference":{"type":"string"},"status":{"type":"string","description":"See ``GET /tasks/statuses``"},"what":{"type":"string"},"why":{"type":"string"},"location":{"type":"string"},"dueDate":{"type":["date","null"],"format":"Y-m-d"},"category":{"type":["string","null"],"format":"UID"},"severity":{"type":["string","null"],"format":"UID"},"timescale":{"type":["string","null"],"format":"UID"},"assignedTeams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"manual":{"type":"boolean","description":"Team manually assigned"},"auto":{"type":"boolean","description":"Team automatically assigned by category"}}}},"assignedUsers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"manual":{"type":"boolean","description":"User manually assigned"},"auto":{"type":"boolean","description":"User automatically assigned by team"}}}},"photoIds":{"type":"array","items":{"type":"string","format":"UID"}}}}},"users":{"type":"array","description":"Present if `includeusers=1`","items":{"type":"object","properties":{"id":{"type":"string","format":"UID"},"email":{"type":"string","format":"email"},"name":{"type":"string"}}}},"teams":{"type":"array","description":"Present if `includeteams=1`","items":{"type":"object","properties":{"id":{"type":"string","format":"UID"},"name":{"type":"string"}}}},"categories":{"type":"array","description":"Present if `includecategories=1`","items":{"type":"object","properties":{"id":{"type":"string","format":"UID"},"name":{"type":"string"}}}},"severities":{"type":"array","description":"Present if `includeseverities=1`","items":{"type":"object","properties":{"id":{"type":"string","format":"UID"},"name":{"type":"string"}}}},"timescales":{"type":"array","description":"Present if `includetimescales=1`","items":{"type":"object","properties":{"id":{"type":"string","format":"UID"},"name":{"type":"string"}}}}}}}}}}}}}}
```

## Update Task Status

> See \`PATCH: Update Task Status\`<br>

```json
{"openapi":"3.1.1","info":{"title":"RiskBase API","version":"0.0.1"},"tags":[{"name":"Tasks","description":""}],"servers":[{"url":"https://api3.riskbase.uk"}],"security":[{"Bearer Authentication":[]}],"components":{"securitySchemes":{"Bearer Authentication":{"type":"http","scheme":"bearer","description":"`Authorization: Bearer {AuthorizationToken}`"}}},"paths":{"/tasks/{task}/status":{"post":{"tags":["Tasks"],"summary":"Update Task Status","description":"See `PATCH: Update Task Status`\n","deprecated":true}}}}
```

## Update Task Status

> Update a task's status\
> \- Triggers the \`task\` webhook.<br>

```json
{"openapi":"3.1.1","info":{"title":"RiskBase API","version":"0.0.1"},"tags":[{"name":"Tasks","description":""}],"servers":[{"url":"https://api3.riskbase.uk"}],"security":[{"Bearer Authentication":[]}],"components":{"securitySchemes":{"Bearer Authentication":{"type":"http","scheme":"bearer","description":"`Authorization: Bearer {AuthorizationToken}`"}}},"paths":{"/tasks/{task}/status":{"patch":{"tags":["Tasks"],"summary":"Update Task Status","description":"Update a task's status\n- Triggers the `task` webhook.\n","parameters":[{"schema":{"type":"string","format":"UID"},"in":"path","name":"task","required":true}],"requestBody":{"content":{"application/json":{"schema":{"required":["status"],"properties":{"status":{"description":"See ``GET /tasks/statuses``","type":"string","required":true},"user":{"type":["string","null"],"description":"Email or ID of the user who performed the change. If not provided or not recognised the update will be applied but the API user will be used instead"},"comment":{"type":["string","null"]},"skipWebhook":{"type":"boolean","default":false}}}}}},"responses":{"204":{"content":"application/json"},"400":{"content":{"application/json":{"schema":{"oneOf":[{"title":"TaskNotFound","properties":{"code":{"type":"TaskNotFound"},"error":{"type":"Task Not Found"}}},{"title":"TaskStatusInvalid","properties":{"code":{"type":"TaskStatusInvalid"},"error":{"type":"Task Status Invalid"}}}]}}}}}}}}}
```

## GET /tasks/statuses

> Get Task Statuses

```json
{"openapi":"3.1.1","info":{"title":"RiskBase API","version":"0.0.1"},"tags":[{"name":"Tasks","description":""}],"servers":[{"url":"https://api3.riskbase.uk"}],"security":[{"Bearer Authentication":[]}],"components":{"securitySchemes":{"Bearer Authentication":{"type":"http","scheme":"bearer","description":"`Authorization: Bearer {AuthorizationToken}`"}}},"paths":{"/tasks/statuses":{"get":{"tags":["Tasks"],"summary":"Get Task Statuses","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"statuses":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"isIncomplete":{"type":"boolean"}}}}}}}}}}}}}}
```


---

# 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:

```
GET https://docs.riskbase.uk/riskbase-docs/api/tasks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
