# Creates a task template for the task bundle.

POST https://api.awork.com/api/v1/taskbundles/{taskBundleId}/tasktemplates

Creates a task template for the task bundle. It is included when the bundle is applied.

<Check title="Required Permissions" icon="key">The user must be an admin or have `task-manage-config:write` permissions.</Check>

## Request example

```sh
curl -X POST --globoff 'https://api.awork.com/api/v1/taskbundles/{taskBundleId}/tasktemplates' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  --data '{
  "name": "Wireframe layout",
  "description": "Create the wireframe layout ready to be discussed with the stakeholders",
  "isPrio": false,
  "plannedDuration": 1400,
  "relativeStartOn": 1,
  "relativeDueOn": 1,
  "typeOfWorkId": "123e4567-e89b-12d3-a456-426614174000",
  "assignedRoleId": "123e4567-e89b-12d3-a456-426614174000",
  "parentId": "123e4567-e89b-12d3-a456-426614174000",
  "subtaskOrder": 1,
  "laneOrder": 2,
  "deriveDatesFromSubtasks": true
}'
```

- path parameter `taskBundleId`: string (required). The id of the task bundle.

## Request body (application/json)

- `name`: string or null

- `description`: string or null

- `isPrio`: boolean

- `plannedDuration`: integer

- `relativeStartOn`: integer or null

- `relativeDueOn`: integer or null

- `typeOfWorkId`: string

- `assignedRoleId`: string or null

- `parentId`: string or null

- `subtaskOrder`: number or null

- `laneOrder`: integer or null

- `deriveDatesFromSubtasks`: boolean or null

## Response 200

OK

application/json

```json
{
  "name": "Wireframe layout",
  "description": "Create the wireframe layout ready to be discussed with the stakeholders",
  "isPrio": false,
  "plannedDuration": 1400,
  "relativeStartOn": 1,
  "relativeDueOn": 1,
  "typeOfWorkId": "123e4567-e89b-12d3-a456-426614174000",
  "assignedRoleId": "123e4567-e89b-12d3-a456-426614174000",
  "parentId": "123e4567-e89b-12d3-a456-426614174000",
  "subtaskOrder": 1,
  "laneOrder": 2,
  "deriveDatesFromSubtasks": true,
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "taskType": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "Sales Work",
    "description": "Tasks related to sales dept.",
    "icon": "attach_money",
    "isArchived": true,
    "createdOn": "2022-03-10T16:25:09.100Z",
    "createdBy": "123e4567-e89b-12d3-a456-426614174000",
    "updatedOn": "2022-03-10T18:55:00.500Z",
    "updatedBy": "123e4567-e89b-12d3-a456-426614174000"
  },
  "taskListTemplate": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "Concept Desing",
      "orderOfTask": 2,
      "order": 1,
      "isHiddenForConnectUsers": true
    }
  ],
  "taskDependencyTemplates": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "createdOn": "2022-03-11T15:33:47.100Z",
      "createdBy": "123e4567-e89b-12d3-a456-426614174000",
      "updatedOn": "2022-03-11T21:15:00.100Z",
      "updatedBy": "123e4567-e89b-12d3-a456-426614174000",
      "predecessorTemplateId": "f76a7b32-f279-ec11-94f6-dc984040d6c9",
      "successorTemplateId": "fc8e5a55-e96f-ec11-94f6-dc984040d6c7"
    }
  ],
  "assigneeIds": [
    "123e4567-e89b-12d3-a456-426614174000"
  ],
  "createdOn": "2022-03-14T10:12:02.100Z",
  "createdBy": "123e4567-e89b-12d3-a456-426614174000",
  "updatedOn": "2022-03-25T14:55:30.100Z",
  "updatedBy": "123e4567-e89b-12d3-a456-426614174000",
  "order": 4,
  "hasAttachments": true,
  "isRecurring": false,
  "customFields": [
    {
      "customFieldDefinitionId": "123e4567-e89b-12d3-a456-426614174000",
      "userIdValue": "123e4567-e89b-12d3-a456-426614174000",
      "clientIdValue": "123e4567-e89b-12d3-a456-426614174000",
      "numberValue": 123.45,
      "selectionOptionIdValue": "123e4567-e89b-12d3-a456-426614174000",
      "selectionOption": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "value": "Website Design",
        "color": "purple",
        "order": 0
      },
      "textValue": "S1: Business Critical",
      "dateValue": "2026-01-15T09:30:00Z",
      "booleanValue": true
    }
  ],
  "tags": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "Design",
      "color": "purple"
    }
  ]
}
```

## Response 400

Bad Request

application/json

```json
{
  "code": "not-found",
  "description": "There is no matching path for this URL.",
  "link": "https://developers.awork.com",
  "details": [
    "No project with the id '123' exists."
  ],
  "validationErrors": [
    {
      "property": "FirstName",
      "message": "FirstName is required."
    }
  ],
  "traceId": "a65ce5745df02af216715ff06661fb3a"
}
```

## Response 404

Not Found

application/json

```json
{
  "code": "not-found",
  "description": "There is no matching path for this URL.",
  "link": "https://developers.awork.com",
  "details": [
    "No project with the id '123' exists."
  ],
  "validationErrors": [
    {
      "property": "FirstName",
      "message": "FirstName is required."
    }
  ],
  "traceId": "a65ce5745df02af216715ff06661fb3a"
}
```
