## Set the order of a scope's automations (desk:admin, or a maintainer of the space)

`POST /api/desk/v1/automations/reorder`

Module: Desk · operationId: `reorderDeskAutomations` · Tag: Automation · Auth: access token (`Authorization: Bearer <accessToken>`)

Scope `tenant`: `desk:admin`. Scope `space:<id>`: `desk:admin` or a maintainer of the space – the same people who manage the flows scoped to the space; others get 403. `ids` names every automation of the scope exactly once (else 400 `ids`). Automations that listen to the same event run in this order, the tenant's before the space's.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `scope` | query | string | yes | Whose automations: `tenant` (every space) or `space:<space id>` |

### Request body

`application/json` (required)

- `ids` (array of string (uuid), required)

Example:

```json
{
  "ids": [
    "8c5d6e7f-9a0b-4c1d-8e3f-5a6b7c8d9e02",
    "8c5d6e7f-9a0b-4c1d-8e3f-5a6b7c8d9e01"
  ]
}
```

### Responses

- **204** Reordered
- **400** Error (`application/json`)
- **403** Error (`application/json`)
- **404** Error (`application/json`)

### Example request

```bash
curl -X POST 'https://api.mbcom.cloud/api/desk/v1/automations/reorder?scope=tenant' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"ids":["8c5d6e7f-9a0b-4c1d-8e3f-5a6b7c8d9e02","8c5d6e7f-9a0b-4c1d-8e3f-5a6b7c8d9e01"]}'
```
