# TaskRun

Views and updates the runs of the scheduled or adhoc tasks that can perform automated actions.

Salaxy API v03, **Finland only**. 8 operations. Interactive version: [REST API reference](https://code.salaxy.com/reference/rest-api.md). Machine-readable: [OpenAPI document](https://code.salaxy.com/openapi/salaxy-03.json).

**The reference wins:**
These pages are generated from the OpenAPI document. If a guide and this reference disagree about a field, follow the reference. Error responses are not in the document — see [Errors](https://code.salaxy.com/reference/errors.md).

## `GET /v03/api/task-runs`

**Performs an OData query to the search index.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `$search` | query | string |  |  |
| `$filter` | query | string |  | Specifies the logic to pull back a subset of records. |
| `$orderby` | query | string |  | Specifies the values used to sort the collection of entries. |
| `$select` | query | string |  | The $select system query option allows the clients to requests a limited set of properties for each entry. |
| `$top` | query | number |  | Specifies the subset of entries by count. |
| `$skip` | query | number |  | Specifies the count of entries to skip. |
| `$count` | query | boolean |  | Indicates whether or not to include a total entry count. |

Response: `PageResultOfTaskRunListItem`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/taskrun/GET/v03/api/task-runs)

## `POST /v03/api/task-runs`

**Updates or creates a new object**

Request body: `TaskRun` (required)

Response: `TaskRun`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/taskrun/POST/v03/api/task-runs)

## `GET /v03/api/task-runs/{id}`

**Gets a single object based on identier**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Unique identifier for the object. The indentifier should be in format id@owner if the template is a public read-only item owned by another owner. |

Response: `TaskRun`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/taskrun/GET/v03/api/task-runs/{id})

## `DELETE /v03/api/task-runs/{id}`

**Deletes an object from the storage**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Unique identifier for the object. |

Response: `string`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/taskrun/DELETE/v03/api/task-runs/{id})

## `GET /v03/api/task-runs/new`

**Factory method that creates a new object**

Response: `TaskRun`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/taskrun/GET/v03/api/task-runs/new)

## `GET /v03/api/task-runs/{id}/logs`

**Retruns log entries for the task run.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Id of the task run.. |

Response: `TaskLogEntry`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/taskrun/GET/v03/api/task-runs/{id}/logs)

## `POST /v03/api/task-runs/schedule`

**Schedules a new run for the task definition. The schedule parameter of the task definition must be defined.**

Request body: `string` (required)

Response: `TaskRun`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/taskrun/POST/v03/api/task-runs/schedule)

## `POST /v03/api/task-runs/start`

**Starts a new run immediately for the task definition.**

Request body: `string` (required)

Response: `TaskRun`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/taskrun/POST/v03/api/task-runs/start)
