# Apply the upgrade after a person approved the preview; it can be undone

`POST /hosting/sites/{id}/design-library/upgrades/{entry}/apply` · Rivier · hosting

Apply the upgrade after a person approved the preview; it can be undone.

- Scope: hosting:write
- Graphql: Mutation.hostingLibraryUpgradeApply
- Sdk: hosting.libraryUpgrade.apply
- Cli: hosting library upgrade apply

## Parameters

- `id` (path, required), string
- `entry` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "to": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]{2,60}$"
    },
    "mode": {
      "type": "string",
      "enum": [
        "light",
        "dark"
      ]
    },
    "pageId": {
      "type": "string",
      "format": "uuid"
    },
    "approve": {
      "type": "boolean"
    }
  },
  "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 POST 'https://api.rivier.ai/hosting/sites/{id}/design-library/upgrades/{entry}/apply' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "to": "string",
  "mode": "light",
  "pageId": "string",
  "approve": false
}'
```
