Skip to content
Start here

Patch Automatic SSL/TLS Enrollment status for given zone

PATCH/zones/{zone_id}/settings/ssl_automatic_mode

The automatic system is enabled when this endpoint is hit with value in the request body is set to "auto", and disabled when the request body value is set to "custom".

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Zone Settings WriteSSL and Certificates Write
Path ParametersExpand Collapse
zone_id: string
maxLength32
Body ParametersJSONExpand Collapse
value: "auto" or "custom"

Controls enablement of Automatic SSL/TLS.

One of the following:
"auto"
"custom"
ReturnsExpand Collapse
errors: array of ResponseInfo { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
messages: array of ResponseInfo { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
result: object { id, editable, modified_on, 2 more }
id: string
editable: boolean

Whether this setting can be updated or not.

modified_on: string

Last time this setting was modified.

formatdate-time
value: "auto" or "custom"

Current setting of the automatic SSL/TLS.

One of the following:
"auto"
"custom"
next_scheduled_scan: optional string

Next time this zone will be scanned by the Automatic SSL/TLS.

formatdate-time
success: boolean

Indicates the API call's success or failure.

Patch Automatic SSL/TLS Enrollment status for given zone

curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/settings/ssl_automatic_mode \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    -d '{
          "value": "auto"
        }'
{
  "errors": [],
  "messages": [],
  "result": {
    "editable": true,
    "id": "ssl_automatic_mode",
    "modified_on": "2014-01-01T05:20:00.12345Z",
    "next_scheduled_scan": "2014-02-01T05:20:00.12345Z",
    "value": "auto"
  },
  "success": true
}
{
  "errors": [
    {
      "code": 1008,
      "message": "Invalid SSL/TLS encryption configuration value, only auto or custom accepted"
    }
  ],
  "messages": [],
  "result": {
    "editable": true,
    "id": "ssl_automatic_mode",
    "modified_on": "2014-01-01T05:20:00.12345Z",
    "value": "custom"
  },
  "success": false
}
Returns Examples
{
  "errors": [],
  "messages": [],
  "result": {
    "editable": true,
    "id": "ssl_automatic_mode",
    "modified_on": "2014-01-01T05:20:00.12345Z",
    "next_scheduled_scan": "2014-02-01T05:20:00.12345Z",
    "value": "auto"
  },
  "success": true
}
{
  "errors": [
    {
      "code": 1008,
      "message": "Invalid SSL/TLS encryption configuration value, only auto or custom accepted"
    }
  ],
  "messages": [],
  "result": {
    "editable": true,
    "id": "ssl_automatic_mode",
    "modified_on": "2014-01-01T05:20:00.12345Z",
    "value": "custom"
  },
  "success": false
}