# Converts subtasks to a parent task.

POST https://api.awork.com/api/v1/tasks/changesubtaskstoparent

Converts subtasks to a parent task. Convert subtasks to a parent task. If list ids are not provided it will keep the same lists as the old parent task, placing the task as last item in the lists. If multiple list ids are provided per task, the lists will be overwritten with the lists provided. In this case, if an order is not provided, it will be put as the last item in the list. <Check title="Required Permissions" icon="key">The user must have permission to access the requested resource.</Check>

## Request example

```sh
curl -X POST --globoff 'https://api.awork.com/api/v1/tasks/changesubtaskstoparent' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  --data '[
  {
    "listId": "123e4567-e89b-12d3-a456-426614174000",
    "order": 1,
    "taskId": "123e4567-e89b-12d3-a456-426614174000"
  }
]'
```

## Request body (application/json)

- `listId`: string or null

- `order`: number or null

- `taskId`: string

## Response 204

No Content

## 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"
}
```
