# Set the order and nesting of pages

`PUT /hosting/sites/{id}/pages-order` · Rivier · hosting

Set the order and nesting of pages: the list gives each page its parent (null: top level) and its place among siblings by position. Refuses loops and parents in another language.

- Scope: hosting:write
- Graphql: Mutation.hostingSitePageOrder
- Sdk: hosting.sitePage.order
- Cli: hosting site page order

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "pages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "parentId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "parentId"
        ],
        "additionalProperties": false
      },
      "minItems": 1,
      "maxItems": 500
    }
  },
  "required": [
    "pages"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X PUT 'https://api.rivier.ai/hosting/sites/{id}/pages-order' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "pages": [
    {
      "id": "string",
      "parentId": "string"
    }
  ]
}'
```
