---
title: "Reorder Status Page Components"
description: "Sets position and group of many components in one call."
---

`PUT /api/status-pages/{id}/components/order`

Sets `sort` and `groupId` of several components in one transaction, for example after drag and drop. Every listed component and group must belong to this page; otherwise the call answers `404` and nothing is written. Components you do not list stay as they are.

## Access

Organization `admin` and `editor`. A customer-scoped user or API token only reaches pages of a customer in its scope; a page without a customer (`customerId: null`) answers it with `403` (`forbidden`). A page of another organization answers `404` (`statusPageNotFound`). Path ids take the numeric id or the `publicId`. The change is written to the organization's audit log.

## Request Body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `items` | array | Yes | 1 to 500 entries. |
| `items[].id` | number\|string | Yes | Id or `publicId` of the component. |
| `items[].groupId` | number\|string\|null | Yes | Id or `publicId` of the target group, `null` for no group. |
| `items[].sort` | number | Yes | New position, 0-100000. |

## Example (cURL)

```bash
BASE_URL="https://uptimeify.io"
TOKEN="<your-api-token>"

curl -X PUT "$BASE_URL/api/status-pages/1/components/order" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      { "id": 8, "groupId": 3, "sort": 0 },
      { "id": 7, "groupId": 3, "sort": 1 }
    ]
  }'
```

## Response

`200 OK` with every component of the page after the change, ordered by `sort`, in the same form as [List Status Page Components](/api/status-pages/list-status-page-components) (`{ items, total, page, perPage }`).

## Common errors

- `400 Bad Request` (`invalidRequestBody`) when `items` is empty, has more than 500 entries or an entry is invalid
- `400 Bad Request` (`invalidIdentifier`) when an id in the path is neither a number nor a UUID
- `401 Unauthorized` when you are not logged in
- `403 Forbidden` (`forbidden`) when your role may not do this, or for a customer-scoped caller on a page without a customer or of another customer
- `403 Forbidden` (`statusPagesModuleDisabled`) when the status pages module is not activated
- `404 Not Found` (`statusPageNotFound`) when the status page does not exist or belongs to another organization
- `404 Not Found` (`statusPageComponentNotFound`) when a listed component does not exist on this page
- `404 Not Found` (`statusPageComponentGroupNotFound`) when a listed `groupId` is not a group of this page
