# Workflow

Functionality to add and change workflow events for all the API objects that support workflows.

Salaxy API v03, **Finland only**. 4 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/{apiType}/{id}/workflows`

**Returns workflow data for the given API object.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `apiType` | path | string | yes | API type for the object: calculations, payroll, workers |
| `id` | path | string | yes | Unique identifier for the API object |

Response: `WorkflowData`

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

## `POST /v03/api/{apiType}/{id}/workflows`

**Adds or updates workflow event for the given API object.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `apiType` | path | string | yes | API type for the object: calculations, payroll, workers |
| `id` | path | string | yes | Unique identifier for the API object |

Request body: `WorkflowEvent` (required)

Response: `WorkflowData`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/workflow/POST/v03/api/{apiType}/{id}/workflows)

## `GET /v03/api/{apiType}/{id}/workflows/events/{eventId}`

**Returns workflow event for the given API object and event id.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `apiType` | path | string | yes | API type for the object: calculations, payroll, workers |
| `id` | path | string | yes | Unique identifier for the API object |
| `eventId` | path | string | yes | Unique id for the event. |

Response: `WorkflowEvent`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/workflow/GET/v03/api/{apiType}/{id}/workflows/events/{eventId})

## `DELETE /v03/api/{apiType}/{id}/workflows/{eventIdOrType}`

**Deletes the workflow event from the given API object.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `apiType` | path | string | yes | API type for the object: calculations, payroll, workers |
| `id` | path | string | yes | Unique identifier for the API object |
| `eventIdOrType` | path | string | yes | Id or type of the event to delete. |

Response: `string`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/workflow/DELETE/v03/api/{apiType}/{id}/workflows/{eventIdOrType})
