# Change the site's settings. Theme values are validated against the token list

`PUT /hosting/sites/{id}/settings` · Rivier · hosting

Change the site's settings. Theme values are validated against the token list.

- Scope: hosting:write
- Graphql: Mutation.hostingSettingsSave
- Sdk: hosting.settings.save
- Cli: hosting settings save

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "baseUrl": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200
        },
        {
          "type": "null"
        }
      ]
    },
    "apiBase": {
      "type": "string",
      "maxLength": 200
    },
    "publishableKey": {
      "type": "string",
      "maxLength": 200
    },
    "assetBase": {
      "type": "string",
      "maxLength": 200
    },
    "theme": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "defaultLocale": {
      "type": "string",
      "maxLength": 20
    },
    "locales": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 20
      },
      "minItems": 1,
      "maxItems": 30
    },
    "aiDisclosure": {
      "type": "string",
      "maxLength": 300
    },
    "organization": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "maxLength": 120
            },
            "logoUrl": {
              "type": "string",
              "maxLength": 300
            },
            "sameAs": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              },
              "maxItems": 10
            },
            "telephone": {
              "type": "string",
              "maxLength": 40
            },
            "email": {
              "type": "string",
              "maxLength": 120
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "analytics": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "off",
            "cookieless",
            "consent"
          ]
        }
      },
      "required": [
        "mode"
      ],
      "additionalProperties": false
    },
    "localePaths": {
      "type": "string",
      "enum": [
        "prefix-except-default",
        "prefix"
      ]
    },
    "surface": {
      "type": "string",
      "enum": [
        "website",
        "app",
        "both"
      ]
    },
    "collections": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{1,39}$"
          },
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{0,59}$"
          },
          "title": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1
          },
          "description": {
            "type": "string",
            "maxLength": 400,
            "default": ""
          },
          "projectIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 200,
            "default": []
          }
        },
        "required": [
          "id",
          "slug",
          "title"
        ],
        "additionalProperties": false
      },
      "maxItems": 30
    },
    "approvals": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "required": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5
            },
            "roles": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "owner",
                  "manager",
                  "approver"
                ]
              },
              "minItems": 1,
              "maxItems": 3
            }
          },
          "required": [
            "required",
            "roles"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "pwa": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "name": {
          "type": "string",
          "maxLength": 60
        },
        "shortName": {
          "type": "string",
          "maxLength": 14
        },
        "themeColor": {
          "type": "string",
          "maxLength": 7
        },
        "backgroundColor": {
          "type": "string",
          "maxLength": 7
        },
        "display": {
          "type": "string",
          "enum": [
            "standalone",
            "minimal-ui",
            "browser"
          ]
        },
        "startPath": {
          "type": "string",
          "maxLength": 120
        },
        "iconAssetId192": {
          "type": "string",
          "format": "uuid"
        },
        "iconAssetId512": {
          "type": "string",
          "format": "uuid"
        }
      },
      "required": [
        "enabled",
        "name",
        "shortName",
        "themeColor",
        "backgroundColor",
        "display",
        "startPath"
      ],
      "additionalProperties": false
    },
    "redirects": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "maxLength": 120
          },
          "to": {
            "type": "string",
            "maxLength": 300
          },
          "status": {
            "type": "number",
            "enum": [
              301,
              302,
              307,
              308,
              410
            ]
          }
        },
        "required": [
          "from",
          "to",
          "status"
        ],
        "additionalProperties": false
      },
      "maxItems": 500
    },
    "feeds": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "maxLength": 60
          },
          "format": {
            "type": "string",
            "enum": [
              "rss",
              "atom",
              "json"
            ]
          },
          "type": {
            "type": "string",
            "maxLength": 40
          },
          "title": {
            "type": "string",
            "maxLength": 120
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          }
        },
        "required": [
          "path",
          "format",
          "type",
          "title"
        ],
        "additionalProperties": false
      },
      "maxItems": 10
    }
  },
  "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}/settings' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "baseUrl": "string",
  "apiBase": "string",
  "publishableKey": "string",
  "assetBase": "string",
  "theme": {},
  "defaultLocale": "string",
  "locales": [
    "string"
  ]
}'
```
