# Updates task hierarchy and subtask order.

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

Updates task hierarchy and subtask order. A moved subtask adopts the parent task's list and type, and tasks with subtasks cannot become subtasks. <Check title="Required Permissions" icon="key">The user must have permission to access the requested resource. When budget protection is on, moving a subtask with planned effort the user cannot read to another project or a private task is rejected.</Check>

## Request example

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

## Request body (application/json)

- `taskId`: string (required)

- `parentId`: string (required)

- `order`: number or null

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