---
updatedAt: 2026-09-22T19:15:06.000Z
agentTools:
  projectIndex: https://docs.zesty.io/llms.txt
---

# Create Setting

This creates a new env settings. Available request body property values.

### Body: raw JSON

| name                  | description           |
| ---------             | --------------------- |
| category              | [string] **Required.** Unique. This will appear in the `manager-ui`. |
| keyFriendly           | [string] **Required.** Name that will be visible as label in the `manager-ui` |
| key                   | [string] **Required.** A unique no-space identifier for this setting object. |
| value                 | [string] **Required.** The default value. |
| admin                 | [boolean] **Required.** If this settings can only be access by Admin users. |
| parselyAccess         | [boolean] **Required.** If this settings can be access in parsely. |
| dataType              | [string] **Required.** Values can be either `checkbox`, `textarea`, `text` or `dropdown` |
| options               | [string] Optional comma-separated string that will be used by `checkbox` and `dropdown` datatypes.  |
| tips                  | [string] Optional description that will be shown via a tooltip. | 

**Notes**
- if `dataType` is set to `"dropdown"` `options` must contain a string value that follows this structure `"key1:value1key2:value2..."`
- if `dataType` is set to `"checkbox"` `options` must contain a string value that follows this structure `"value1,value2"`

### Available Webengine settings:
| routing    | key                              | key_friendly       | description                      |
| ---------  | -------------------------------- | ------------------ | -------------------------------- |
| general    | site_protocol                    |                    | forces TLS redirect if https. Possible value: `https:http` |
| general    | always_redirect_to_https         |                    | `1` force redirect to https, `0` ignore. Default value is `0` |
| general    | preferred_domain_prefix          |                    | `1` force add www, `0` ignore. Default value is `0` |
| general    | base_directory                   |                    |  |
| general    | add_lang_code_to_paths           |                    | Appends the language code after the domain before the full path. |
| general    | dnt-policy                       |                    | Adds DNT header _(do not track)_ if `1`, ignored if `0`. Default value is `0`. |
| general    | robots_text                      |                    | Appends the given string to the `Robots.txt` file. |
| general    | robots_on                        |                    | `1` Tells crawlers to crawl, `0` tells crawlers no crawling. Default value is `1`. |
| general    | show_domain_in_title             |                    | Add "| SITE_NAME" Where site name is the name set in "clippings:site_name" |
| general    | show_in_title                    |                    | legacy fallback to show_domain_in_title. Default value is `1`. |
| general    | media_proxy_url                  | Media Proxy URL    | URL used to proxy your media assets. See https://zesty.org/services/media-storage-micro-dam/micro-dam-domains. |
| developer  | permanent_redirect               |                    | Force redirects requested page to the URL stated, and appends path and query string, ignore if empty string |
| developer  | ajax_cors_allow_any_origin       |                    | Restricts request to the origin specified, `*` is any. Defaul value is `*`. |
| developer  | gql                              | Turn on access to GraphQL endpoints to run an Appollo GQL Server | `1` Turns on GraphQL endpoints, `0` turn off. Default value is `0`. |
| developer  | gql_origin                       | GraphQL Allow Origin | Restricts request to the origin specified, `*` is any. Defaul value is `*`. |
| developer  | auto_include_js_in_head          |                    | Adds the script link to the compiled javascript file that Zesty make from all `js` files. Default value is `1`. |
| developer  | basic_content_api_enabled        | Access to Instant JSON API for content. | [checkbox] |
| developer  | overwrite_head                   |                    |      |
| developer  | permanent_redirect               |                    | `301` Redirect every request to a different website by appending the query parameter to the given domain name. |
| security   | limit_dev_site_to_ip_whitelist   |                    | 403s to any IP not listed in when preview resolves, ignore if empty string. |
| security   | limit_live_site_to_ip_whitelist  |                    | 403s to any IP not listed in when production resolves, ignore if empty string. |
| security   | x_frame_options                  | Header: X-Frame-Options | Adds response header 'X-Frame-Options'. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options). Default value is `*`. |
| security   | strict_transport_security        | Strict-Transport-Security | Adds response header 'Strict-Transport-Security'. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security). |
| security   | content_security_policy          | Content-Security-Policy | Adds response header 'Content-Security-Policy'. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP). |
| security   | x_content_type_options           | X-Content-Type-Options | Adds response header 'X-Content-Type-Options'. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options). Default value is `nosniff`. |
| security   | referrer_policy                  | Referrer-Policy    | Adds response header 'Referrer-Policy'. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy). Default value is `unsafe-url`. |
| security   | feature_policy                   | Feature-Policy     | Adds response header 'Feature-Policy' . See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy). |
| security   | preview_lock                     |                    | [checkbox] This option on preview the preview url from being accessed when a user is not logged in. |
| security   | preview_lock_password            |                    | Password used to allow non-authenticated zesty users view this preview. |
| routing    | friendly_pagination              |                    | Default value is `0` |
| contact-form | honeypot                       | Form Honey Pot     | Value checked in a Zesty lead form post request, used to prevent bot submission, ignored if empty string |
| contact-form | safe_emails                    |                    | An allow list for override emails in a form submission |
| contact-form | sending_email                  |                    | The email address thtat is used to send from when a ZCF hidden value exists on a form. |
| contact-form | email_override                 |                    | Sends an email to the email given when a Zesty contact form is submitted. |
| seo        | canonical_tags_enabled           |                    | Values available are `0` for `CANONICAL_MODE_OFF`, `1` for `CANONICAL_MODE_ON_STRIP_PARAMS`, `2` for CANONICAL_MODE_ON_WHITELIST_PARAMS, and `3` for `CANONICAL_MODE_ON_CUSTOM_PATH`. |
| seo        | automated_feed_xml               | Automated feed.xml | Turns on/off auto generated `/feed.xml`. Default value is `1` |
| tag_managers | gtm_id                         |                    | Adds google tag manager script to the html head using the given value, if empty ignored. |
| analytics  | google_urchin_id                 |                    | Adds google analytics tag to the html head. |
| analytics  | universal_code                   |                    | Adds google analytics universal tag to the html head. Default value is `1`. |
| analytics  | google_auto_linker               |                    | Comma-separated domains (_no quotes_). Adds ga('linker:autoLink', ['domain','domain']) to the universal google tag output. |
| analytics  | display_advertising_support      |                    | Adds ga('require', 'displayfeatures'); to universal  tag output. |
| groupby    | client_key                       | GroupBy Client Key | Secret Key used to make requests for the configured endpoint. |
| groupby    | collection                       | GroupBy Default Collection | GroupBy collection to access. |
| groupby    | url                              | GroupBy Client Endpoint | GroupBy API URL base. |
| proxy      | dev                              | Root URL to proxy file store | The key is the branch. Attempts to resolve a file at the the proxy url for dev preview. |
| proxy      | live                             | Root URL to proxy file store | The key is the branch. Attempts to resolve a file at the the proxy url for live/prod. |
| i18n       | default_page                     |                    | Default i18n page sets `<link rel="alternate" href="' .$_Z['SETTINGS']['i18n']['default_page'] . '" hreflang="x-default" />`. Default value is `relative path /i18n/`. |

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "A collection of available REST endpoints scoped to your unique instance.\n\n# ZUID\nAll named resources in this API have a unique identifier called a ZUID. For example an instance ZUID would look like `8-f48cf3a682-7fthvk`. The initial prefix, e.g. `8-`, represents the type of resource it is. Every discreet resource has it's own prefix. To find a full list of supported ZUIDs and to learn more read the spec; https://github.com/zesty-io/zuid-specification\n\n# URLs\nAs you peruse the available endpoints you will see the URLs which can be requested. The following is an explanation of the URL structure and the significance of specific portions.\n\nFor example the URL https://8-f48cf3a682-7fthvk.api.zesty.io/v1/content/models/6-556370-8sh47g/items/7-b939a4-457q19/publishings/18-660e14-jpx715 would breakdown as follows:\n\n| URL portion                       | description                                                           |\n| ---                               | ---                                                                   |\n| https://                          | protocol                                                              |\n| 8-f48cf3a682-7fthvk               | Your instances unique identifier                                      |\n| .api.zesty.io/                    | domain for the API                                                    |\n| v1                                | version of the API                                                    |\n| /content/models/6-556370-8sh47g   | path to a unique content model                                        |\n| /items/7-b939a4-457q19            | path to a unique item which belongs to the prior model                |\n| /publishings/18-660e14-jpx715     | path to a unique publishings record which belongs to the prior item   |\n\n# Getting an Auth Token\nThere are two types of authorization; session and access tokens. Read more about them here https://zesty.org/apis/auth-api#user-authentication",
    "title": "Instances API",
    "contact": {},
    "version": "1.0"
  },
  "paths": {
    "/env/settings": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "description": "This creates a new env settings. Available request body property values.\n\n### Body: raw JSON\n\n| name                  | description           |\n| ---------             | --------------------- |\n| category              | [string] **Required.** Unique. This will appear in the `manager-ui`. |\n| keyFriendly           | [string] **Required.** Name that will be visible as label in the `manager-ui` |\n| key                   | [string] **Required.** A unique no-space identifier for this setting object. |\n| value                 | [string] **Required.** The default value. |\n| admin                 | [boolean] **Required.** If this settings can only be access by Admin users. |\n| parselyAccess         | [boolean] **Required.** If this settings can be access in parsely. |\n| dataType              | [string] **Required.** Values can be either `checkbox`, `textarea`, `text` or `dropdown` |\n| options               | [string] Optional comma-separated string that will be used by `checkbox` and `dropdown` datatypes.  |\n| tips                  | [string] Optional description that will be shown via a tooltip. | \n\n**Notes**\n- if `dataType` is set to `\"dropdown\"` `options` must contain a string value that follows this structure `\"key1:value1key2:value2...\"`\n- if `dataType` is set to `\"checkbox\"` `options` must contain a string value that follows this structure `\"value1,value2\"`\n\n### Available Webengine settings:\n| routing    | key                              | key_friendly       | description                      |\n| ---------  | -------------------------------- | ------------------ | -------------------------------- |\n| general    | site_protocol                    |                    | forces TLS redirect if https. Possible value: `https:http` |\n| general    | always_redirect_to_https         |                    | `1` force redirect to https, `0` ignore. Default value is `0` |\n| general    | preferred_domain_prefix          |                    | `1` force add www, `0` ignore. Default value is `0` |\n| general    | base_directory                   |                    |  |\n| general    | add_lang_code_to_paths           |                    | Appends the language code after the domain before the full path. |\n| general    | dnt-policy                       |                    | Adds DNT header _(do not track)_ if `1`, ignored if `0`. Default value is `0`. |\n| general    | robots_text                      |                    | Appends the given string to the `Robots.txt` file. |\n| general    | robots_on                        |                    | `1` Tells crawlers to crawl, `0` tells crawlers no crawling. Default value is `1`. |\n| general    | show_domain_in_title             |                    | Add \"| SITE_NAME\" Where site name is the name set in \"clippings:site_name\" |\n| general    | show_in_title                    |                    | legacy fallback to show_domain_in_title. Default value is `1`. |\n| general    | media_proxy_url                  | Media Proxy URL    | URL used to proxy your media assets. See https://zesty.org/services/media-storage-micro-dam/micro-dam-domains. |\n| developer  | permanent_redirect               |                    | Force redirects requested page to the URL stated, and appends path and query string, ignore if empty string |\n| developer  | ajax_cors_allow_any_origin       |                    | Restricts request to the origin specified, `*` is any. Defaul value is `*`. |\n| developer  | gql                              | Turn on access to GraphQL endpoints to run an Appollo GQL Server | `1` Turns on GraphQL endpoints, `0` turn off. Default value is `0`. |\n| developer  | gql_origin                       | GraphQL Allow Origin | Restricts request to the origin specified, `*` is any. Defaul value is `*`. |\n| developer  | auto_include_js_in_head          |                    | Adds the script link to the compiled javascript file that Zesty make from all `js` files. Default value is `1`. |\n| developer  | basic_content_api_enabled        | Access to Instant JSON API for content. | [checkbox] |\n| developer  | overwrite_head                   |                    |      |\n| developer  | permanent_redirect               |                    | `301` Redirect every request to a different website by appending the query parameter to the given domain name. |\n| security   | limit_dev_site_to_ip_whitelist   |                    | 403s to any IP not listed in when preview resolves, ignore if empty string. |\n| security   | limit_live_site_to_ip_whitelist  |                    | 403s to any IP not listed in when production resolves, ignore if empty string. |\n| security   | x_frame_options                  | Header: X-Frame-Options | Adds response header 'X-Frame-Options'. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options). Default value is `*`. |\n| security   | strict_transport_security        | Strict-Transport-Security | Adds response header 'Strict-Transport-Security'. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security). |\n| security   | content_security_policy          | Content-Security-Policy | Adds response header 'Content-Security-Policy'. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP). |\n| security   | x_content_type_options           | X-Content-Type-Options | Adds response header 'X-Content-Type-Options'. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options). Default value is `nosniff`. |\n| security   | referrer_policy                  | Referrer-Policy    | Adds response header 'Referrer-Policy'. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy). Default value is `unsafe-url`. |\n| security   | feature_policy                   | Feature-Policy     | Adds response header 'Feature-Policy' . See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy). |\n| security   | preview_lock                     |                    | [checkbox] This option on preview the preview url from being accessed when a user is not logged in. |\n| security   | preview_lock_password            |                    | Password used to allow non-authenticated zesty users view this preview. |\n| routing    | friendly_pagination              |                    | Default value is `0` |\n| contact-form | honeypot                       | Form Honey Pot     | Value checked in a Zesty lead form post request, used to prevent bot submission, ignored if empty string |\n| contact-form | safe_emails                    |                    | An allow list for override emails in a form submission |\n| contact-form | sending_email                  |                    | The email address thtat is used to send from when a ZCF hidden value exists on a form. |\n| contact-form | email_override                 |                    | Sends an email to the email given when a Zesty contact form is submitted. |\n| seo        | canonical_tags_enabled           |                    | Values available are `0` for `CANONICAL_MODE_OFF`, `1` for `CANONICAL_MODE_ON_STRIP_PARAMS`, `2` for CANONICAL_MODE_ON_WHITELIST_PARAMS, and `3` for `CANONICAL_MODE_ON_CUSTOM_PATH`. |\n| seo        | automated_feed_xml               | Automated feed.xml | Turns on/off auto generated `/feed.xml`. Default value is `1` |\n| tag_managers | gtm_id                         |                    | Adds google tag manager script to the html head using the given value, if empty ignored. |\n| analytics  | google_urchin_id                 |                    | Adds google analytics tag to the html head. |\n| analytics  | universal_code                   |                    | Adds google analytics universal tag to the html head. Default value is `1`. |\n| analytics  | google_auto_linker               |                    | Comma-separated domains (_no quotes_). Adds ga('linker:autoLink', ['domain','domain']) to the universal google tag output. |\n| analytics  | display_advertising_support      |                    | Adds ga('require', 'displayfeatures'); to universal  tag output. |\n| groupby    | client_key                       | GroupBy Client Key | Secret Key used to make requests for the configured endpoint. |\n| groupby    | collection                       | GroupBy Default Collection | GroupBy collection to access. |\n| groupby    | url                              | GroupBy Client Endpoint | GroupBy API URL base. |\n| proxy      | dev                              | Root URL to proxy file store | The key is the branch. Attempts to resolve a file at the the proxy url for dev preview. |\n| proxy      | live                             | Root URL to proxy file store | The key is the branch. Attempts to resolve a file at the the proxy url for live/prod. |\n| i18n       | default_page                     |                    | Default i18n page sets `<link rel=\"alternate\" href=\"' .$_Z['SETTINGS']['i18n']['default_page'] . '\" hreflang=\"x-default\" />`. Default value is `relative path /i18n/`. |",
        "tags": [
          "/env/settings"
        ],
        "summary": "Create Setting",
        "operationId": "create-setting",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/body_samples.EnvSettingsCreate"
              }
            }
          },
          "description": "Settings object to create",
          "required": true
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/body_samples.JSONResult"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/body_samples.EnvSettingsResponseSuccess"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/body_samples.EnvSettingsMissingField"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/body_samples.JSONResultUnauthorized"
                }
              }
            }
          }
        },
        "x-readme": {
          "explorer-enabled": false
        }
      }
    }
  },
  "tags": [
    {
      "description": "Settings are key value pairs datastore for controlling aspects of Zesty.io, such as creating extensions, controlling web engine behaviors, and changing user interface behaviors. Example uses are turning off public endpoints or blocking access by IP address.",
      "name": "/env/settings"
    }
  ],
  "servers": [
    {
      "url": "https://{instance_zuid}.api.zesty.io/v1",
      "variables": {
        "instance_zuid": {
          "default": "unknown"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "Bearer": {
        "description": "Type \"Bearer\" followed by a space and JWT token.",
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    },
    "schemas": {
      "body_samples.EmptyData": {
        "type": "object"
      },
      "body_samples.EnvSettingsCreate": {
        "type": "object",
        "required": [
          "admin",
          "category",
          "dataType",
          "key",
          "keyFriendly",
          "parsleyAccess",
          "value"
        ],
        "properties": {
          "admin": {
            "type": "boolean",
            "example": false
          },
          "category": {
            "type": "string",
            "example": "Boop"
          },
          "dataType": {
            "type": "string",
            "example": "dropdown"
          },
          "key": {
            "type": "string",
            "example": "Beep"
          },
          "keyFriendly": {
            "type": "string",
            "example": "Beep"
          },
          "options": {
            "type": "string",
            "example": "key1:value1;key2:value2"
          },
          "parsleyAccess": {
            "type": "boolean",
            "example": false
          },
          "tips": {
            "type": "string",
            "example": "This is a tip"
          },
          "value": {
            "type": "string",
            "example": "true"
          }
        }
      },
      "body_samples.EnvSettingsMissingField": {
        "type": "object",
        "properties": {
          "_meta": {
            "$ref": "#/components/schemas/body_samples.Meta"
          },
          "data": {
            "type": "string",
            "example": "{}"
          },
          "error": {
            "type": "string",
            "example": "Bad Request: validation error: {field_name} cannot be empty"
          }
        }
      },
      "body_samples.EnvSettingsResponseSuccess": {
        "type": "object",
        "properties": {
          "ID": {
            "type": "integer",
            "example": 1
          },
          "ZUID": {
            "type": "string",
            "example": "29-0000-0000"
          },
          "admin": {
            "type": "boolean",
            "example": false
          },
          "category": {
            "type": "string",
            "example": "Boop"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2021-06-29T20:00:00Z"
          },
          "dataType": {
            "type": "string",
            "example": "dropdown"
          },
          "key": {
            "type": "string",
            "example": "Beep"
          },
          "keyFriendly": {
            "type": "string",
            "example": "Beep"
          },
          "options": {
            "type": "string",
            "example": "key1:value1;key2:value2"
          },
          "parsleyAccess": {
            "type": "boolean",
            "example": false
          },
          "tips": {
            "type": "string",
            "example": "This is a tip"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2021-06-29T20:00:00Z"
          },
          "value": {
            "type": "string",
            "example": "true"
          }
        }
      },
      "body_samples.JSONResult": {
        "type": "object",
        "properties": {
          "_meta": {
            "$ref": "#/components/schemas/body_samples.Meta"
          },
          "data": {}
        }
      },
      "body_samples.JSONResultUnauthorized": {
        "type": "object",
        "properties": {
          "_meta": {
            "$ref": "#/components/schemas/body_samples.Meta"
          },
          "data": {
            "$ref": "#/components/schemas/body_samples.EmptyData"
          },
          "error": {
            "type": "string",
            "example": "invalid session"
          }
        }
      },
      "body_samples.Meta": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "example": 1
          },
          "offset": {
            "type": "integer",
            "example": 0
          },
          "start": {
            "type": "integer",
            "example": 0
          },
          "timestamp": {
            "type": "string",
            "example": "2024-04-11T14:49:51.039478001Z"
          },
          "totalResults": {
            "type": "integer",
            "example": 1
          }
        }
      }
    }
  }
}
```