# Create a page at a path, optionally with its block tree

`POST /hosting/sites/{id}/pages` · Rivier · hosting

Create a page at a path, optionally with its block tree.

- Scope: hosting:write
- Mcp: rivier_site_page_create
- Graphql: Mutation.hostingSitePageCreate
- Sdk: hosting.sitePage.create
- Cli: hosting site page create

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "project": {
      "type": "object",
      "properties": {
        "cover": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "assetId": {
                  "type": "string",
                  "format": "uuid"
                },
                "alt": {
                  "type": "string",
                  "maxLength": 300,
                  "default": ""
                }
              },
              "required": [
                "assetId"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "summary": {
          "type": "string",
          "maxLength": 300,
          "default": ""
        },
        "year": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1900,
              "maximum": 2200
            },
            {
              "type": "null"
            }
          ]
        },
        "client": {
          "type": "string",
          "maxLength": 120,
          "default": ""
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 60
          },
          "maxItems": 12,
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[^,\\n]{1,40}$"
          },
          "maxItems": 20,
          "default": []
        },
        "links": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "maxLength": 60
              },
              "url": {
                "type": "string",
                "format": "uri",
                "maxLength": 300
              }
            },
            "required": [
              "label",
              "url"
            ],
            "additionalProperties": false
          },
          "maxItems": 10,
          "default": []
        },
        "visibility": {
          "type": "string",
          "enum": [
            "draft",
            "public",
            "unlisted",
            "expiring",
            "password"
          ]
        },
        "expiresAt": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 40
            },
            {
              "type": "null"
            }
          ]
        },
        "order": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000
            },
            {
              "type": "null"
            }
          ]
        },
        "featured": {
          "type": "boolean"
        },
        "rights": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "creditText": {
                  "type": "string",
                  "maxLength": 200,
                  "default": ""
                },
                "copyrightNotice": {
                  "type": "string",
                  "maxLength": 200,
                  "default": ""
                },
                "licenseUrl": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri",
                      "maxLength": 300
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "acquireLicenseUrl": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri",
                      "maxLength": 300
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "password": {
          "type": "string",
          "minLength": 8,
          "maxLength": 128
        }
      },
      "additionalProperties": false
    },
    "path": {
      "type": "string",
      "maxLength": 120
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "locale": {
      "type": "string",
      "maxLength": 20
    },
    "group": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 80
        },
        {
          "type": "null"
        }
      ]
    },
    "seo": {
      "type": "object",
      "additionalProperties": {}
    },
    "tree": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": {}
      },
      "maxItems": 500,
      "description": "The page content as a list of blocks."
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": {}
      },
      "maxItems": 500,
      "description": "An alias of tree, accepted for callers that name the list blocks. Send one of the two."
    }
  },
  "required": [
    "path",
    "title"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: 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 POST 'https://api.rivier.ai/hosting/sites/{id}/pages' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "path": "string",
  "title": "string"
}'
```
