# Workflow Engine::Workflow Templates

**Summary:** Endpoints for Workflow Engine::Workflow Templates

- Role: [Developers](https://www.subrite.no/developers)
- Source: https://www.subrite.no/developers/workflow-engine-workflow-templates
- Updated: 2026-10-13
- Markdown index: https://www.subrite.no/developers/llms.txt

<a id="get-api-v1-automation-workflow-templates"></a>
## Get all active workflow templates

`GET /api/v1/automation/workflow-templates`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

Workflow templates retrieved successfully

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` |   |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all active workflow templates (403)](https://www.subrite.no/developers/workflow-engine-workflow-templates?md=true#get-api-v1-automation-workflow-templates).

### Example request

```bash
curl https://api.subrite.no/api/v1/automation/workflow-templates \
  --header 'Authorization: Bearer <token>'
```

<a id="get-api-v1-automation-workflow-templates-id"></a>
## Get a workflow template by ID

`GET /api/v1/automation/workflow-templates/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 200

Workflow template retrieved successfully

#### 400

Content type: `application/json` · `ErrorResponse`

badRequest

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"badRequest"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get all active workflow templates (403)](https://www.subrite.no/developers/workflow-engine-workflow-templates?md=true#get-api-v1-automation-workflow-templates).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 404

Content type: `application/json` · `ErrorResponse`

workflowTemplateNotFound

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"workflowTemplateNotFound"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "workflowTemplateNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all active workflow templates (403)](https://www.subrite.no/developers/workflow-engine-workflow-templates?md=true#get-api-v1-automation-workflow-templates).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/automation/workflow-templates/{id}' \
  --header 'Authorization: Bearer <token>'
```

<a id="post-api-v1-automation-workflow-templates-id-use"></a>
## Create a workflow from a template

`POST /api/v1/automation/workflow-templates/{id}/use`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Request body

Content type: `application/json` · Required · `UseWorkflowTemplateDto`

| Name | Type | Description |
| --- | --- | --- |
| `name` (Required) | `string` | Name for the new workflow created from template · `maxLength`: `255` |

**Example request body**

`application/json`

```json
{
  "name": "string"
}
```

### Responses

#### 201

Workflow created from template successfully

#### 400

Content type: `application/json` · `ErrorResponse`

badRequest

Same fields as [Get a workflow template by ID (400)](https://www.subrite.no/developers/workflow-engine-workflow-templates?md=true#get-api-v1-automation-workflow-templates-id).

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get all active workflow templates (403)](https://www.subrite.no/developers/workflow-engine-workflow-templates?md=true#get-api-v1-automation-workflow-templates).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 404

Content type: `application/json` · `ErrorResponse`

workflowTemplateNotFound

Same fields as [Get a workflow template by ID (404)](https://www.subrite.no/developers/workflow-engine-workflow-templates?md=true#get-api-v1-automation-workflow-templates-id).

**Example response**

`application/json`

```json
{
  "messageCode": "workflowTemplateNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all active workflow templates (403)](https://www.subrite.no/developers/workflow-engine-workflow-templates?md=true#get-api-v1-automation-workflow-templates).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/automation/workflow-templates/{id}/use' \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "string"
}'
```
