# Worker Tasks

## Get all worker tasks

> Returns all worker tasks.

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"3.6.0-rc"},"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"WorkersTasksDTO":{"type":"object","properties":{"createDate":{"type":"string"},"done":{"type":"boolean"},"id":{"type":"string"},"isRetryableTask":{"type":"boolean"},"processedTime":{"type":"string"},"sent":{"type":"boolean"},"taskId":{"type":"string"},"type":{"type":"string"},"updateDate":{"type":"string"}},"required":["createDate","done","id","isRetryableTask","processedTime","sent","taskId","type","updateDate"]},"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/worker-tasks":{"get":{"description":"Returns all worker tasks.","operationId":"WorkerTasksController_getAllWorkerTasks","parameters":[{"name":"pageIndex","required":false,"in":"query","description":"The number of pages to skip before starting to collect the result set","schema":{"type":"number"}},{"name":"pageSize","required":false,"in":"query","description":"The numbers of items to return","schema":{"type":"number"}},{"name":"status","required":false,"in":"query","description":"Status","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation. Returns worker tasks and count.","headers":{"X-Total-Count":{"schema":{"type":"integer"},"description":"Total items in the collection."}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkersTasksDTO"}}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Get all worker tasks","tags":["worker-tasks"]}}}}
```

## Restart task

> Restart task.

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"3.6.0-rc"},"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/worker-tasks/restart":{"post":{"description":"Restart task.","operationId":"WorkerTasksController_restartTask","parameters":[],"requestBody":{"required":true,"description":"Task restart request payload.","content":{"application/json":{"schema":{"type":"object","required":["taskId"],"properties":{"taskId":{"type":"string","description":"Worker task identifier"}}}}}},"responses":{"200":{"description":"Task restart request accepted. Empty response body.","content":{"application/json":{"schema":{"type":"object","nullable":true}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Restart task","tags":["worker-tasks"]}}}}
```

## Delete task

> Delete task.

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"3.6.0-rc"},"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/worker-tasks/delete/{taskId}":{"delete":{"description":"Delete task.","operationId":"WorkerTasksController_deleteTask","parameters":[{"name":"taskId","required":true,"in":"path","description":"Task Id","schema":{"type":"string"}}],"responses":{"200":{"description":"Task deleted. Empty response body.","content":{"application/json":{"schema":{"type":"object","nullable":true}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Delete task","tags":["worker-tasks"]}}}}
```


---

# Agent Instructions: 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://dev.guardian.hedera.com/api-reference/worker-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.
