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

# Collection tasks

Collection tasks gather diagnostic files, such as logs, from the system's nodes using the Collection Data Manager. This endpoint returns tasks that are currently running, plus tasks that ended in a Failed state in the last 24 hours.

Use it to start a one-time collection, for example when Silk Support asks for diagnostics. You can run a predefined task, or a dynamic task where you choose the files and nodes to collect from. You can also check a task's progress or delete it.

## GET /collect/collection\_task

> List collection tasks

```json
{"openapi":"3.0.3","info":{"title":"Silk RESTful API","version":"9.5.20"},"tags":[{"name":"Collection tasks","description":"Collection tasks gather diagnostic files, such as logs, from the system's nodes using the Collection Data Manager. This endpoint returns tasks that are currently running, plus tasks that ended in a Failed state in the last 24 hours.\n\nUse it to start a one-time collection, for example when Silk Support asks for diagnostics. You can run a predefined task, or a dynamic task where you choose the files and nodes to collect from. You can also check a task's progress or delete it."}],"servers":[{"url":"https://{host-address}/api/v2","description":"Your Silk Data Pod (SDP)","variables":{"host-address":{"default":"sdp.example.com","description":"Management address of your SDP."}}}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"HTTP Basic authentication. The server responds only to HTTPS requests. Access to object URLs, operations, and fields depends on the user's role (for example `admin` or `viewer`)."}},"parameters":{"limit":{"name":"__limit","in":"query","schema":{"type":"integer"},"description":"Caps the number of returned entities. Requires a sort parameter when paging."},"offset":{"name":"__offset","in":"query","schema":{"type":"integer"},"description":"Returns results starting from this offset. Requires a sort parameter when paging."},"sort":{"name":"__sort","in":"query","schema":{"type":"string"},"description":"Comma-separated object properties to sort by."},"sort_order":{"name":"__sort_order","in":"query","schema":{"type":"string","enum":["asc","desc"]},"description":"Sort direction."}},"schemas":{"Collection":{"type":"object","properties":{"hits":{"type":"array","items":{},"description":"The matching objects."},"limit":{"type":"integer","description":"Page size."},"offset":{"type":"integer","description":"Offset of the first returned object."},"total":{"type":"integer","description":"Total number of matching objects."}}},"CollectCollectionTask":{"type":"object","properties":{"clean_all":{"type":"boolean"},"creation_timestamp":{"type":"string"},"execution_timestamp":{"type":"string"},"fail_reason":{"nullable":true},"id":{"type":"integer"},"is_failed":{"type":"boolean"},"name":{"type":"string"},"priority":{"type":"integer"},"stage":{"type":"string"},"stage_repeated_times":{"type":"integer"},"status":{"type":"string"},"task_definition":{"type":"object","properties":{"id":{"type":"integer"},"table_name":{"type":"string"}}},"task_definition_id":{"type":"integer"},"tid":{"nullable":true},"type":{"type":"string"}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Readable description of the error."}}}},"responses":{"Error":{"description":"Error. See the **Errors** page for status codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/collect/collection_task":{"get":{"tags":["Collection tasks"],"summary":"List collection tasks","operationId":"listCollectCollectionTask","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"},{"$ref":"#/components/parameters/sort"},{"$ref":"#/components/parameters/sort_order"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Collection"},{"type":"object","properties":{"hits":{"type":"array","items":{"$ref":"#/components/schemas/CollectCollectionTask"}}}}]}}}},"default":{"$ref":"#/components/responses/Error"}}}}}}
```

## Create a collection task

> \`is\_dynamic\` defaults to \`false\`.

```json
{"openapi":"3.0.3","info":{"title":"Silk RESTful API","version":"9.5.20"},"tags":[{"name":"Collection tasks","description":"Collection tasks gather diagnostic files, such as logs, from the system's nodes using the Collection Data Manager. This endpoint returns tasks that are currently running, plus tasks that ended in a Failed state in the last 24 hours.\n\nUse it to start a one-time collection, for example when Silk Support asks for diagnostics. You can run a predefined task, or a dynamic task where you choose the files and nodes to collect from. You can also check a task's progress or delete it."}],"servers":[{"url":"https://{host-address}/api/v2","description":"Your Silk Data Pod (SDP)","variables":{"host-address":{"default":"sdp.example.com","description":"Management address of your SDP."}}}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"HTTP Basic authentication. The server responds only to HTTPS requests. Access to object URLs, operations, and fields depends on the user's role (for example `admin` or `viewer`)."}},"schemas":{"CollectCollectionTask":{"type":"object","properties":{"clean_all":{"type":"boolean"},"creation_timestamp":{"type":"string"},"execution_timestamp":{"type":"string"},"fail_reason":{"nullable":true},"id":{"type":"integer"},"is_failed":{"type":"boolean"},"name":{"type":"string"},"priority":{"type":"integer"},"stage":{"type":"string"},"stage_repeated_times":{"type":"integer"},"status":{"type":"string"},"task_definition":{"type":"object","properties":{"id":{"type":"integer"},"table_name":{"type":"string"}}},"task_definition_id":{"type":"integer"},"tid":{"nullable":true},"type":{"type":"string"}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Readable description of the error."}}}},"responses":{"Error":{"description":"Error. See the **Errors** page for status codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/collect/collection_task":{"post":{"tags":["Collection tasks"],"summary":"Create a collection task","operationId":"createCollectCollectionTask","description":"`is_dynamic` defaults to `false`.","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectCollectionTask"}}}},"default":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Dynamic task (is_dynamic: true)","properties":{"is_dynamic":{"type":"boolean","description":"Whether the task is dynamic. Default `false`."},"name":{"type":"string"},"files":{"type":"string"},"nodes":{"type":"string"},"priority":{"type":"integer"},"prepare_files_timeout":{"type":"integer"},"collect_files_timeout":{"type":"integer"},"description":{"type":"string"},"delay":{"type":"integer"},"no_events":{"type":"boolean"}},"required":["is_dynamic","name","files","nodes","priority"]},{"type":"object","title":"Predefined task (is_dynamic: false)","properties":{"task":{"type":"string"},"priority":{"type":"integer"},"is_dynamic":{"type":"boolean","description":"Whether the task is dynamic. Default `false`."},"dnode_names":{"type":"string"},"cnode_names":{"type":"string"}},"required":["task","priority"]}]}}}}}}}}
```

## GET /collect/collection\_task/{id}

> Get a collection task

```json
{"openapi":"3.0.3","info":{"title":"Silk RESTful API","version":"9.5.20"},"tags":[{"name":"Collection tasks","description":"Collection tasks gather diagnostic files, such as logs, from the system's nodes using the Collection Data Manager. This endpoint returns tasks that are currently running, plus tasks that ended in a Failed state in the last 24 hours.\n\nUse it to start a one-time collection, for example when Silk Support asks for diagnostics. You can run a predefined task, or a dynamic task where you choose the files and nodes to collect from. You can also check a task's progress or delete it."}],"servers":[{"url":"https://{host-address}/api/v2","description":"Your Silk Data Pod (SDP)","variables":{"host-address":{"default":"sdp.example.com","description":"Management address of your SDP."}}}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"HTTP Basic authentication. The server responds only to HTTPS requests. Access to object URLs, operations, and fields depends on the user's role (for example `admin` or `viewer`)."}},"schemas":{"CollectCollectionTask":{"type":"object","properties":{"clean_all":{"type":"boolean"},"creation_timestamp":{"type":"string"},"execution_timestamp":{"type":"string"},"fail_reason":{"nullable":true},"id":{"type":"integer"},"is_failed":{"type":"boolean"},"name":{"type":"string"},"priority":{"type":"integer"},"stage":{"type":"string"},"stage_repeated_times":{"type":"integer"},"status":{"type":"string"},"task_definition":{"type":"object","properties":{"id":{"type":"integer"},"table_name":{"type":"string"}}},"task_definition_id":{"type":"integer"},"tid":{"nullable":true},"type":{"type":"string"}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Readable description of the error."}}}},"responses":{"Error":{"description":"Error. See the **Errors** page for status codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/collect/collection_task/{id}":{"get":{"tags":["Collection tasks"],"summary":"Get a collection task","operationId":"getCollectCollectionTask","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectCollectionTask"}}}},"default":{"$ref":"#/components/responses/Error"}}}}}}
```

## DELETE /collect/collection\_task/{id}

> Delete a collection task

```json
{"openapi":"3.0.3","info":{"title":"Silk RESTful API","version":"9.5.20"},"tags":[{"name":"Collection tasks","description":"Collection tasks gather diagnostic files, such as logs, from the system's nodes using the Collection Data Manager. This endpoint returns tasks that are currently running, plus tasks that ended in a Failed state in the last 24 hours.\n\nUse it to start a one-time collection, for example when Silk Support asks for diagnostics. You can run a predefined task, or a dynamic task where you choose the files and nodes to collect from. You can also check a task's progress or delete it."}],"servers":[{"url":"https://{host-address}/api/v2","description":"Your Silk Data Pod (SDP)","variables":{"host-address":{"default":"sdp.example.com","description":"Management address of your SDP."}}}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"HTTP Basic authentication. The server responds only to HTTPS requests. Access to object URLs, operations, and fields depends on the user's role (for example `admin` or `viewer`)."}},"responses":{"Error":{"description":"Error. See the **Errors** page for status codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string","description":"Readable description of the error."}}}}},"paths":{"/collect/collection_task/{id}":{"delete":{"tags":["Collection tasks"],"summary":"Delete a collection task","operationId":"deleteCollectCollectionTask","responses":{"204":{"description":"No content"},"default":{"$ref":"#/components/responses/Error"}}}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.silk.us/api-reference/endpoints/collection/collection-tasks.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
