# Publish a preview, or ask for a production release (checks must pass

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

Publish a preview, or ask for a production release (checks must pass; a person approves). A person can pass approve to do both at once.

- Scope: hosting:write
- Mcp: rivier_site_page_publish
- Graphql: Mutation.hostingSitePublish
- Sdk: hosting.site.publish
- Cli: hosting site publish

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "preview",
        "production"
      ]
    },
    "approve": {
      "type": "boolean"
    },
    "note": {
      "type": "string",
      "maxLength": 300
    },
    "pages": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "minItems": 1,
      "maxItems": 500
    },
    "remove": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "minItems": 1,
      "maxItems": 500
    },
    "at": {
      "type": "string",
      "maxLength": 40
    }
  },
  "required": [
    "kind"
  ],
  "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}/publish' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "kind": "preview"
}'
```
