Getting started

CloudFlare's API exposes the entire CloudFlare infrastructure via a standardized programmatic interface. Using CloudFlare's API, you can do just about anything you can do on cloudflare.com

The CloudFlare API is a RESTful API based on HTTPS requests and JSON responses. If you are registered with CloudFlare, you can obtain your API key from the bottom of the "My Account" page, found here: Go to My account.

Endpoints

The API is accessed by making HTTPS requests to a specific version endpoint URL, in which GET, POST, PUT, PATCH, and DELETE methods dictate how your interact with the information available. Every endpoint is accessed via the SSL-enabled HTTPS (port 443) protocol

Everything (methods, parameters, etc.) is fixed to a version number, and every call must contain one. The latest version is Version 4.

The stable HTTP endpoint for the latest version is: https://api.cloudflare.com/client/v4/

Requests

Requests are expected to be sent over HTTPS and any payload formatted in JSON. All requests must include both your X-Auth-Key and X-Auth-Email as headers to authenticate.

Required parameters

Name Format Description
API Key X-Auth-Key API generated on the "My Account" page
Email X-Auth-Email Email address associated with your account

Example request

Requests are generally formatted in the following way

GET /object/:object_id
cURL (example)
curl -X GET "https://api.cloudflare.com/client/v4/zones/cd7d0123e3012345da9420df9514dad0"\ -H "Content-Type:application/json"\ -H "X-Auth-Key:1234567893feefc5f0q5000bfo0c38d90bbeb"\ -H "X-Auth-Email:[email protected]"

Rate limiting

The CloudFlare API sets a maximum of 1,200 requests in a five minute period.

Pagination

Depending on your request, the results returned may be limited. You can page through the returned results with the following query parameters.

Name Type Description
page integer Which page of results to return
per_page integer How many results to return per page
order string Attribute name to order the responses by
direction string Either asc or desc
cURL (example)
GET /zones/:zone_identifier/dns_records
curl -X GET "https://api.cloudflare.com/client/v4/zones/cd7d068de3012345da9420df9514dad0/dns_records?page=3&per_page=20&order=type&direction=asc"\ -H "Content-Type:application/json"\ -H "X-Auth-Key:1234567893feefc5f0q5000bfo0c38d90bbeb"\ -H "X-Auth-Email:[email protected]"

Responses

Format

Each response is a JSON object. The data you requested is wrapped in the result tag. This means if you have a response, it will always be within the result field. We also include a success flag, an array of potential errors and messages in the response.

An error object will contain an integer code field and a message

Date fields will always be in UTC ISO-8601 format, including microseconds.

Success Response (example)
{ "result":{ "id":"2d4d028de3015345da9420df5514dad0", "type":"A", "name":"blog.example.com", "content":"2.6.4.5", "proxiable":true, "proxied":false, "ttl":1, "priority":0, "locked":false, "zone_id":"cd7d068de3012345da9420df9514dad0", "zone_name":"example.com", "modified_on":"2014-05-28T18:46:18.764425Z", "created_on":"2014-05-28T18:46:18.764425Z" }, "success":true, "errors":[], "messages":[] }
Error Response (example)
{ "result": {} "success": false, "errors": [{"code":1003,"message":"Invalid or missing zone id."}], "messages": [] }

HTTP response codes

The status of a response can be determined from the HTTP status code.

Code Status Description
200 OK request successful
304 Not Modified
400 Bad Request request was invalid
401 Unauthorized user does not have permission
403 Forbidden request not authenticated
405 Method Not Allowed incorrect HTTP method provided
415 Unsupported Media Type response is not valid JSON

User

The currently logged in/authenticated User

GET User details

GET /user
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/user"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "first_name": "John", "last_name": "Appleseed", "username": "cfuser12345", "telephone": "+1 123-123-1234", "country": "USA", "zipcode": "12345", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "api_key": "c2547eb745579dac9321b638f5e22ccf483cc5cfdda41", "two_factor_authentication_enabled": false } }

PATCH Update user

Update part of your user details

PATCH /user

Optional parameters

Name /type Description /example Constraints
first_name
string

User's first name
"John"

  • max length: 60
last_name
string

User's last name
"Appleseed"

  • max length: 60
telephone
string

User's telephone number
"+1 123-123-1234"

  • max length: 20
country
string

The country in which the user lives.
"USA"

  • max length: 30
zipcode
string

The zipcode or postal code where the user lives.
"12345"

  • max length: 20
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/user"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"first_name":"John","last_name":"Appleseed","telephone":"+1 123-123-1234","country":"USA","zipcode":"12345"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "first_name": "John", "last_name": "Appleseed", "username": "cfuser12345", "telephone": "+1 123-123-1234", "country": "USA", "zipcode": "12345", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "api_key": "c2547eb745579dac9321b638f5e22ccf483cc5cfdda41", "two_factor_authentication_enabled": false } }

PUT Change email address

Change your email address. Note: You must provide your current password.

PUT /user/email

Required parameters

Name /type Description /example Constraints
email
string

Your contact email address
"[email protected]"

  • max length: 90
email_confirm
string

Your contact email address
"[email protected]"

  • max length: 90
password
string

Your current password
"*******"

  • min length: 6
  • max length: 32
cURL (example)
$ curl -X PUT "https://api.cloudflare.com/client/v4/user/email"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"email":"[email protected]","email_confirm":"[email protected]","password":"*******"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "first_name": "John", "last_name": "Appleseed", "username": "cfuser12345", "telephone": "+1 123-123-1234", "country": "USA", "zipcode": "12345", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "api_key": "c2547eb745579dac9321b638f5e22ccf483cc5cfdda41", "two_factor_authentication_enabled": false } }

PUT Change password

Change your password

PUT /user/password

Required parameters

Name /type Description /example Constraints
old_password
string

Your current password
"********"

  • min length: 6
  • max length: 32
new_password
string

Your new password
"*********"

  • min length: 6
  • max length: 32
new_password_confirm
string

Your new password, repeated
"*********"

  • min length: 6
  • max length: 32
cURL (example)
$ curl -X PUT "https://api.cloudflare.com/client/v4/user/password"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"old_password":"********","new_password":"*********","new_password_confirm":"*********"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "first_name": "John", "last_name": "Appleseed", "username": "cfuser12345", "telephone": "+1 123-123-1234", "country": "USA", "zipcode": "12345", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "api_key": "c2547eb745579dac9321b638f5e22ccf483cc5cfdda41", "two_factor_authentication_enabled": false } }

PUT Change username

Change your username. Note: You must provide your current password.

PUT /user/username

Required parameters

Name /type Description /example Constraints
username
string

A username used to access other cloudflare services, like support
"cfuser12345"

  • min length: 3
  • max length: 90
password
string

Your current password
"*******"

cURL (example)
$ curl -X PUT "https://api.cloudflare.com/client/v4/user/username"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"username":"cfuser12345","password":"*******"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "first_name": "John", "last_name": "Appleseed", "username": "cfuser12345", "telephone": "+1 123-123-1234", "country": "USA", "zipcode": "12345", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "api_key": "c2547eb745579dac9321b638f5e22ccf483cc5cfdda41", "two_factor_authentication_enabled": false } }

POST Initialize Two-factor Authentication

Begin setting up CloudFlare two-factor authentication with a given telephone number

POST /user/two_factor_authentication

Required parameters

Name /type Description /example Constraints
country_code
number

The country code of your mobile phone number
1

mobile_phone_number
string

Your mobile phone number
"123-867-5309"

current_password
string

Your current CloudFlare password
"*********"

  • min length: 6
  • max length: 32
cURL (example)
$ curl -X POST "https://api.cloudflare.com/client/v4/user/two_factor_authentication"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"country_code":1,"mobile_phone_number":"123-867-5309","current_password":"*********"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "first_name": "John", "last_name": "Appleseed", "username": "cfuser12345", "telephone": "+1 123-123-1234", "country": "USA", "zipcode": "12345", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "api_key": "c2547eb745579dac9321b638f5e22ccf483cc5cfdda41", "two_factor_authentication_enabled": false } }

PUT Finalize Two-factor Authentication

Finish setting up CloudFlare two-factor authentication with a given telephone number

PUT /user/two_factor_authentication

Required parameters

Name /type Description /example Constraints
auth_token
number

The token provided by the two-factor authenticator
1234567

cURL (example)
$ curl -X PUT "https://api.cloudflare.com/client/v4/user/two_factor_authentication"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"auth_token":1234567}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "first_name": "John", "last_name": "Appleseed", "username": "cfuser12345", "telephone": "+1 123-123-1234", "country": "USA", "zipcode": "12345", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "api_key": "c2547eb745579dac9321b638f5e22ccf483cc5cfdda41", "two_factor_authentication_enabled": false } }

DELETE Disable Two-factor Authentication

Disable two-factor authentication for your CloudFlare user account

DELETE /user/two_factor_authentication

Required parameters

Name /type Description /example Constraints
auth_token
number

The token provided by the two-factor authenticator
1234567

cURL (example)
$ curl -X DELETE "https://api.cloudflare.com/client/v4/user/two_factor_authentication"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"auth_token":1234567}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "first_name": "John", "last_name": "Appleseed", "username": "cfuser12345", "telephone": "+1 123-123-1234", "country": "USA", "zipcode": "12345", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "api_key": "c2547eb745579dac9321b638f5e22ccf483cc5cfdda41", "two_factor_authentication_enabled": false } }

User: definition

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "first_name": "John", "last_name": "Appleseed", "username": "cfuser12345", "telephone": "+1 123-123-1234", "country": "USA", "zipcode": "12345", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "api_key": "c2547eb745579dac9321b638f5e22ccf483cc5cfdda41", "two_factor_authentication_enabled": false }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
email
string

Your contact email address
"[email protected]"

  • max length: 90
first_name
string

User's first name
"John"

  • max length: 60
last_name
string

User's last name
"Appleseed"

  • max length: 60
username
string

A username used to access other cloudflare services, like support
"cfuser12345"

  • min length: 3
  • max length: 90
telephone
string

User's telephone number
"+1 123-123-1234"

  • max length: 20
country
string

The country in which the user lives.
"USA"

  • max length: 30
zipcode
string

The zipcode or postal code where the user lives.
"12345"

  • max length: 20
created_on
string

When the user signed up.
"2014-01-01T05:20:00Z"

  • read only
modified_on
string

Last time the user was modified
"2014-01-01T05:20:00Z"

  • read only
api_key
string

User API key for authenticating with the API
"c2547eb745579dac9321b638f5e22ccf483cc5cfdda41"

  • max length: 45
  • read only
two_factor_authentication_enabled
boolean

Whether two-factor authentication is enabled for the user account. This does not apply to API authentication
false

  • valid values: (true,false)
  • read only
betas
array

A list of betas the user is currently participating in. If a beta is zone-specific, the beta will apply to all zones.
["new_feature"]

organizations
array

A list of the organizations the user is a member of (or invited to) and the permissions granted to them.
[{"id":"9a7806061c88ada191ed06f989cc3dac","name":"CloudFlare, Inc.","status":"member","permissions":["#zones:read"],"roles":["All Privileges - Super Administrator"]}]

  • read only

Zone

A Zone is a domain name along with its subdomains and other identities

POST Create a zone permission needed: #zone:edit

POST /zones

Required parameters

Name /type Description /example Constraints
name
string

The domain name
"example.com"

  • max length: 253
  • read only

Optional parameters

Name /type Description /example Constraints
jump_start
boolean

Automatically attempt to fetch existing DNS records
true

  • default value: true
  • valid values: (true,false)
organization
object

Organization that this zone will belong to
{"ID":"5a7805061c76ada191ed06f989cc3dac"}

Show definition »
Name /type Description /example Constraints

string

API item identifier tag
9a7806061c88ada191ed06f989cc3dac

  • max length: 32
  • read only

string

Organization Name
CloudFlare, Inc.

  • max length: 100

Status of the zone
active

  • valid values: (active, pending, initializing, moved, deleted, deactivated)
  • read only

array

Access permissions for this User

  • read only
cURL (example)
$ curl -X POST "https://api.cloudflare.com/client/v4/zones"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"name":"example.com","jump_start":true,"organization":{"id":"9a7806061c88ada191ed06f989cc3dac","name":"CloudFlare, Inc.","status":"active","permissions":["#zones:read"]}}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "example.com", "development_mode": 7200, "original_name_servers": [ "ns1.originaldnshost.com", "ns2.originaldnshost.com" ], "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name_servers": [ "tony.ns.cloudflare.com", "woz.ns.cloudflare.com" ], "owner": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "owner_type": "user" }, "permissions": [ "#zone:read", "#zone:edit" ], "plan": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "Pro Plan", "price": 20, "currency": "USD", "frequency": "monthly", "is_subscribed": true, "can_subscribe": true }, "status": "active", "paused": false, "type": "full" } }

GET List zones permission needed: #zone:read

List, search, sort, and filter your zones

GET /zones

Optional parameters

Name /type Description /example Constraints
name
string

A domain name
"example.com"

  • max length: 253
status
string

Status of the zone
"active"

  • valid values: (active, pending, initializing, moved, deleted, deactivated)
  • read only
page
number

Page number of paginated results
1

  • default value: 1
  • min value: 1
per_page
number

Number of zones per page
20

  • default value: 20
  • min value: 5
  • max value: 50
order
string

Field to order zones by
"status"

  • valid values: (name, status, email)
direction
string

Direction to order zones
"desc"

  • valid values: (asc, desc)
match
string

Whether to match all search requirements or at least one (any)
"all"

  • default value: all
  • valid values: (any, all)
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones?name=example.com&status=active&page=1&per_page=20&order=status&direction=desc&match=all"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": [ { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "example.com", "development_mode": 7200, "original_name_servers": [ "ns1.originaldnshost.com", "ns2.originaldnshost.com" ], "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name_servers": [ "tony.ns.cloudflare.com", "woz.ns.cloudflare.com" ], "owner": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "owner_type": "user" }, "permissions": [ "#zone:read", "#zone:edit" ], "plan": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "Pro Plan", "price": 20, "currency": "USD", "frequency": "monthly", "is_subscribed": true, "can_subscribe": true }, "status": "active", "paused": false, "type": "full" } ], "result_info": { "page": 1, "per_page": 20, "count": 1, "total_count": 2000 } }

GET Zone details permission needed: #zone:read

GET /zones/:identifier
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "example.com", "development_mode": 7200, "original_name_servers": [ "ns1.originaldnshost.com", "ns2.originaldnshost.com" ], "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name_servers": [ "tony.ns.cloudflare.com", "woz.ns.cloudflare.com" ], "owner": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "owner_type": "user" }, "permissions": [ "#zone:read", "#zone:edit" ], "plan": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "Pro Plan", "price": 20, "currency": "USD", "frequency": "monthly", "is_subscribed": true, "can_subscribe": true }, "status": "active", "paused": false, "type": "full" } }

PATCH Edit Zone Properties

Only one zone property can be changed at a time

PATCH /zones/:identifier

Optional parameters

Name /type Description /example Constraints
paused
boolean

Indicates if the zone is only using CloudFlare DNS services. A true value means the zone will not receive security or performance benefits.
false

  • valid values: (true,false)
  • read only
vanity_name_servers
array

An array of domains used for custom name servers. This is only available for Business and Enterprise plans.
["ns1.example.com","ns2.example.com"]

plan
object

The desired plan for the zone. Changing this value will create/cancel associated subscriptions. To view available plans for this zone, see Zone Plans

Show definition »
Name /type Description /example Constraints

string

API item identifier tag
9a7806061c88ada191ed06f989cc3dac

  • max length: 32
  • read only
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"paused":true}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "example.com", "development_mode": 7200, "original_name_servers": [ "ns1.originaldnshost.com", "ns2.originaldnshost.com" ], "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name_servers": [ "tony.ns.cloudflare.com", "woz.ns.cloudflare.com" ], "owner": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "owner_type": "user" }, "permissions": [ "#zone:read", "#zone:edit" ], "plan": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "Pro Plan", "price": 20, "currency": "USD", "frequency": "monthly", "is_subscribed": true, "can_subscribe": true }, "status": "active", "paused": false, "type": "full" } }

DELETE Purge all files permission needed: #zone:edit

Remove ALL files from CloudFlare's cache

DELETE /zones/:identifier/purge_cache

Required parameters

Name /type Description /example Constraints
purge_everything
boolean

A flag that indicates all resources in CloudFlare's cache should be removed. Note: This may have dramatic affects on your origin server load after performing this action.
true

  • valid values: (true)
cURL (example)
$ curl -X DELETE "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/purge_cache"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"purge_everything":true}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac" } }

DELETE Purge individual files permission needed: #zone:edit

Remove one or more files from CloudFlare's cache

DELETE /zones/:identifier/purge_cache

Required parameters

Name /type Description /example Constraints
files
array

An array of URLs that should be removed from cache
["http://www.example.com/css/styles.css"]

cURL (example)
$ curl -X DELETE "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/purge_cache"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"files":["http://www.example.com/css/styles.css"]}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac" } }

DELETE Delete a zone permission needed: #zone:edit

Delete an existing zone. To be able to perform this action, all plans and subscriptions must be cancelled.

DELETE /zones/:identifier
cURL (example)
$ curl -X DELETE "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac" } }

Zone: definitions

Standard zone

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "name": "example.com", "development_mode": 7200, "original_name_servers": [ "ns1.originaldnshost.com", "ns2.originaldnshost.com" ], "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "name_servers": [ "tony.ns.cloudflare.com", "woz.ns.cloudflare.com" ], "owner": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "owner_type": "user" }, "permissions": [ "#zone:read", "#zone:edit" ], "plan": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "Pro Plan", "price": 20, "currency": "USD", "frequency": "monthly", "is_subscribed": true, "can_subscribe": true }, "status": "active", "paused": false, "type": "full", "host": { "name": "Example Host", "website": "http://www.examplehost.com" }, "vanity_name_servers": [ "ns1.example.com", "ns2.example.com" ], "betas": [ "new_feature" ], "deactivation_reason": "abuse_violation", "meta": { "custom_certificate_quota": 1, "page_rule_quota": 5, "wildcard_proxiable": false, "phishing_detected": false } }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
name
string

The domain name
"example.com"

  • max length: 253
  • read only
development_mode
number

The interval (in seconds) from when development mode expires (positive integer) or last expired (negative integer) for the domain. If development mode has never been enabled, this value is 0.
7200

  • read only
original_name_servers
array

Original name servers before moving to CloudFlare
["ns1.originaldnshost.com","ns2.originaldnshost.com"]

  • read only
original_registrar
string

Registrar for the domain at the time of switching to CloudFlare
"GoDaddy"

  • read only
original_dnshost
string

DNS host at the time of switching to CloudFlare
"NameCheap"

  • max length: 50
  • read only
created_on
string

When the zone was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the zone was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
name_servers
array

CloudFlare-assigned name servers. This is only populated for zones that use CloudFlare DNS
["tony.ns.cloudflare.com","woz.ns.cloudflare.com"]

owner
object

Information about the owner of the zone
{"id":"9a7806061c88ada191ed06f989cc3dac","email":"[email protected]","owner_type":"user"}
One of the following:

A user that owns the zone
Show definition »
Name /type Description /example Constraints

string

API item identifier tag
9a7806061c88ada191ed06f989cc3dac

  • max length: 32
  • read only

string

Your contact email address
[email protected]

  • max length: 90

The type of owner of the zone
user

  • valid values: (user)
  • read only
An organization that owns the zone
Show definition »
Name /type Description /example Constraints

string

API item identifier tag
9a7806061c88ada191ed06f989cc3dac

  • max length: 32
  • read only

string

Organization Name
CloudFlare, Inc.

  • max length: 100

The type of owner of the zone
organization

  • valid values: (organization)
  • read only
permissions
array

Available permissions on the zone for the current user requesting the item
["#zone:read","#zone:edit"]

  • read only
plan
object

A zone plan
{"id":"9a7806061c88ada191ed06f989cc3dac","name":"Pro Plan","price":20,"currency":"USD","frequency":"monthly","is_subscribed":true,"can_subscribe":true}

Show definition »
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
name
string

The plan name
"Pro Plan"

  • max length: 80
  • read only
price
number

The price of the subscription that will be billed, in US dollars
20

  • read only
currency
string

The monetary unit in which pricing information is displayed
"USD"

  • read only
frequency
string

The frequency at which you will be billed for this plan
"monthly"

  • valid values: (weekly, monthly, quarterly, yearly)
  • read only
legacy_id
string

A 'friendly' identifier to indicate to the UI what plan the object is
"pro"

  • valid values: (free, pro, business, enterprise)
is_subscribed
boolean

If the zone is subscribed to this plan
true

  • valid values: (true,false)
can_subscribe
boolean

If the zone is allowed to subscribe to this plan
true

  • valid values: (true,false)
status
string

Status of the zone
"active"

  • valid values: (active, pending, initializing, moved, deleted, deactivated)
  • read only
paused
boolean

Indicates if the zone is only using CloudFlare DNS services. A true value means the zone will not receive security or performance benefits.
false

  • valid values: (true,false)
  • read only
type
string

A full zone implies that DNS is hosted with CloudFlare. A partial zone is typically a partner-hosted zone or a CNAME setup.
"full"

  • valid values: (full, partial)
  • read only
host
object

Hosting partner information, if the zone signed up via a CloudFlare hosting partner
{"name":"Hosting Company, Inc.","website":"http://www.hostingcompanyinc.com"}

Show definition »
Name /type Description /example Constraints

string

Host company name
Example Host


string

The host's website URL
http://www.examplehost.com

  • read only
vanity_name_servers
array

An array of domains used for custom name servers. This is only available for Business and Enterprise plans.
["ns1.example.com","ns2.example.com"]

betas
array

A list of beta features in which the zone is participating
["new_feature"]

deactivation_reason
string

Exists only with a deactivated status and indicates the reason the zone is not resolving on the CloudFlare network.
"abuse_violation"

  • valid values: (abuse_violation, plan_limits_exceeded)
meta
object

Metadata about the domain.

Show definition »
Name /type Description /example Constraints

number

Maximum custom certificates that can be uploaded/used.
1


number

Maximum page rules that can be created.
5


boolean

Indicates whether wildcard DNS records can receive CloudFlare security and performance features

  • valid values: (true,false)

boolean

Indicates if URLs on the zone have been identified as hosting phishing content.

  • valid values: (true,false)
  • read only

Partner-hosted/Partial zone

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "name": "example.com", "development_mode": 7200, "original_name_servers": [ "ns1.originaldnshost.com", "ns2.originaldnshost.com" ], "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "owner": { "id": "9a7806061c88ada191ed06f989cc3dac", "email": "[email protected]", "owner_type": "user" }, "permissions": [ "#zone:read", "#zone:edit" ], "plan": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "Pro Plan", "price": 20, "currency": "USD", "frequency": "monthly", "is_subscribed": true, "can_subscribe": true }, "status": "active", "paused": false, "type": "full", "host": { "name": "Example Host", "website": "http://www.examplehost.com" }, "vanity_name_servers": [ "ns1.example.com", "ns2.example.com" ], "betas": [ "new_feature" ], "deactivation_reason": "abuse_violation", "meta": { "custom_certificate_quota": 1, "page_rule_quota": 5, "wildcard_proxiable": false, "phishing_detected": false } }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
name
string

The domain name
"example.com"

  • max length: 253
  • read only
development_mode
number

The interval (in seconds) from when development mode expires (positive integer) or last expired (negative integer) for the domain. If development mode has never been enabled, this value is 0.
7200

  • read only
original_name_servers
array

Original name servers before moving to CloudFlare
["ns1.originaldnshost.com","ns2.originaldnshost.com"]

  • read only
original_registrar
string

Registrar for the domain at the time of switching to CloudFlare
"GoDaddy"

  • read only
original_dnshost
string

DNS host at the time of switching to CloudFlare
"NameCheap"

  • max length: 50
  • read only
created_on
string

When the zone was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the zone was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
owner
object

Information about the owner of the zone
{"id":"9a7806061c88ada191ed06f989cc3dac","email":"[email protected]","owner_type":"user"}
One of the following:

A user that owns the zone
Show definition »
Name /type Description /example Constraints

string

API item identifier tag
9a7806061c88ada191ed06f989cc3dac

  • max length: 32
  • read only

string

Your contact email address
[email protected]

  • max length: 90

The type of owner of the zone
user

  • valid values: (user)
  • read only
An organization that owns the zone
Show definition »
Name /type Description /example Constraints

string

API item identifier tag
9a7806061c88ada191ed06f989cc3dac

  • max length: 32
  • read only

string

Organization Name
CloudFlare, Inc.

  • max length: 100

The type of owner of the zone
organization

  • valid values: (organization)
  • read only
permissions
array

Available permissions on the zone for the current user requesting the item
["#zone:read","#zone:edit"]

  • read only
plan
object

A zone plan
{"id":"9a7806061c88ada191ed06f989cc3dac","name":"Pro Plan","price":20,"currency":"USD","frequency":"monthly","is_subscribed":true,"can_subscribe":true}

Show definition »
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
name
string

The plan name
"Pro Plan"

  • max length: 80
  • read only
price
number

The price of the subscription that will be billed, in US dollars
20

  • read only
currency
string

The monetary unit in which pricing information is displayed
"USD"

  • read only
frequency
string

The frequency at which you will be billed for this plan
"monthly"

  • valid values: (weekly, monthly, quarterly, yearly)
  • read only
legacy_id
string

A 'friendly' identifier to indicate to the UI what plan the object is
"pro"

  • valid values: (free, pro, business, enterprise)
is_subscribed
boolean

If the zone is subscribed to this plan
true

  • valid values: (true,false)
can_subscribe
boolean

If the zone is allowed to subscribe to this plan
true

  • valid values: (true,false)
status
string

Status of the zone
"active"

  • valid values: (active, pending, initializing, moved, deleted, deactivated)
  • read only
paused
boolean

Indicates if the zone is only using CloudFlare DNS services. A true value means the zone will not receive security or performance benefits.
false

  • valid values: (true,false)
  • read only
type
string

A full zone implies that DNS is hosted with CloudFlare. A partial zone is typically a partner-hosted zone or a CNAME setup.
"full"

  • valid values: (full, partial)
  • read only
host
object

Hosting partner information, if the zone signed up via a CloudFlare hosting partner
{"name":"Hosting Company, Inc.","website":"http://www.hostingcompanyinc.com"}

Show definition »
Name /type Description /example Constraints

string

Host company name
Example Host


string

The host's website URL
http://www.examplehost.com

  • read only
vanity_name_servers
array

An array of domains used for custom name servers. This is only available for Business and Enterprise plans.
["ns1.example.com","ns2.example.com"]

betas
array

A list of beta features in which the zone is participating
["new_feature"]

deactivation_reason
string

Exists only with a deactivated status and indicates the reason the zone is not resolving on the CloudFlare network.
"abuse_violation"

  • valid values: (abuse_violation, plan_limits_exceeded)
meta
object

Metadata about the domain.

Show definition »
Name /type Description /example Constraints

number

Maximum custom certificates that can be uploaded/used.
1


number

Maximum page rules that can be created.
5


boolean

Indicates whether wildcard DNS records can receive CloudFlare security and performance features

  • valid values: (true,false)

boolean

Indicates if URLs on the zone have been identified as hosting phishing content.

  • valid values: (true,false)
  • read only

Zone error codes

Code Description
1000 Invalid or missing user
1002 'name' must be a valid domain
1003 'jump_start' must be boolean
1004 Failed to assign name servers
1006 Invalid or missing zone
1008 Invalid or missing Zone id
1010 Invalid Zone
1011 Invalid or missing zone
1012 Request must contain one of 'purge_everything' or 'files'
1013 'purge_everything' must be true
1014 'files' must be an array of urls
1015 Unable to purge <url>
1016 Unable to purge any urls
1017 Unable to purge all
1018 Invalid zone status
1019 Zone is already paused
1020 Invalid or missing zone
1021 Invalid zone status
1022 Zone is already unpaused
1023 Invalid or missing zone
1024 <domain> already exists
1049 <domain> is not a registered domain
1050 <domain> is currently being tasted. It is not currently a registered domain
1051 CloudFlare is already hosting <domain>
1052 An error has occurred and it has been logged. We will fix this problem promptly. We apologize for the inconvenience
1053 <domain> is already disabled
1054 <domain> is already enabled
1055 Failed to disable <domain>
1056 preserve_ini must be a boolean
1057 Zone must be in 'initializing' status
1059 Unable to delete zone
1061 <domain> already exists
1062 Not allowed to update zone status
1063 Not allowed to update zone step
1064 Not allowed to update zone step. Bad zone status
1065 Not allowed to update zone step. Zone has already been set up
1066 Could not promote zone to step 3
1067 Invalid organization identifier passed in your organization variable
1068 Permission denied
1069 organization variable should be an organization object
1070 This operation requires a Business or Enterprise account.
1071 Vanity name server array expected.
1072 Vanity name server array cannot be empty.
1073 A name server provided is in the wrong format.
1074 Could not find a valid zone.
1075 Vanity name server array count is invalid
1076 Name servers have invalid IP addresses
1077 Could not find a valid zone.
1078 This zone has no valid vanity IPs.
1079 This zone has no valid vanity name servers.
1080 There is a conflict with one of the name servers.
1081 There are no valid vanity name servers to disable.
1082 Unable to purge '<url>'. You can only purge files for this zone
1083 Unable to purge '<url>'. Rate limit reached. Please wait if you need to perform more operations
1084 Unable to purge '<url>'.
1085 Only one property can be updated at a time
1086 Invalid property
1087 Zone is in an invalid state

Zone Plan

A zone plan

GET Available plans permission needed: #billing:read

List all plans the zone can subscribe to.

GET /zones/:zone_identifier/available_plans
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/available_plans"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": [ { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "Pro Plan", "price": 20, "currency": "USD", "frequency": "monthly", "is_subscribed": true, "can_subscribe": true } ], "result_info": { "page": 1, "per_page": 20, "count": 1, "total_count": 2000 } }

GET Plan details permission needed: #billing:read

GET /zones/:zone_identifier/available_plans/:identifier
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/available_plans/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "Pro Plan", "price": 20, "currency": "USD", "frequency": "monthly", "is_subscribed": true, "can_subscribe": true } }

Zone Plan: definition

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "name": "Pro Plan", "price": 20, "currency": "USD", "frequency": "monthly", "is_subscribed": true, "can_subscribe": true }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
name
string

The plan name
"Pro Plan"

  • max length: 80
  • read only
price
number

The price of the subscription that will be billed, in US dollars
20

  • read only
currency
string

The monetary unit in which pricing information is displayed
"USD"

  • read only
frequency
string

The frequency at which you will be billed for this plan
"monthly"

  • valid values: (weekly, monthly, quarterly, yearly)
  • read only
legacy_id
string

A 'friendly' identifier to indicate to the UI what plan the object is
"pro"

  • valid values: (free, pro, business, enterprise)
is_subscribed
boolean

If the zone is subscribed to this plan
true

  • valid values: (true,false)
can_subscribe
boolean

If the zone is allowed to subscribe to this plan
true

  • valid values: (true,false)

Zone Settings for a Zone

A Zone setting changes how the Zone works in relation to caching, security, or other features of CloudFlare

GET Get all Zone settings permission needed: #zone_settings:read

Available settings for your user in relation to a zone

GET /zones/:zone_identifier/settings
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": [ { "id": "always_online", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } ], "result_info": { "page": 1, "per_page": 20, "count": 1, "total_count": 2000 } }

GET Advanced DDOS setting permission needed: #zone_settings:read

Advanced DDOS setting. Automatically enabled for Business and Enterprise zones

GET /zones/:zone_identifier/settings/advanced_ddos
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/advanced_ddos"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "advanced_ddos", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Always Online setting permission needed: #zone_settings:read

When enabled, Always Online will serve pages from our cache if your server is offline

GET /zones/:zone_identifier/settings/always_online
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/always_online"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "always_online", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Browser Cache TTL setting permission needed: #zone_settings:read

Browser Cache TTL specifies how long CloudFlare-cached resources will remain on your visitors' computers. CloudFlare will honor any larger times specified by your server.

GET /zones/:zone_identifier/settings/browser_cache_ttl
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/browser_cache_ttl"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "browser_cache_ttl", "value": 14400, "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Browser Check setting permission needed: #zone_settings:read

Browser Integrity Check is similar to Bad Behavior and looks for common HTTP headers abused most commonly by spammers and denies access to your page. It will also challenge visitors that do not have a user agent or a non standard user agent (also commonly used by abuse bots, crawlers or visitors).

GET /zones/:zone_identifier/settings/browser_check
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/browser_check"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "browser_check", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Cache Level setting permission needed: #zone_settings:read

Cache Level functions based off the setting level. The basic setting will cache most static resources (i.e., css, images, and JavaScript). The simplified setting will ignore the query string when delivering a cached resource. The aggressive setting will cache all static resources, including ones with a query string.

GET /zones/:zone_identifier/settings/cache_level
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/cache_level"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "cache_level", "value": "aggressive", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Challenge TTL setting permission needed: #zone_settings:read

Specify how long a visitor is allowed access to your site after successfully completing a challenge (such as a CAPTCHA). After the TTL has expired the visitor will have to complete a new challenge. We recommend a 15 - 45 minute setting and will attempt to honor any setting above 45 minutes.

GET /zones/:zone_identifier/settings/challenge_ttl
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/challenge_ttl"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "challenge_ttl", "value": 1800, "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Development Mode setting permission needed: #zone_settings:read

Development Mode temporarily allows you to enter development mode for your websites if you need to make changes to your site. This will bypass CloudFlare's accelerated cache and slow down your site, but is useful if you are making changes to cacheable content (like images, css, or JavaScript) and would like to see those changes right away. Once entered, development mode will last for 3 hours and then automatically toggle off.

GET /zones/:zone_identifier/settings/development_mode
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/development_mode"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "development_mode", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z", "time_remaining": 3600 } }

GET Get Email Obfuscation setting permission needed: #zone_settings:read

Encrypt email adresses on your web page from bots, while keeping them visible to humans.

GET /zones/:zone_identifier/settings/email_obfuscation
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/email_obfuscation"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "email_obfuscation", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get IP Geolocation setting permission needed: #zone_settings:read

Enable IP Geolocation to have CloudFlare geolocate visitors to your website and pass the country code to you.

GET /zones/:zone_identifier/settings/ip_geolocation
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/ip_geolocation"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "ip_geolocation", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get IPv6 setting permission needed: #zone_settings:read

Enable IPv6 on all subdomains that are CloudFlare enabled.

GET /zones/:zone_identifier/settings/ipv6
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/ipv6"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "ipv6", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Minify setting permission needed: #zone_settings:read

Modify minify setting

GET /zones/:zone_identifier/settings/minify
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/minify"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "minify", "value": { "css": "off", "html": "off", "js": "off" }, "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Mobile Redirect setting permission needed: #zone_settings:read

Modify mobile_redirect setting

GET /zones/:zone_identifier/settings/mobile_redirect
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/mobile_redirect"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "mobile_redirect", "value": { "status": "off", "mobile_subdomain": "m", "strip_uri": false }, "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Mirage setting permission needed: #zone_settings:read

Modify mirage setting

GET /zones/:zone_identifier/settings/mirage
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/mirage"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "mirage", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Polish setting permission needed: #zone_settings:read

Strips metadata and compresses your images for faster page load times. Basic (Lossless): Reduce the size of PNG, JPEG, and GIF files - no impact on visual quality. Basic + JPEG (Lossy): Further reduce the size of JPEG files for faster image loading. Larger JPEGs are converted to progressive images, loading a lower-resolution image first and ending in a higher-resolution version. Not recommended for hi-res photography sites.

GET /zones/:zone_identifier/settings/polish
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/polish"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "polish", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Rocket Loader setting permission needed: #zone_settings:read

Rocket Loader is a general-purpose asynchronous JavaScript loader coupled with a lightweight virtual browser which can safely run any JavaScript code after window.onload. Turning on Rocket Loader will immediately improve a web page's window.onload time (assuming there is JavaScript on the page), which can have a positive impact on your Google search ranking. Automatic Mode: Rocket Loader will automatically run on the JavaScript resources on your site, with no configuration required after turning on automatic mode. Manual Mode: In order to have Rocket Loader execute for a particular script, you must add the following attribute to the script tag: "data-cfasync='true'". As your page passes through CloudFlare, we'll enable Rocket Loader for that particular script. All other JavaScript will continue to execute without CloudFlare touching the script.

GET /zones/:zone_identifier/settings/rocket_loader
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/rocket_loader"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "rocket_loader", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Security Level setting permission needed: #zone_settings:read

Choose the appropriate security profile for your website, which will automatically adjust each of the security settings. If you choose to customize an individual security setting, the profile will become Custom.

GET /zones/:zone_identifier/settings/security_level
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/security_level"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "security_level", "value": "medium", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Server Side Exclude setting permission needed: #zone_settings:read

If there is sensitive content on your website that you want visible to real visitors, but that you want to hide from suspicious visitors, all you have to do is wrap the content with CloudFlare SSE tags. Wrap any content that you want to be excluded from suspicious visitors in the following SSE tags: <!--sse--><!--/sse-->. For example: <!--sse--> Bad visitors won't see my phone number, 555-555-5555 <!--/sse-->. Note: SSE only will work with HTML. If you have HTML minification enabled, you won't see the SSE tags in your HTML source when it's served through CloudFlare. SSE will still function in this case, as CloudFlare's HTML minification and SSE functionality occur on-the-fly as the resource moves through our network to the visitor's computer.

GET /zones/:zone_identifier/settings/server_side_exclude
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/server_side_exclude"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "server_side_exclude", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get SSL setting permission needed: #zone_settings:read

SSL encrypts your visitor's connection and safeguards credit card numbers and other personal data to and from your website. SSL can take up to 5 minutes to fully activate. Requires CloudFlare active on your root domain or www domain. Off: no SSL between the visitor and CloudFlare, and no SSL between CloudFlare and your web server (all HTTP traffic). Flexible: SSL between the visitor and CloudFlare -- visitor sees HTTPS on your site, but no SSL between CloudFlare and your web server. You don't need to have an SSL cert on your web server, but your vistors will still see the site as being HTTPS enabled. Full: SSL between the visitor and CloudFlare -- visitor sees HTTPS on your site, and SSL between CloudFlare and your web server. You'll need to have your own SSL cert or self-signed cert at the very least. Full (Strict): SSL between the visitor and CloudFlare -- visitor sees HTTPS on your site, and SSL between CloudFlare and your web server. You'll need to have a valid SSL certificate installed on your web server. This certificate must be signed by a certificate authority, have an expiration date in the future, and respond for the request domain name (hostname).

GET /zones/:zone_identifier/settings/ssl
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/ssl"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "ssl", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

GET Get Web Application Firewall (WAF) setting permission needed: #zone_settings:read

The WAF examines HTTP requests to your website. It inspects both GET and POST requests and applies rules to help filter out illegitimate traffic from legitimate website visitors. The CloudFlare WAF inspects website addresses or URLs to detect anything out of the ordinary. If the CloudFlare WAF determines suspicious user behavior, then the WAF will ‘challenge’ the web visitor with a page that asks them to submit a CAPTCHA successfully to continue their action. If the challenge is failed, the action will be stopped. What this means is that CloudFlare’s WAF will block any traffic identified as illegitimate before it reaches your origin web server.

GET /zones/:zone_identifier/settings/waf
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/waf"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "waf", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Edit zone settings info permission needed: #zone_settings:edit

Edit settings for a zone

PATCH /zones/:zone_identifier/settings

Required parameters

Name /type Description /example Constraints
items
array

One or more zone setting objects. Must contain an ID and a value.
[{"id":"always_online","value":"on"}]

  • min value: 1
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"items":[{"id":"always_online","value":"on"}]}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": [ { "id": "always_online", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } ], "result_info": { "page": 1, "per_page": 20, "count": 1, "total_count": 2000 } }

PATCH Change Always Online setting permission needed: #zone_settings:edit

When enabled, Always Online will serve pages from our cache if your server is offline

PATCH /zones/:zone_identifier/settings/always_online

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"on"

  • default value: on
  • valid values: (on, off)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/always_online"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"on"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "always_online", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change Browser Cache TTL setting permission needed: #zone_settings:edit

Browser Cache TTL specifies how long CloudFlare-cached resources will remain on your visitors' computers. CloudFlare will honor any larger times specified by your server.

PATCH /zones/:zone_identifier/settings/browser_cache_ttl

Required parameters

Name /type Description /example Constraints
value
number

Value of the zone setting
14400

  • default value: 14400
  • valid values: (30, 60, 300, 1200, 1800, 7200, 10800, 14400, 18000, 28800, 43200, 57600, 72000, 86400, 172800, 259200, 345600, 432000, 691200, 1382400, 2073600, 2678400, 5356800, 16070400, 31536000)
  • notes: The minimum TTL available depends on the plan level of the zone. (Enterprise = 30, Business = 1800, Pro = 1800, Free = 1800)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/browser_cache_ttl"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":14400}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "browser_cache_ttl", "value": 14400, "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change Browser Check setting permission needed: #zone_settings:edit

Browser Integrity Check is similar to Bad Behavior and looks for common HTTP headers abused most commonly by spammers and denies access to your page. It will also challenge visitors that do not have a user agent or a non standard user agent (also commonly used by abuse bots, crawlers or visitors).

PATCH /zones/:zone_identifier/settings/browser_check

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"on"

  • default value: on
  • valid values: (on, off)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/browser_check"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"on"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "browser_check", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change Cache Level setting permission needed: #zone_settings:edit

Cache Level functions based off the setting level. The basic setting will cache most static resources (i.e., css, images, and JavaScript). The simplified setting will ignore the query string when delivering a cached resource. The aggressive setting will cache all static resources, including ones with a query string.

PATCH /zones/:zone_identifier/settings/cache_level

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"aggressive"

  • default value: aggressive
  • valid values: (aggressive, basic, simplified)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/cache_level"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"aggressive"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "cache_level", "value": "aggressive", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change Challenge TTL setting permission needed: #zone_settings:edit

Specify how long a visitor is allowed access to your site after successfully completing a challenge (such as a CAPTCHA). After the TTL has expired the visitor will have to complete a new challenge. We recommend a 15 - 45 minute setting and will attempt to honor any setting above 45 minutes.

PATCH /zones/:zone_identifier/settings/challenge_ttl

Required parameters

Name /type Description /example Constraints
value
number

Value of the zone setting
1800

  • default value: 1800
  • valid values: (300, 900, 1800, 2700, 3600, 7200, 10800, 14400, 28800, 57600, 86400, 604800, 2592000, 31536000)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/challenge_ttl"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":1800}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "challenge_ttl", "value": 1800, "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change Development Mode setting permission needed: #zone_settings:edit

Development Mode temporarily allows you to enter development mode for your websites if you need to make changes to your site. This will bypass CloudFlare's accelerated cache and slow down your site, but is useful if you are making changes to cacheable content (like images, css, or JavaScript) and would like to see those changes right away. Once entered, development mode will last for 3 hours and then automatically toggle off.

PATCH /zones/:zone_identifier/settings/development_mode

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (on, off)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/development_mode"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"off"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "development_mode", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z", "time_remaining": 3600 } }

PATCH Change Email Obfuscation setting permission needed: #zone_settings:edit

Encrypt email adresses on your web page from bots, while keeping them visible to humans.

PATCH /zones/:zone_identifier/settings/email_obfuscation

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"on"

  • default value: on
  • valid values: (on, off)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/email_obfuscation"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"on"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "email_obfuscation", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change IP Geolocation setting permission needed: #zone_settings:edit

Enable IP Geolocation to have CloudFlare geolocate visitors to your website and pass the country code to you.

PATCH /zones/:zone_identifier/settings/ip_geolocation

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"on"

  • default value: on
  • valid values: (on, off)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/ip_geolocation"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"on"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "ip_geolocation", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change IPv6 setting permission needed: #zone_settings:edit

Enable IPv6 on all subdomains that are CloudFlare enabled.

PATCH /zones/:zone_identifier/settings/ipv6

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (off, on, safe)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/ipv6"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"off"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "ipv6", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change Minify setting permission needed: #zone_settings:edit

Modify minify setting

PATCH /zones/:zone_identifier/settings/minify

Required parameters

Name /type Description /example Constraints
value
object

Value of the zone setting

Show definition »
Name /type Description /example Constraints

Automatically minify all CSS for your website

  • default value: off
  • valid values: (on, off)

Automatically minify all HTML for your website

  • default value: off
  • valid values: (on, off)

Automatically minify all JavaScript for your website

  • default value: off
  • valid values: (on, off)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/minify"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":{"css":"off","html":"off","js":"off"}}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "minify", "value": { "css": "off", "html": "off", "js": "off" }, "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change Mobile Redirect setting permission needed: #zone_settings:edit

Modify mobile_redirect setting

PATCH /zones/:zone_identifier/settings/mobile_redirect

Required parameters

Name /type Description /example Constraints
value
object

Value of the zone setting

Show definition »
Name /type Description /example Constraints

Whether or not the mobile redirection is enabled

  • default value: off
  • valid values: (on, off)

string

Which subdomain prefix you wish to redirect visitors on mobile devices to (subdomain must already exist).
m

  • min length: 1

boolean

Whether to drop the current page path and redirect to the mobile subdomain URL root or to keep the path and redirect to the same page on the mobile subdomain

  • valid values: (true,false)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/mobile_redirect"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":{"status":"off","mobile_subdomain":"m","strip_uri":false}}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "mobile_redirect", "value": { "status": "off", "mobile_subdomain": "m", "strip_uri": false }, "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change Mirage setting permission needed: #zone_settings:edit

Modify mirage setting

PATCH /zones/:zone_identifier/settings/mirage

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (on, off)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/mirage"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"off"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "mirage", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change Polish setting permission needed: #zone_settings:edit

Strips metadata and compresses your images for faster page load times. Basic (Lossless): Reduce the size of PNG, JPEG, and GIF files - no impact on visual quality. Basic + JPEG (Lossy): Further reduce the size of JPEG files for faster image loading. Larger JPEGs are converted to progressive images, loading a lower-resolution image first and ending in a higher-resolution version. Not recommended for hi-res photography sites.

PATCH /zones/:zone_identifier/settings/polish

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (off, lossless, lossy)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/polish"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"off"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "polish", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change Rocket Loader setting permission needed: #zone_settings:edit

Rocket Loader is a general-purpose asynchronous JavaScript loader coupled with a lightweight virtual browser which can safely run any JavaScript code after window.onload. Turning on Rocket Loader will immediately improve a web page's window.onload time (assuming there is JavaScript on the page), which can have a positive impact on your Google search ranking. Automatic Mode: Rocket Loader will automatically run on the JavaScript resources on your site, with no configuration required after turning on automatic mode. Manual Mode: In order to have Rocket Loader execute for a particular script, you must add the following attribute to the script tag: "data-cfasync='true'". As your page passes through CloudFlare, we'll enable Rocket Loader for that particular script. All other JavaScript will continue to execute without CloudFlare touching the script.

PATCH /zones/:zone_identifier/settings/rocket_loader

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (on, off, manual)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/rocket_loader"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"off"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "rocket_loader", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change Security Level setting permission needed: #zone_settings:edit

Choose the appropriate security profile for your website, which will automatically adjust each of the security settings. If you choose to customize an individual security setting, the profile will become Custom.

PATCH /zones/:zone_identifier/settings/security_level

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"medium"

  • default value: medium
  • valid values: (essentially_off, low, medium, high, under_attack)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/security_level"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"medium"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "security_level", "value": "medium", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change Server Side Exclude setting permission needed: #zone_settings:edit

If there is sensitive content on your website that you want visible to real visitors, but that you want to hide from suspicious visitors, all you have to do is wrap the content with CloudFlare SSE tags. Wrap any content that you want to be excluded from suspicious visitors in the following SSE tags: <!--sse--><!--/sse-->. For example: <!--sse--> Bad visitors won't see my phone number, 555-555-5555 <!--/sse-->. Note: SSE only will work with HTML. If you have HTML minification enabled, you won't see the SSE tags in your HTML source when it's served through CloudFlare. SSE will still function in this case, as CloudFlare's HTML minification and SSE functionality occur on-the-fly as the resource moves through our network to the visitor's computer.

PATCH /zones/:zone_identifier/settings/server_side_exclude

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"on"

  • default value: on
  • valid values: (on, off)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/server_side_exclude"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"on"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "server_side_exclude", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change SSL setting permission needed: #zone_settings:edit

SSL encrypts your visitor's connection and safeguards credit card numbers and other personal data to and from your website. SSL can take up to 5 minutes to fully activate. Requires CloudFlare active on your root domain or www domain. Off: no SSL between the visitor and CloudFlare, and no SSL between CloudFlare and your web server (all HTTP traffic). Flexible: SSL between the visitor and CloudFlare -- visitor sees HTTPS on your site, but no SSL between CloudFlare and your web server. You don't need to have an SSL cert on your web server, but your vistors will still see the site as being HTTPS enabled. Full: SSL between the visitor and CloudFlare -- visitor sees HTTPS on your site, and SSL between CloudFlare and your web server. You'll need to have your own SSL cert or self-signed cert at the very least. Full (Strict): SSL between the visitor and CloudFlare -- visitor sees HTTPS on your site, and SSL between CloudFlare and your web server. You'll need to have a valid SSL certificate installed on your web server. This certificate must be signed by a certificate authority, have an expiration date in the future, and respond for the request domain name (hostname).

PATCH /zones/:zone_identifier/settings/ssl

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (off, flexible, full, full_strict)
  • notes: Depends on the zone's plan level
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/ssl"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"off"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "ssl", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

PATCH Change Web Application Firewall (WAF) setting permission needed: #zone_settings:edit

The WAF examines HTTP requests to your website. It inspects both GET and POST requests and applies rules to help filter out illegitimate traffic from legitimate website visitors. The CloudFlare WAF inspects website addresses or URLs to detect anything out of the ordinary. If the CloudFlare WAF determines suspicious user behavior, then the WAF will ‘challenge’ the web visitor with a page that asks them to submit a CAPTCHA successfully to continue their action. If the challenge is failed, the action will be stopped. What this means is that CloudFlare’s WAF will block any traffic identified as illegitimate before it reaches your origin web server.

PATCH /zones/:zone_identifier/settings/waf

Required parameters

Name /type Description /example Constraints
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (on, off)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/settings/waf"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"value":"off"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "waf", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" } }

Zone Settings for a Zone: definitions

Always Online Mode

Example object
{ "id": "always_online", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"always_online"

  • valid values: (always_online)
value
string

Value of the zone setting
"on"

  • default value: on
  • valid values: (on, off)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Advanced DDoS Protection

Example object
{ "id": "advanced_ddos", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"advanced_ddos"

  • valid values: (advanced_ddos)
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (on, off)
  • notes: Defaults to on for Business+ plans
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Browser Cache TTL

Example object
{ "id": "browser_cache_ttl", "value": 14400, "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"browser_cache_ttl"

  • valid values: (browser_cache_ttl)
value
number

Value of the zone setting
14400

  • default value: 14400
  • valid values: (30, 60, 300, 1200, 1800, 7200, 10800, 14400, 18000, 28800, 43200, 57600, 72000, 86400, 172800, 259200, 345600, 432000, 691200, 1382400, 2073600, 2678400, 5356800, 16070400, 31536000)
  • notes: The minimum TTL available depends on the plan level of the zone. (Enterprise = 30, Business = 1800, Pro = 1800, Free = 1800)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Browser Check

Example object
{ "id": "browser_check", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"browser_check"

  • valid values: (browser_check)
value
string

Value of the zone setting
"on"

  • default value: on
  • valid values: (on, off)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

CloudFlare Cache Level

Example object
{ "id": "cache_level", "value": "aggressive", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"cache_level"

  • valid values: (cache_level)
value
string

Value of the zone setting
"aggressive"

  • default value: aggressive
  • valid values: (aggressive, basic, simplified)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Challenge Page TTL

Example object
{ "id": "challenge_ttl", "value": 1800, "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"challenge_ttl"

  • valid values: (challenge_ttl)
value
number

Value of the zone setting
1800

  • default value: 1800
  • valid values: (300, 900, 1800, 2700, 3600, 7200, 10800, 14400, 28800, 57600, 86400, 604800, 2592000, 31536000)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Development Mode

Example object
{ "id": "development_mode", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z", "time_remaining": 3600 }
Name /type Description /example Constraints
id
string

ID of the zone setting
"development_mode"

  • valid values: (development_mode)
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (on, off)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

time_remaining
number

Value of the zone setting
3600

  • notes: The interval (in seconds) from when development mode expires (positive integer) or last expired (negative integer) for the domain. If development mode has never been enabled, this value is false.

Edge Cache TTL

Example object
{ "id": "edge_cache_ttl", "value": 14400, "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"edge_cache_ttl"

  • valid values: (edge_cache_ttl)
value
number

Value of the zone setting
14400

  • default value: 14400
  • valid values: (30, 60, 300, 1200, 1800, 3600, 7200, 10800, 14400, 18000, 28800, 43200, 57600, 72000, 86400, 172800, 259200, 345600, 432000, 518400, 604800)
  • notes: The minimum TTL available depends on the plan level of the zone. (Enterprise = 30, Business = 1800, Pro = 3600, Free = 7200)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Email Obfuscation

Example object
{ "id": "email_obfuscation", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"email_obfuscation"

  • valid values: (email_obfuscation)
value
string

Value of the zone setting
"on"

  • default value: on
  • valid values: (on, off)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Hotlink Protection

Example object
{ "id": "hotlink_protection", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"hotlink_protection"

  • valid values: (hotlink_protection)
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (on, off)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

IP Geolcation

Example object
{ "id": "ip_geolocation", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"ip_geolocation"

  • valid values: (ip_geolocation)
value
string

Value of the zone setting
"on"

  • default value: on
  • valid values: (on, off)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

IPv6

Example object
{ "id": "ipv6", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"ipv6"

  • valid values: (ipv6)
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (off, on, safe)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Auto-Minify Assets

Example object
{ "id": "minify", "value": { "css": "off", "html": "off", "js": "off" }, "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

Zone setting identifier
"minify"

  • valid values: (minify)
value
object

Value of the zone setting

Show definition »
Name /type Description /example Constraints

Automatically minify all CSS for your website

  • default value: off
  • valid values: (on, off)

Automatically minify all HTML for your website

  • default value: off
  • valid values: (on, off)

Automatically minify all JavaScript for your website

  • default value: off
  • valid values: (on, off)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Mobile Redirect

Example object
{ "id": "mobile_redirect", "value": { "status": "off", "mobile_subdomain": "m", "strip_uri": false }, "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

identifier of the zone setting
"mobile_redirect"

  • valid values: (mobile_redirect)
value
object

Value of the zone setting

Show definition »
Name /type Description /example Constraints

Whether or not the mobile redirection is enabled

  • default value: off
  • valid values: (on, off)

string

Which subdomain prefix you wish to redirect visitors on mobile devices to (subdomain must already exist).
m

  • min length: 1

boolean

Whether to drop the current page path and redirect to the mobile subdomain URL root or to keep the path and redirect to the same page on the mobile subdomain

  • valid values: (true,false)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Mirage Image Optimization

Example object
{ "id": "mirage", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"mirage"

  • valid values: (mirage)
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (on, off)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Polish Image Optimization

Example object
{ "id": "polish", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"polish"

  • valid values: (polish)
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (off, lossless, lossy)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Rocket Loader

Example object
{ "id": "rocket_loader", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"rocket_loader"

  • valid values: (rocket_loader)
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (on, off, manual)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Security Level

Example object
{ "id": "security_level", "value": "medium", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"security_level"

  • valid values: (security_level)
value
string

Value of the zone setting
"medium"

  • default value: medium
  • valid values: (essentially_off, low, medium, high, under_attack)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Server Side Exclude

Example object
{ "id": "server_side_exclude", "value": "on", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"server_side_exclude"

  • valid values: (server_side_exclude)
value
string

Value of the zone setting
"on"

  • default value: on
  • valid values: (on, off)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

SSL

Example object
{ "id": "ssl", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"ssl"

  • valid values: (ssl)
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (off, flexible, full, full_strict)
  • notes: Depends on the zone's plan level
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

Web Application Firewall

Example object
{ "id": "waf", "value": "off", "editable": true, "modified_on": "2014-01-01T05:20:00.12345Z" }
Name /type Description /example Constraints
id
string

ID of the zone setting
"waf"

  • valid values: (waf)
value
string

Value of the zone setting
"off"

  • default value: off
  • valid values: (on, off)
editable
boolean

Whether or not this setting can be modified for this zone (based on your CloudFlare plan level)
true

  • default value: true
  • valid values: (true, false)
modified_on
string

last time this setting was modified
"2014-01-01T05:20:00.12345Z"

DNS Records for a Zone

Documentation for CloudFlare DNS records

POST Create DNS record permission needed: #dns_records:edit

Create a new DNS record for a zone. See the record object definitions for required attributes for each record type

POST /zones/:zone_identifier/dns_records

Required parameters

Name /type Description /example Constraints
type
string

DNS record type
"A"

  • valid values: (A, AAAA, CNAME, TXT, SRV, LOC, MX, NS, SPF)
  • read only
name
string

DNS record name
"example.com"

  • max length: 255
content
string

DNS record content
"127.0.0.1"

Optional parameters

Name /type Description /example Constraints
ttl
number

Time to live for DNS record. Value of 1 is 'automatic'
120

  • min value: 1
  • max value: 2147483647
cURL (example)
$ curl -X POST "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/dns_records"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"type":"A","name":"example.com","content":"127.0.0.1","ttl":120}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "type": "A", "name": "example.com", "content": "1.2.3.4", "proxiable": true, "proxied": false, "ttl": 120, "locked": false, "zone_id": "9a7806061c88ada191ed06f989cc3dac", "zone_name": "example.com", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "data": {} } }

GET List DNS Records permission needed: #dns_records:read

List, search, sort, and filter a zones' DNS records.

GET /zones/:zone_identifier/dns_records

Optional parameters

Name /type Description /example Constraints
type
string

DNS record type
"A"

  • valid values: (A, AAAA, CNAME, TXT, SRV, LOC, MX, NS, SPF)
  • read only
name
string

DNS record name
"example.com"

  • max length: 255
content
string

DNS record content
"127.0.0.1"

page
number

Page number of paginated results
1

  • default value: 1
  • min value: 1
per_page
number

Number of DNS records per page
20

  • default value: 20
  • min value: 5
  • max value: 100
order
string

Field to order records by
"type"

  • valid values: (type, name, content, ttl, proxied)
direction
string

Direction to order domains
"desc"

  • valid values: (asc, desc)
match
string

Whether to match all search requirements or at least one (any)
"all"

  • default value: all
  • valid values: (any, all)
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/dns_records?type=A&name=example.com&content=127.0.0.1&page=1&per_page=20&order=type&direction=desc&match=all"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": [ { "id": "9a7806061c88ada191ed06f989cc3dac", "type": "A", "name": "example.com", "content": "1.2.3.4", "proxiable": true, "proxied": false, "ttl": 120, "locked": false, "zone_id": "9a7806061c88ada191ed06f989cc3dac", "zone_name": "example.com", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "data": {} } ], "result_info": { "page": 1, "per_page": 20, "count": 1, "total_count": 2000 } }

GET DNS record details permission needed: #dns_records:read

GET /zones/:zone_identifier/dns_records/:identifier
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/dns_records/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "type": "A", "name": "example.com", "content": "1.2.3.4", "proxiable": true, "proxied": false, "ttl": 120, "locked": false, "zone_id": "9a7806061c88ada191ed06f989cc3dac", "zone_name": "example.com", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "data": {} } }

PUT Update DNS record permission needed: #dns_records:edit

PUT /zones/:zone_identifier/dns_records/:identifier
cURL (example)
$ curl -X PUT "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/dns_records/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"id":"9a7806061c88ada191ed06f989cc3dac","type":"A","name":"example.com","content":"1.2.3.4","proxiable":true,"proxied":false,"ttl":120,"locked":false,"zone_id":"9a7806061c88ada191ed06f989cc3dac","zone_name":"example.com","created_on":"2014-01-01T05:20:00.12345Z","modified_on":"2014-01-01T05:20:00.12345Z","data":{}}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "type": "A", "name": "example.com", "content": "1.2.3.4", "proxiable": true, "proxied": false, "ttl": 120, "locked": false, "zone_id": "9a7806061c88ada191ed06f989cc3dac", "zone_name": "example.com", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "data": {} } }

DELETE Delete DNS record permission needed: #dns_records:edit

DELETE /zones/:zone_identifier/dns_records/:identifier
cURL (example)
$ curl -X DELETE "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/dns_records/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac" } }

DNS Records for a Zone: definitions

A Record

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "type": "A", "name": "example.com", "content": "1.2.3.4", "proxiable": true, "proxied": false, "ttl": 120, "locked": false, "zone_id": "9a7806061c88ada191ed06f989cc3dac", "zone_name": "example.com", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "data": {} }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
type
string

Record type
"A"

  • valid values: (A)
name
string

A valid hostname
"example.com"

  • max length: 255
content
string

A valid IPv4 address
"1.2.3.4"

proxiable
boolean

Whether the record can be proxied by CloudFlare or not
true

  • valid values: (true,false)
  • read only
proxied
boolean

Whether the record is receiving the performance and security benefits of CloudFlare
false

  • valid values: (true,false)
ttl
number

Time to live for DNS record. Value of 1 is 'automatic'
120

  • min value: 1
  • max value: 2147483647
locked
boolean

Whether this record can be modified/deleted (true means it's managed by CloudFlare)
false

  • valid values: (true,false)
  • read only
zone_id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
zone_name
string

The domain of the record
"example.com"

  • read only
created_on
string

When the record was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the record was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
data
object

Metadata about the record
{}

meta
object

Extra CloudFlare-specific information about the record

Show definition »
Name /type Description /example Constraints

boolean

Will exist if CloudFlare automatically added this DNS record during initial setup.
true

  • valid values: (true,false)

AAAA Record

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "type": "AAAA", "name": "example.com", "content": "2400:cb00:2049:1::173.245.59.16", "proxiable": true, "proxied": false, "ttl": 120, "locked": false, "zone_id": "9a7806061c88ada191ed06f989cc3dac", "zone_name": "example.com", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "data": {} }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
type
string

Record type
"AAAA"

  • valid values: (AAAA)
name
string

A valid hostname
"example.com"

  • max length: 255
content
string

A valid IPv6 address
"2400:cb00:2049:1::173.245.59.16"

proxiable
boolean

Whether the record can be proxied by CloudFlare or not
true

  • valid values: (true,false)
  • read only
proxied
boolean

Whether the record is receiving the performance and security benefits of CloudFlare
false

  • valid values: (true,false)
ttl
number

Time to live for DNS record. Value of 1 is 'automatic'
120

  • min value: 1
  • max value: 2147483647
locked
boolean

Whether this record can be modified/deleted (true means it's managed by CloudFlare)
false

  • valid values: (true,false)
  • read only
zone_id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
zone_name
string

The domain of the record
"example.com"

  • read only
created_on
string

When the record was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the record was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
data
object

Metadata about the record
{}

meta
object

Extra CloudFlare-specific information about the record

Show definition »
Name /type Description /example Constraints

boolean

Will exist if CloudFlare automatically added this DNS record during initial setup.
true

  • valid values: (true,false)

CNAME Record

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "type": "CNAME", "name": "subdomain.example.com", "content": "example.com", "proxiable": true, "proxied": false, "ttl": 120, "locked": false, "zone_id": "9a7806061c88ada191ed06f989cc3dac", "zone_name": "example.com", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "data": {} }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
type
string

Record type
"CNAME"

  • valid values: (CNAME)
name
string

A valid hostname
"subdomain.example.com"

  • max length: 255
content
string

A valid hostname
"example.com"

proxiable
boolean

Whether the record can be proxied by CloudFlare or not
true

  • valid values: (true,false)
  • read only
proxied
boolean

Whether the record is receiving the performance and security benefits of CloudFlare
false

  • valid values: (true,false)
ttl
number

Time to live for DNS record. Value of 1 is 'automatic'
120

  • min value: 1
  • max value: 2147483647
locked
boolean

Whether this record can be modified/deleted (true means it's managed by CloudFlare)
false

  • valid values: (true,false)
  • read only
zone_id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
zone_name
string

The domain of the record
"example.com"

  • read only
created_on
string

When the record was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the record was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
data
object

Metadata about the record
{}

meta
object

Extra CloudFlare-specific information about the record

Show definition »
Name /type Description /example Constraints

boolean

Will exist if CloudFlare automatically added this DNS record during initial setup.
true

  • valid values: (true,false)

NS Record

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "type": "NS", "name": "example.com", "content": "ns1.example.com", "proxiable": true, "proxied": false, "ttl": 120, "locked": false, "zone_id": "9a7806061c88ada191ed06f989cc3dac", "zone_name": "example.com", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "data": {} }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
type
string

Record type
"NS"

  • valid values: (NS)
name
string

A valid hostname
"example.com"

  • max length: 255
content
string

A valid name server host name
"ns1.example.com"

proxiable
boolean

Whether the record can be proxied by CloudFlare or not
true

  • valid values: (true,false)
  • read only
proxied
boolean

Whether the record is receiving the performance and security benefits of CloudFlare
false

  • valid values: (true,false)
ttl
number

Time to live for DNS record. Value of 1 is 'automatic'
120

  • min value: 1
  • max value: 2147483647
locked
boolean

Whether this record can be modified/deleted (true means it's managed by CloudFlare)
false

  • valid values: (true,false)
  • read only
zone_id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
zone_name
string

The domain of the record
"example.com"

  • read only
created_on
string

When the record was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the record was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
data
object

Metadata about the record
{}

meta
object

Extra CloudFlare-specific information about the record

Show definition »
Name /type Description /example Constraints

boolean

Will exist if CloudFlare automatically added this DNS record during initial setup.
true

  • valid values: (true,false)

MX Record

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "type": "MX", "name": "example.com", "content": "mx.example.com", "proxiable": true, "proxied": false, "ttl": 120, "locked": false, "zone_id": "9a7806061c88ada191ed06f989cc3dac", "zone_name": "example.com", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "data": {}, "priority": 10 }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
type
string

Record type
"MX"

  • valid values: (MX)
name
string

A valid hostname
"example.com"

  • max length: 255
content
string

A valid mail server hostname
"mx.example.com"

proxiable
boolean

Whether the record can be proxied by CloudFlare or not
true

  • valid values: (true,false)
  • read only
proxied
boolean

Whether the record is receiving the performance and security benefits of CloudFlare
false

  • valid values: (true,false)
ttl
number

Time to live for DNS record. Value of 1 is 'automatic'
120

  • min value: 1
  • max value: 2147483647
locked
boolean

Whether this record can be modified/deleted (true means it's managed by CloudFlare)
false

  • valid values: (true,false)
  • read only
zone_id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
zone_name
string

The domain of the record
"example.com"

  • read only
created_on
string

When the record was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the record was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
data
object

Metadata about the record
{}

meta
object

Extra CloudFlare-specific information about the record

Show definition »
Name /type Description /example Constraints

boolean

Will exist if CloudFlare automatically added this DNS record during initial setup.
true

  • valid values: (true,false)
priority
number

Used with some records like MX and SRV to determine priority
10

  • min value: 0
  • max value: 65535

TXT Record

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "type": "TXT", "name": "example.com", "content": "example text content", "proxiable": true, "proxied": false, "ttl": 120, "locked": false, "zone_id": "9a7806061c88ada191ed06f989cc3dac", "zone_name": "example.com", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "data": {} }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
type
string

Record type
"TXT"

  • valid values: (TXT)
name
string

A valid hostname
"example.com"

  • max length: 255
content
string

Text content for the record
"example text content"

proxiable
boolean

Whether the record can be proxied by CloudFlare or not
true

  • valid values: (true,false)
  • read only
proxied
boolean

Whether the record is receiving the performance and security benefits of CloudFlare
false

  • valid values: (true,false)
ttl
number

Time to live for DNS record. Value of 1 is 'automatic'
120

  • min value: 1
  • max value: 2147483647
locked
boolean

Whether this record can be modified/deleted (true means it's managed by CloudFlare)
false

  • valid values: (true,false)
  • read only
zone_id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
zone_name
string

The domain of the record
"example.com"

  • read only
created_on
string

When the record was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the record was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
data
object

Metadata about the record
{}

meta
object

Extra CloudFlare-specific information about the record

Show definition »
Name /type Description /example Constraints

boolean

Will exist if CloudFlare automatically added this DNS record during initial setup.
true

  • valid values: (true,false)

LOC Record

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "type": "LOC", "name": "example.com", "content": "IN LOC 37 46 46 N 122 23 35 W 0m 100m 0m 0m", "proxiable": true, "proxied": false, "ttl": 120, "locked": false, "zone_id": "9a7806061c88ada191ed06f989cc3dac", "zone_name": "example.com", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "data": { "lat_degrees": 37, "lat_minutes": 46, "lat_seconds": 46, "lat_direction": "N", "long_degrees": 122, "long_minutes": 23, "long_seconds": 35, "long_direction": "W", "altitude": 0, "size": 100, "precision_horz": 0, "precision_vert": 0 } }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
type
string

Record type
"LOC"

  • valid values: (LOC)
name

A valid hostname
"example.com"

  • max length: 255
content
string

Formatted LOC content. See 'data' to set LOC properties
"IN LOC 37 46 46 N 122 23 35 W 0m 100m 0m 0m"

proxiable
boolean

Whether the record can be proxied by CloudFlare or not
true

  • valid values: (true,false)
  • read only
proxied
boolean

Whether the record is receiving the performance and security benefits of CloudFlare
false

  • valid values: (true,false)
ttl
number

Time to live for DNS record. Value of 1 is 'automatic'
120

  • min value: 1
  • max value: 2147483647
locked
boolean

Whether this record can be modified/deleted (true means it's managed by CloudFlare)
false

  • valid values: (true,false)
  • read only
zone_id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
zone_name
string

The domain of the record
"example.com"

  • read only
created_on
string

When the record was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the record was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
data
object

Components of a LOC record

Show definition »
Name /type Description /example Constraints

number

Degrees of latitude
37

  • min value: 0
  • max value: 90

number

Minutes of latitude
46

  • default value: 0
  • min value: 0
  • max value: 59

number

Seconds of latitude
46

  • default value: 0
  • min value: 0
  • max value: 59

Latitude direction
N

  • valid values: (N, S)

number

Degrees of longitude
122

  • min value: 0
  • max value: 180

number

Minutes of longitude
23

  • default value: 0
  • min value: 0
  • max value: 59

number

Seconds of longitude
35

  • default value: 0
  • min value: 0
  • max value: 59

Longitude direction
W

  • valid values: (E, W)

number

Altitude of location in meters

  • min value: -100000
  • max value: 42849672.95

number

Size of location in meters
100

  • default value: 0
  • min value: 0
  • max value: 90000000

number

Horizontal precision of location

  • default value: 0
  • min value: 0
  • max value: 90000000

number

Vertical precision of location

  • default value: 0
  • min value: 0
  • max value: 90000000
meta
object

Extra CloudFlare-specific information about the record

Show definition »
Name /type Description /example Constraints

boolean

Will exist if CloudFlare automatically added this DNS record during initial setup.
true

  • valid values: (true,false)

SRV Record

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "type": "SRV", "name": "_sip._tcp.example.com", "content": "10 IN SRV 5 8806 somewhere.com.", "proxiable": true, "proxied": false, "ttl": 120, "locked": false, "zone_id": "9a7806061c88ada191ed06f989cc3dac", "zone_name": "example.com", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "data": { "service": "_sip", "proto": "_tcp", "name": "example.com", "priority": 10, "weight": 5, "port": 8806, "target": "somewhere.com" } }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
type
string

Record type
"SRV"

  • valid values: (SRV)
name
string

Service, protocol, and SRV name content. See 'data' for setting the individual component values
"_sip._tcp.example.com"

  • max length: 255
content
string

Priority, weight, port, and SRV target. See 'data' for setting the individual component values
"10 IN SRV 5 8806 somewhere.com."

proxiable
boolean

Whether the record can be proxied by CloudFlare or not
true

  • valid values: (true,false)
  • read only
proxied
boolean

Whether the record is receiving the performance and security benefits of CloudFlare
false

  • valid values: (true,false)
ttl
number

Time to live for DNS record. Value of 1 is 'automatic'
120

  • min value: 1
  • max value: 2147483647
locked
boolean

Whether this record can be modified/deleted (true means it's managed by CloudFlare)
false

  • valid values: (true,false)
  • read only
zone_id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
zone_name
string

The domain of the record
"example.com"

  • read only
created_on
string

When the record was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the record was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
data
object

Components of a SRV record

Show definition »
Name /type Description /example Constraints

string

A service type, prefixed with an underscore
_sip

  • pattern: ^_?([-a-z0-9]+\.)*([-a-z0-9]+)$

A valid protocol
_tcp

  • valid values: (_udp, _tcp, _tls)

string

A valid hostname
example.com


number

Used with some records like MX and SRV to determine priority
10

  • min value: 0
  • max value: 65535

number

The record weight
5

  • min value: 0
  • max value: 65535

number

The port of the service
8806

  • min value: 0
  • max value: 65535

string

A valid hostname
somewhere.com

  • pattern: ^([a-zA-Z0-9][\-a-zA-Z0-9]*\.)+[\-a-zA-Z0-9]{2,20}$
meta
object

Extra CloudFlare-specific information about the record

Show definition »
Name /type Description /example Constraints

boolean

Will exist if CloudFlare automatically added this DNS record during initial setup.
true

  • valid values: (true,false)

SPF Record

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "type": "SPF", "name": "example.com", "content": "v=spf1 a ip:1.2.3.4", "proxiable": true, "proxied": false, "ttl": 120, "locked": false, "zone_id": "9a7806061c88ada191ed06f989cc3dac", "zone_name": "example.com", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "data": {} }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
type
string

Record type
"SPF"

  • valid values: (SPF)
name
hostname

A valid hostname
"example.com"

  • max length: 255
content
string

A valid SPF format, starting with 'v=spf1'
"v=spf1 a ip:1.2.3.4"

proxiable
boolean

Whether the record can be proxied by CloudFlare or not
true

  • valid values: (true,false)
  • read only
proxied
boolean

Whether the record is receiving the performance and security benefits of CloudFlare
false

  • valid values: (true,false)
ttl
number

Time to live for DNS record. Value of 1 is 'automatic'
120

  • min value: 1
  • max value: 2147483647
locked
boolean

Whether this record can be modified/deleted (true means it's managed by CloudFlare)
false

  • valid values: (true,false)
  • read only
zone_id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
zone_name
string

The domain of the record
"example.com"

  • read only
created_on
string

When the record was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the record was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
data
object

Metadata about the record
{}

meta
object

Extra CloudFlare-specific information about the record

Show definition »
Name /type Description /example Constraints

boolean

Will exist if CloudFlare automatically added this DNS record during initial setup.
true

  • valid values: (true,false)

DNS Records for a Zone error codes

Code Description
1000 Invalid user
1002 Invalid or missing zone_id
1003 per_page must be a positive integer
1004 Invalid or missing zone
1005 Invalid or missing record
1007 name required
1008 content required
1009 Invalid or missing record id
1010 Invalid or missing record
1011 Zone file for '<domain name>' could not be found
1012 Zone file for '<domain name>' is not modifiable
1013 The record could not be found
1014 You do not have permission to modify this zone
1015 Unknown error
1017 Content for A record is invalid. Must be a valid IPv4 address
1018 Content for AAAA record is invalid. Must be a valid IPv6 address
1019 Content for CNAME record is invalid
1024 Invalid priority, priority must be set and be between 0 and 65535
1025 Invalid content for an MX record
1026 Invalid format for a SPF record. A valid example is 'v=spf1 a mx -all'. You should not include either the word TXT or the domain name here in the content
1027 Invalid service value
1028 Invalid service value. Must be less than 100 characters
1029 Invalid protocol value
1030 Invalid protocol value. Must be less than 12 characters
1031 Invalid SRV name
1032 Invalid SRV name. Must be less than 90 characters
1033 Invalid weight value. Must be between 0 and 65,535
1034 Invalid port value. Must be between 0 and 65,535
1037 Invalid domain name for a SRV target host
1038 Invalid DNS record type
1039 Invalid TTL. Must be between 120 and 4,294,967,295 seconds, or 1 for automatic
1041 Priority must be set for SRV record
1042 Zone file for '<domain name>' could not be found
1043 Zone file for '<domain name>' is not editable
1044 A record with these exact values already exists. Please modify or remove this record
1045 The record could not be found
1046 A record with these exact values already exists. Please modify or cancel this edit
1047 You do not have permission to modify this zone
1048 You have reached the record limit for this zone
1049 The record content is missing
1050 Could not find record
1052 You can not point a CNAME to itself
1053 Invalid lat_degrees, must be an integer between 0 and 90 inclusive
1054 Invalid lat_minutes, must be an integer between 0 and 59 inclusive
1055 Invalid lat_seconds, must be a floating point number between 0 and 60, including 0 but not including 60
1056 Invalid or missing lat_direction. Values must be N or S
1057 Invalid long_degrees, must be an integer between 0 and 180
1058 Invalid long_minutes, must be an integer between 0 and 59
1059 Invalid long_seconds, must be a floating point number between 0 and 60, including 0 but not including 60
1060 Invalid or missing long_direction. Values must be E or S
1061 Invalid altitude, must be a floating point number between -100000.00 and 42849672.95
1062 Invalid size, must be a floating point number between 0 and 90000000.00
1063 Invalid precision_horz, must be a floating point number between 0 and 90000000.00
1064 Invalid precision_vert, must be a floating point number between 0 and 90000000.00
1065 Invalid or missing data for <type> record
1067 Invalid content for a NS record
1068 Target cannot be an IP address

DNS Records for a Zone Notes

If a zone's cname_setup_status is TRUE, you may only add A/AAAA and CNAME records for that zone
When adding a CNAME record, it will not be added if there is an A or AAAA record with the same name
When adding a A or AAAA record, it will not be added if there is an CNAME record with the same name
A CNAME record's name may not match it's content
You cannot add an NS record with the same name as any other record type
You cannot add a record with the same name as any NS record
CloudFlare will not begin serving DNS for a zone until the zone's nameservers are switched to CloudFlare nameservers at the zone's registrar
DNS will continue to be served by CloudFlare for 20 days after a zone's nameservers are switched away from CloudFlare namservers
When using unicode characters in domain names, they will be translated to punycode and as such, the length may end up being larger than what is passed into the API

Railguns for a Zone

Railguns associated with a zone

GET Get available Railguns permission needed: #zone_settings:read

A list of available Railguns the zone can use

GET /zones/:zone_identifier/railguns
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/railguns"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": [ { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "My Railgun", "enabled": true, "connected": true } ], "result_info": { "page": 1, "per_page": 20, "count": 1, "total_count": 2000 } }

GET Get Railgun details permission needed: #zone_settings:read

Details about a specific Railgun

GET /zones/:zone_identifier/railguns/:identifier
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/railguns/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "My Railgun", "enabled": true, "connected": true } }

PATCH Connect or disconnect a Railgun permission needed: #zone_settings:edit

Connect or disconnect a Railgun

PATCH /zones/:zone_identifier/railguns/:identifier

Required parameters

Name /type Description /example Constraints
connected
boolean

A flag indicating whether the given zone is connected to the Railgun
true

  • valid values: (true,false)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/railguns/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"connected":true}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "My Railgun", "enabled": true, "connected": true } }

Railguns for a Zone: definition

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "name": "My Railgun", "enabled": true, "connected": true }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
name
string

Readable identifier of the railgun
"My Railgun"

  • max length: 160
enabled
boolean

Flag to determine if the Railgun is accepting connections
true

  • valid values: (true,false)
connected
boolean

A flag indicating whether the given zone is connected to the Railgun
true

  • valid values: (true,false)

Custom SSL for a Zone

Custom SSL certificate for a zone

POST Create SSL configuration permission needed: #ssl:edit

Upload a new SSL certificate for a zone

POST /zones/:zone_identifier/custom_certificates

Required parameters

Name /type Description /example Constraints
certificate
string

The zone's SSL certificate or certificate and the intermediate(s)
"-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----"

private_key
string

The zone's private key
"-----BEGIN RSA PRIVATE KEY-----MIIEowIBAAKCAQEAl 1cSc0vfcJLI4ZdWjiZZqy86Eof4czCwilyjXdvHqbdgDjz9H6K/0FX78EzVdfyExESptPCDl5YYjvcZyAWlgNfYEpFpGeoh/pTFW3hlyKImh4EgBXbDrR251J Ew2Nf56X3duibI6X20gKZA6cvdmWeKh MOOXuh1bSPU3dkb4YOF/fng5iGrx0q3txdMQXTPMZ1uXHFcBH7idgViYesXUBhdll3GP1N Y8laq0yrqh 8HMsZK m27MebqonbNmjOqE218lVEvjCdRO6xvNXrO6vNJBoGn2eGwZ8BVd0mTA3Tj43/2cmxQFY9FLq56cCXqYI1fbRRib ZLrjSNkwIDAQABAoIBABfAjjsjjxc0NxcYvKOMUb9Rpj8Sx6U/o/tDC5u XmsGX37aaJmC5yw9BQiAxgvXtQryEl5uoNoqOdsxzKV6yM0vPcwKEJVBd4G6yx6AjVJZnc2qf72erR7BbA2CQh scMDRBKE041HhgTBRNP6roim0SOgYP5JZIrGAQXNIkyE0fZc5gZNUt388ne/mjWM6Xi08BDGurLC68nsdt7Nd UYqeBVxo2EqChp5vKYZYEcG8h9XBj4u4NIwg1Mty2JqX30uBjoHvF5w/pMs8lG uvj6JR9I 19wtCuccbAJl 4cUq03UQoIDmwejea oC8A8WJr3vVpODDWrvAsjllGPBECgYEAyQRa6edYO6bsSvgbM13qXW9OQTn9YmgzfN24Ux1D66TQU6sBSLdfSHshDhTCi Ax 698aJNRWujAakA2DDgspSx98aRnHbF zvY7i7iWGesN6uN0zL 6/MK5uWoieGZRjgk230fLk00l4/FK1mJIp0apr0Lis9xmDjP5AaUPTUUCgYEAwXuhTHZWPT6v8YwOksjbuK UDkIIvyMux53kb73vrkgMboS4DB1zMLNyG 9EghS414CFROUwGl4ZUKboH1Jo5G34y8VgDuHjirTqL2H6 zNpML iMrWCXjpFKkxwPbeQnEAZ 5Rud4d PTyXAt71blZHE9tZ4KHy8cU1iKc9APcCgYAIqKZd4vg7AZK2G//X85iv06aUSrIudfyZyVcyRVVyphPPNtOEVVnGXn9rAtvqeIrOo52BR68 cj4vlXp hkDuEH QVBuY/NdQhOzFtPrKPQTJdGjIlQ2x65Vidj7r3sRukNkLPyV2v D885zcpTkp83JFuWTYiIrg275DIuAI3QKBgAglM0IrzS g3vlVQxvM1ussgRgkkYeybHq82 wUW 3DXLqeXb0s1DedplUkuoabZriz0Wh4GZFSmtA5ZpZC uV697lkYsndmp2xRhaekllW7bu pY5q88URwO2p8CO5AZ6CWFWuBwSDML5VOapGRqDRgwaD oGpb7fb7IgHOls7AoGBAJnL6Q8t35uYJ8J8hY7wso88IE04z6VaT8WganxcndesWER9eFQDHDDy//ZYeyt6M41uIY CL Vkm9Kwl/bHLJKdnOE1a9NdE6mtfah0Bk2u/YOuzyu5mmcgZiX X/OZuEbGmmbZOR1FCuIyrNYfwYohhcZP7/r0Ia/1GpkHc3Bi-----END RSA PRIVATE KEY-----"

Optional parameters

Name /type Description /example Constraints
bundle_method
string

A ubiquitous bundle is a bundle that has a higher probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle is a bundle with the shortest chain and newest intermediates. A forced method attempt to use the certificate/chain as defined by the input
"ubiquitous"

  • default value: ubiquitous
  • valid values: (ubiquitous, optimal, force)
cURL (example)
$ curl -X POST "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/custom_certificates"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"certificate":"-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----","private_key":"-----BEGIN RSA PRIVATE KEY-----MIIEowIBAAKCAQEAl 1cSc0vfcJLI4ZdWjiZZqy86Eof4czCwilyjXdvHqbdgDjz9H6K/0FX78EzVdfyExESptPCDl5YYjvcZyAWlgNfYEpFpGeoh/pTFW3hlyKImh4EgBXbDrR251J Ew2Nf56X3duibI6X20gKZA6cvdmWeKh MOOXuh1bSPU3dkb4YOF/fng5iGrx0q3txdMQXTPMZ1uXHFcBH7idgViYesXUBhdll3GP1N Y8laq0yrqh 8HMsZK m27MebqonbNmjOqE218lVEvjCdRO6xvNXrO6vNJBoGn2eGwZ8BVd0mTA3Tj43/2cmxQFY9FLq56cCXqYI1fbRRib ZLrjSNkwIDAQABAoIBABfAjjsjjxc0NxcYvKOMUb9Rpj8Sx6U/o/tDC5u XmsGX37aaJmC5yw9BQiAxgvXtQryEl5uoNoqOdsxzKV6yM0vPcwKEJVBd4G6yx6AjVJZnc2qf72erR7BbA2CQh scMDRBKE041HhgTBRNP6roim0SOgYP5JZIrGAQXNIkyE0fZc5gZNUt388ne/mjWM6Xi08BDGurLC68nsdt7Nd UYqeBVxo2EqChp5vKYZYEcG8h9XBj4u4NIwg1Mty2JqX30uBjoHvF5w/pMs8lG uvj6JR9I 19wtCuccbAJl 4cUq03UQoIDmwejea oC8A8WJr3vVpODDWrvAsjllGPBECgYEAyQRa6edYO6bsSvgbM13qXW9OQTn9YmgzfN24Ux1D66TQU6sBSLdfSHshDhTCi Ax 698aJNRWujAakA2DDgspSx98aRnHbF zvY7i7iWGesN6uN0zL 6/MK5uWoieGZRjgk230fLk00l4/FK1mJIp0apr0Lis9xmDjP5AaUPTUUCgYEAwXuhTHZWPT6v8YwOksjbuK UDkIIvyMux53kb73vrkgMboS4DB1zMLNyG 9EghS414CFROUwGl4ZUKboH1Jo5G34y8VgDuHjirTqL2H6 zNpML iMrWCXjpFKkxwPbeQnEAZ 5Rud4d PTyXAt71blZHE9tZ4KHy8cU1iKc9APcCgYAIqKZd4vg7AZK2G//X85iv06aUSrIudfyZyVcyRVVyphPPNtOEVVnGXn9rAtvqeIrOo52BR68 cj4vlXp hkDuEH QVBuY/NdQhOzFtPrKPQTJdGjIlQ2x65Vidj7r3sRukNkLPyV2v D885zcpTkp83JFuWTYiIrg275DIuAI3QKBgAglM0IrzS g3vlVQxvM1ussgRgkkYeybHq82 wUW 3DXLqeXb0s1DedplUkuoabZriz0Wh4GZFSmtA5ZpZC uV697lkYsndmp2xRhaekllW7bu pY5q88URwO2p8CO5AZ6CWFWuBwSDML5VOapGRqDRgwaD oGpb7fb7IgHOls7AoGBAJnL6Q8t35uYJ8J8hY7wso88IE04z6VaT8WganxcndesWER9eFQDHDDy//ZYeyt6M41uIY CL Vkm9Kwl/bHLJKdnOE1a9NdE6mtfah0Bk2u/YOuzyu5mmcgZiX X/OZuEbGmmbZOR1FCuIyrNYfwYohhcZP7/r0Ia/1GpkHc3Bi-----END RSA PRIVATE KEY-----","bundle_method":"ubiquitous"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "hosts": [ "example.com" ], "issuer": "GlobalSign", "priority": 1, "status": "active", "bundle_method": "ubiquitous", "zone_id": "9a7806061c88ada191ed06f989cc3dac", "permissions": [ "#ssl:read", "#ssl:edit" ], "uploaded_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "expires_on": "2016-01-01T05:20:00Z" } }

GET List SSL configurations permission needed: #ssl:read

List, search, sort, and filter all of your custom SSL certificates

GET /zones/:zone_identifier/custom_certificates

Optional parameters

Name /type Description /example Constraints
status
string

Status of the zone's custom SSL
"active"

  • valid values: (active, expired, deleted)
  • read only
page
number

Page number of paginated results
1

  • default value: 1
  • min value: 1
per_page
number

Number of zones per page
20

  • default value: 20
  • min value: 5
  • max value: 50
order
string

Field to order certificates by
"status"

  • default value: priority
  • valid values: (status, issuer, priority, expires_on)
direction
string

Direction to order zones
"desc"

  • valid values: (asc, desc)
match
string

Whether to match all search requirements or at least one (any)
"all"

  • default value: all
  • valid values: (any, all)
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/custom_certificates?status=active&page=1&per_page=20&order=status&direction=desc&match=all"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": [ { "id": "9a7806061c88ada191ed06f989cc3dac", "hosts": [ "example.com" ], "issuer": "GlobalSign", "priority": 1, "status": "active", "bundle_method": "ubiquitous", "zone_id": "9a7806061c88ada191ed06f989cc3dac", "permissions": [ "#ssl:read", "#ssl:edit" ], "uploaded_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "expires_on": "2016-01-01T05:20:00Z" } ], "result_info": { "page": 1, "per_page": 20, "count": 1, "total_count": 2000 } }

GET SSL configuration details permission needed: #ssl:read

GET /zones/:zone_identifier/custom_certificates/:identifier
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/custom_certificates/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "hosts": [ "example.com" ], "issuer": "GlobalSign", "priority": 1, "status": "active", "bundle_method": "ubiquitous", "zone_id": "9a7806061c88ada191ed06f989cc3dac", "permissions": [ "#ssl:read", "#ssl:edit" ], "uploaded_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "expires_on": "2016-01-01T05:20:00Z" } }

PATCH Update SSL configuration permission needed: #ssl:edit

Upload a new private key and/or PEM/CRT for the SSL certificate

PATCH /zones/:zone_identifier/custom_certificates/:identifier

Required parameters

Name /type Description /example Constraints
private_key
string

The zone's private key
"-----BEGIN RSA PRIVATE KEY-----MIIEowIBAAKCAQEAl 1cSc0vfcJLI4ZdWjiZZqy86Eof4czCwilyjXdvHqbdgDjz9H6K/0FX78EzVdfyExESptPCDl5YYjvcZyAWlgNfYEpFpGeoh/pTFW3hlyKImh4EgBXbDrR251J Ew2Nf56X3duibI6X20gKZA6cvdmWeKh MOOXuh1bSPU3dkb4YOF/fng5iGrx0q3txdMQXTPMZ1uXHFcBH7idgViYesXUBhdll3GP1N Y8laq0yrqh 8HMsZK m27MebqonbNmjOqE218lVEvjCdRO6xvNXrO6vNJBoGn2eGwZ8BVd0mTA3Tj43/2cmxQFY9FLq56cCXqYI1fbRRib ZLrjSNkwIDAQABAoIBABfAjjsjjxc0NxcYvKOMUb9Rpj8Sx6U/o/tDC5u XmsGX37aaJmC5yw9BQiAxgvXtQryEl5uoNoqOdsxzKV6yM0vPcwKEJVBd4G6yx6AjVJZnc2qf72erR7BbA2CQh scMDRBKE041HhgTBRNP6roim0SOgYP5JZIrGAQXNIkyE0fZc5gZNUt388ne/mjWM6Xi08BDGurLC68nsdt7Nd UYqeBVxo2EqChp5vKYZYEcG8h9XBj4u4NIwg1Mty2JqX30uBjoHvF5w/pMs8lG uvj6JR9I 19wtCuccbAJl 4cUq03UQoIDmwejea oC8A8WJr3vVpODDWrvAsjllGPBECgYEAyQRa6edYO6bsSvgbM13qXW9OQTn9YmgzfN24Ux1D66TQU6sBSLdfSHshDhTCi Ax 698aJNRWujAakA2DDgspSx98aRnHbF zvY7i7iWGesN6uN0zL 6/MK5uWoieGZRjgk230fLk00l4/FK1mJIp0apr0Lis9xmDjP5AaUPTUUCgYEAwXuhTHZWPT6v8YwOksjbuK UDkIIvyMux53kb73vrkgMboS4DB1zMLNyG 9EghS414CFROUwGl4ZUKboH1Jo5G34y8VgDuHjirTqL2H6 zNpML iMrWCXjpFKkxwPbeQnEAZ 5Rud4d PTyXAt71blZHE9tZ4KHy8cU1iKc9APcCgYAIqKZd4vg7AZK2G//X85iv06aUSrIudfyZyVcyRVVyphPPNtOEVVnGXn9rAtvqeIrOo52BR68 cj4vlXp hkDuEH QVBuY/NdQhOzFtPrKPQTJdGjIlQ2x65Vidj7r3sRukNkLPyV2v D885zcpTkp83JFuWTYiIrg275DIuAI3QKBgAglM0IrzS g3vlVQxvM1ussgRgkkYeybHq82 wUW 3DXLqeXb0s1DedplUkuoabZriz0Wh4GZFSmtA5ZpZC uV697lkYsndmp2xRhaekllW7bu pY5q88URwO2p8CO5AZ6CWFWuBwSDML5VOapGRqDRgwaD oGpb7fb7IgHOls7AoGBAJnL6Q8t35uYJ8J8hY7wso88IE04z6VaT8WganxcndesWER9eFQDHDDy//ZYeyt6M41uIY CL Vkm9Kwl/bHLJKdnOE1a9NdE6mtfah0Bk2u/YOuzyu5mmcgZiX X/OZuEbGmmbZOR1FCuIyrNYfwYohhcZP7/r0Ia/1GpkHc3Bi-----END RSA PRIVATE KEY-----"

certificate
string

The zone's SSL certificate or certificate and the intermediate(s)
"-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----"

Optional parameters

Name /type Description /example Constraints
bundle_method
string

A ubiquitous bundle is a bundle that has a higher probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle is a bundle with the shortest chain and newest intermediates. A forced method attempt to use the certificate/chain as defined by the input
"ubiquitous"

  • default value: ubiquitous
  • valid values: (ubiquitous, optimal, force)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/custom_certificates/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"private_key":"-----BEGIN RSA PRIVATE KEY-----MIIEowIBAAKCAQEAl 1cSc0vfcJLI4ZdWjiZZqy86Eof4czCwilyjXdvHqbdgDjz9H6K/0FX78EzVdfyExESptPCDl5YYjvcZyAWlgNfYEpFpGeoh/pTFW3hlyKImh4EgBXbDrR251J Ew2Nf56X3duibI6X20gKZA6cvdmWeKh MOOXuh1bSPU3dkb4YOF/fng5iGrx0q3txdMQXTPMZ1uXHFcBH7idgViYesXUBhdll3GP1N Y8laq0yrqh 8HMsZK m27MebqonbNmjOqE218lVEvjCdRO6xvNXrO6vNJBoGn2eGwZ8BVd0mTA3Tj43/2cmxQFY9FLq56cCXqYI1fbRRib ZLrjSNkwIDAQABAoIBABfAjjsjjxc0NxcYvKOMUb9Rpj8Sx6U/o/tDC5u XmsGX37aaJmC5yw9BQiAxgvXtQryEl5uoNoqOdsxzKV6yM0vPcwKEJVBd4G6yx6AjVJZnc2qf72erR7BbA2CQh scMDRBKE041HhgTBRNP6roim0SOgYP5JZIrGAQXNIkyE0fZc5gZNUt388ne/mjWM6Xi08BDGurLC68nsdt7Nd UYqeBVxo2EqChp5vKYZYEcG8h9XBj4u4NIwg1Mty2JqX30uBjoHvF5w/pMs8lG uvj6JR9I 19wtCuccbAJl 4cUq03UQoIDmwejea oC8A8WJr3vVpODDWrvAsjllGPBECgYEAyQRa6edYO6bsSvgbM13qXW9OQTn9YmgzfN24Ux1D66TQU6sBSLdfSHshDhTCi Ax 698aJNRWujAakA2DDgspSx98aRnHbF zvY7i7iWGesN6uN0zL 6/MK5uWoieGZRjgk230fLk00l4/FK1mJIp0apr0Lis9xmDjP5AaUPTUUCgYEAwXuhTHZWPT6v8YwOksjbuK UDkIIvyMux53kb73vrkgMboS4DB1zMLNyG 9EghS414CFROUwGl4ZUKboH1Jo5G34y8VgDuHjirTqL2H6 zNpML iMrWCXjpFKkxwPbeQnEAZ 5Rud4d PTyXAt71blZHE9tZ4KHy8cU1iKc9APcCgYAIqKZd4vg7AZK2G//X85iv06aUSrIudfyZyVcyRVVyphPPNtOEVVnGXn9rAtvqeIrOo52BR68 cj4vlXp hkDuEH QVBuY/NdQhOzFtPrKPQTJdGjIlQ2x65Vidj7r3sRukNkLPyV2v D885zcpTkp83JFuWTYiIrg275DIuAI3QKBgAglM0IrzS g3vlVQxvM1ussgRgkkYeybHq82 wUW 3DXLqeXb0s1DedplUkuoabZriz0Wh4GZFSmtA5ZpZC uV697lkYsndmp2xRhaekllW7bu pY5q88URwO2p8CO5AZ6CWFWuBwSDML5VOapGRqDRgwaD oGpb7fb7IgHOls7AoGBAJnL6Q8t35uYJ8J8hY7wso88IE04z6VaT8WganxcndesWER9eFQDHDDy//ZYeyt6M41uIY CL Vkm9Kwl/bHLJKdnOE1a9NdE6mtfah0Bk2u/YOuzyu5mmcgZiX X/OZuEbGmmbZOR1FCuIyrNYfwYohhcZP7/r0Ia/1GpkHc3Bi-----END RSA PRIVATE KEY-----","certificate":"-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----","bundle_method":"ubiquitous"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "hosts": [ "example.com" ], "issuer": "GlobalSign", "priority": 1, "status": "active", "bundle_method": "ubiquitous", "zone_id": "9a7806061c88ada191ed06f989cc3dac", "permissions": [ "#ssl:read", "#ssl:edit" ], "uploaded_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "expires_on": "2016-01-01T05:20:00Z" } }

PUT Re-prioritize SSL certificates permission needed: #ssl:edit

If a zone has multiple SSL certificates, you can set the order in which they should be used during a request.

PUT /zones/:zone_identifier/custom_certificates/prioritize

Required parameters

Name /type Description /example Constraints
certificates
array

Array of ordered certificates.
[{"ID":"5a7805061c76ada191ed06f989cc3dac","priority":2},{"ID":"9a7806061c88ada191ed06f989cc3dac","priority":1}]

cURL (example)
$ curl -X PUT "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/custom_certificates/prioritize"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"certificates":[{"ID":"5a7805061c76ada191ed06f989cc3dac","priority":2},{"ID":"9a7806061c88ada191ed06f989cc3dac","priority":1}]}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": [ { "id": "9a7806061c88ada191ed06f989cc3dac", "hosts": [ "example.com" ], "issuer": "GlobalSign", "priority": 1, "status": "active", "bundle_method": "ubiquitous", "zone_id": "9a7806061c88ada191ed06f989cc3dac", "permissions": [ "#ssl:read", "#ssl:edit" ], "uploaded_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "expires_on": "2016-01-01T05:20:00Z" } ], "result_info": { "page": 1, "per_page": 20, "count": 1, "total_count": 2000 } }

DELETE Delete an SSL certificate permission needed: #ssl:edit

DELETE /zones/:zone_identifier/custom_certificates/:identifier
cURL (example)
$ curl -X DELETE "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/custom_certificates/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "id": "9a7806061c88ada191ed06f989cc3dac" }

Custom SSL for a Zone: definition

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "hosts": [ "example.com" ], "issuer": "GlobalSign", "priority": 1, "status": "active", "bundle_method": "ubiquitous", "zone_id": "9a7806061c88ada191ed06f989cc3dac", "permissions": [ "#ssl:read", "#ssl:edit" ], "uploaded_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z", "expires_on": "2016-01-01T05:20:00Z" }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
hosts
array


["example.com"]

issuer
string

The certificate authority that issued the certificate
"GlobalSign"

  • read only
priority
number

The order/priority in which the certificate will be used in a request. Higher numbers will be tried first.
1

  • default value: 20
status
string

Status of the zone's custom SSL
"active"

  • valid values: (active, expired, deleted)
  • read only
bundle_method
string

A ubiquitous bundle is a bundle that has a higher probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle is a bundle with the shortest chain and newest intermediates. A forced method attempt to use the certificate/chain as defined by the input
"ubiquitous"

  • default value: ubiquitous
  • valid values: (ubiquitous, optimal, force)
zone_id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
permissions
array

Available permissions on the SSL certificate for the current user requesting the item
["#ssl:read","#ssl:edit"]

  • read only
uploaded_on
string

When the certificate was uploaded to CloudFlare
"2014-01-01T05:20:00Z"

  • read only
modified_on
string

When the certificate was last modified
"2014-01-01T05:20:00Z"

  • read only
expires_on
string

When the certificate from the authority expires
"2016-01-01T05:20:00Z"

  • read only
keyless_server
object

A Keyless certificate is an SSL certificate where the SSL private key is not stored on CloudFlare
{"id":"9a7806061c88ada191ed06f989cc3dac","name":"example.com Keyless SSL","host":"example.com","port":24008,"status":"active","enabled":false,"permissions":["#ssl:read","#ssl:edit"],"created_on":"2014-01-01T05:20:00Z","modified_on":"2014-01-01T05:20:00Z"}

Show definition »
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
name
string

The keyless SSL name
"example.com Keyless SSL"

  • max length: 180
  • read only
host
string

The keyless SSL name
"example.com"

  • max length: 253
port
number

The keyless SSL port used to commmunicate between CloudFlare and the client's Keyless SSL server
24008

  • default value: 24008
  • max length: 65535
status
string

Status of the Keyless SSL
"active"

  • valid values: (active, deleted)
  • read only
enabled
boolean

Whether or not the Keyless SSL is on or off
false

  • valid values: (true,false)
  • read only
permissions
array

Available permissions for the Keyless SSL for the current user requesting the item
["#ssl:read","#ssl:edit"]

  • read only
created_on
string

When the Keyless SSL was created
"2014-01-01T05:20:00Z"

  • read only
modified_on
string

When the Keyless SSL was last modified
"2014-01-01T05:20:00Z"

  • read only

Keyless SSL for a Zone

A Keyless certificate is an SSL certificate where the SSL private key is not stored on CloudFlare

POST Create a Keyless SSL configuration permission needed: #ssl:edit

POST /zones/:zone_identifier/keyless_certificates

Required parameters

Name /type Description /example Constraints
host
string

The keyless SSL name
"example.com"

  • max length: 253
port
number

The keyless SSL port used to commmunicate between CloudFlare and the client's Keyless SSL server
24008

  • default value: 24008
  • max length: 65535
name
string

The keyless SSL name
"example.com Keyless SSL"

  • max length: 180
  • read only
certificate
string

The zone's SSL certificate or SSL certificate and intermediate(s)
"-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----"

Optional parameters

Name /type Description /example Constraints
bundle_method
string

A ubiquitous bundle is a bundle that has a higher probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle is a bundle with the shortest chain and newest intermediates. A forced method attempt to use the certificate/chain as defined by the input
"ubiquitous"

  • default value: ubiquitous
  • valid values: (ubiquitous, optimal, force)
cURL (example)
$ curl -X POST "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/keyless_certificates"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"host":"example.com","port":24008,"name":"example.com Keyless SSL","certificate":"-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----","bundle_method":"ubiquitous"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "example.com Keyless SSL", "host": "example.com", "port": 24008, "status": "active", "enabled": false, "permissions": [ "#ssl:read", "#ssl:edit" ], "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z" } }

GET List Keyless SSLs permission needed: #ssl:read

List all Keyless SSLs configurations for a given zone

GET /zones/:zone_identifier/keyless_certificates
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/keyless_certificates"\ -H "X-Auth-Email: [email protected]"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": [ { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "example.com Keyless SSL", "host": "example.com", "port": 24008, "status": "active", "enabled": false, "permissions": [ "#ssl:read", "#ssl:edit" ], "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z" } ], "result_info": { "page": 1, "per_page": 20, "count": 1, "total_count": 2000 } }

GET Keyless SSL details permission needed: #ssl:read

Details for one Keyless SSL configuration

GET /zones/:zone_identifier/keyless_certificates/:identifier
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/keyless_certificates/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: user@example.com"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "example.com Keyless SSL", "host": "example.com", "port": 24008, "status": "active", "enabled": false, "permissions": [ "#ssl:read", "#ssl:edit" ], "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z" } }

PATCH Update Keyless configuration permission needed: #ssl:edit

This will update attributes of a Keyless SSL. Consists of one or more of the following: host,name,port,certificate,enabled

PATCH /zones/:zone_identifier/keyless_certificates/:identifier

Required parameters

Name /type Description /example Constraints
host
string

The keyless SSL name
"example.com"

  • max length: 253
name
string

The keyless SSL name
"example.com Keyless SSL"

  • max length: 180
  • read only
port
number

The keyless SSL port used to commmunicate between CloudFlare and the client's Keyless SSL server
24008

  • default value: 24008
  • max length: 65535

Optional parameters

Name /type Description /example Constraints
enabled
boolean

Whether or not the Keyless SSL is on or off
false

  • valid values: (true,false)
  • read only
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/keyless_certificates/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: user@example.com"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"host":"example.com","name":"example.com Keyless SSL","port":24008,"enabled":false}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "example.com Keyless SSL", "host": "example.com", "port": 24008, "status": "active", "enabled": false, "permissions": [ "#ssl:read", "#ssl:edit" ], "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z" } }

DELETE Delete Keyless configuration permission needed: #ssl:edit

DELETE /zones/:zone_identifier/keyless_certificates/:identifier
cURL (example)
$ curl -X DELETE "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/keyless_certificates/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: user@example.com"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "id": "9a7806061c88ada191ed06f989cc3dac" }

Keyless SSL for a Zone: definition

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "name": "example.com Keyless SSL", "host": "example.com", "port": 24008, "status": "active", "enabled": false, "permissions": [ "#ssl:read", "#ssl:edit" ], "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z" }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
name
string

The keyless SSL name
"example.com Keyless SSL"

  • max length: 180
  • read only
host
string

The keyless SSL name
"example.com"

  • max length: 253
port
number

The keyless SSL port used to commmunicate between CloudFlare and the client's Keyless SSL server
24008

  • default value: 24008
  • max length: 65535
status
string

Status of the Keyless SSL
"active"

  • valid values: (active, deleted)
  • read only
enabled
boolean

Whether or not the Keyless SSL is on or off
false

  • valid values: (true,false)
  • read only
permissions
array

Available permissions for the Keyless SSL for the current user requesting the item
["#ssl:read","#ssl:edit"]

  • read only
created_on
string

When the Keyless SSL was created
"2014-01-01T05:20:00Z"

  • read only
modified_on
string

When the Keyless SSL was last modified
"2014-01-01T05:20:00Z"

  • read only

Railgun

CloudFlare Railgun

POST Create Railgun

POST /railguns

Required parameters

Name /type Description /example Constraints
name
string

Readable identifier of the railgun
"My Railgun"

  • max length: 160
cURL (example)
$ curl -X POST "https://api.cloudflare.com/client/v4/railguns"\ -H "X-Auth-Email: user@example.com"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"name":"My Railgun"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "My Railgun", "status": "active", "enabled": true, "zones_connected": 2, "build": "b1234", "version": "2.1", "revision": "123", "activation_key": "e4edc00281cb56ebac22c81be9bac8f3", "activated_on": "2014-01-02T02:20:00Z", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z" } }

GET List Railguns

List, search, sort and filter your Railguns

GET /railguns

Optional parameters

Name /type Description /example Constraints
page
number

Page number of paginated results
1

  • default value: 1
  • min value: 1
per_page
number

Number of items per page
20

  • default value: 20
  • min value: 5
  • max value: 50
direction
string

Direction to order Railguns
"desc"

  • valid values: (asc, desc)
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/railguns?page=1&per_page=20&direction=desc"\ -H "X-Auth-Email: user@example.com"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": [ { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "My Railgun", "status": "active", "enabled": true, "zones_connected": 2, "build": "b1234", "version": "2.1", "revision": "123", "activation_key": "e4edc00281cb56ebac22c81be9bac8f3", "activated_on": "2014-01-02T02:20:00Z", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z" } ], "result_info": { "page": 1, "per_page": 20, "count": 1, "total_count": 2000 } }

GET Railgun details

GET /railguns/:identifier
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/railguns/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: user@example.com"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "My Railgun", "status": "active", "enabled": true, "zones_connected": 2, "build": "b1234", "version": "2.1", "revision": "123", "activation_key": "e4edc00281cb56ebac22c81be9bac8f3", "activated_on": "2014-01-02T02:20:00Z", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z" } }

GET Get zones connected to a Railgun

The zones that are currently using this Railgun

GET /railguns/:identifier/zones
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/railguns/9a7806061c88ada191ed06f989cc3dac/zones"\ -H "X-Auth-Email: user@example.com"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": [ { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "example.com", "development_mode": 7200, "original_name_servers": [ "ns1.originaldnshost.com", "ns2.originaldnshost.com" ], "original_registrar": "GoDaddy", "original_dnshost": "NameCheap", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z" } ], "result_info": { "page": 1, "per_page": 20, "count": 1, "total_count": 2000 } }

PATCH Enable or disable a Railgun

Enable or disable a Railgun for all zones connected to it

PATCH /railguns/:identifier

Required parameters

Name /type Description /example Constraints
enabled
boolean

Flag to determine if the Railgun is accepting connections
true

  • valid values: (true,false)
cURL (example)
$ curl -X PATCH "https://api.cloudflare.com/client/v4/railguns/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: user@example.com"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"enabled":true}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac", "name": "My Railgun", "status": "active", "enabled": true, "zones_connected": 2, "build": "b1234", "version": "2.1", "revision": "123", "activation_key": "e4edc00281cb56ebac22c81be9bac8f3", "activated_on": "2014-01-02T02:20:00Z", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z" } }

DELETE Delete Railgun

Disable and delete a Railgun. This will immediately disable the Railgun for any connected zones

DELETE /railguns/:identifier
cURL (example)
$ curl -X DELETE "https://api.cloudflare.com/client/v4/railguns/9a7806061c88ada191ed06f989cc3dac"\ -H "X-Auth-Email: user@example.com"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "id": "9a7806061c88ada191ed06f989cc3dac" } }

Railgun: definition

Example object
{ "id": "9a7806061c88ada191ed06f989cc3dac", "name": "My Railgun", "status": "active", "enabled": true, "zones_connected": 2, "build": "b1234", "version": "2.1", "revision": "123", "activation_key": "e4edc00281cb56ebac22c81be9bac8f3", "activated_on": "2014-01-02T02:20:00Z", "created_on": "2014-01-01T05:20:00Z", "modified_on": "2014-01-01T05:20:00Z" }
Name /type Description /example Constraints
id
string

API item identifier tag
"9a7806061c88ada191ed06f989cc3dac"

  • max length: 32
  • read only
name
string

Readable identifier of the railgun
"My Railgun"

  • max length: 160
status
string

Status of the railgun
"active"

  • valid values: (initializing, active)
  • read only
enabled
boolean

Flag to determine if the Railgun is accepting connections
true

  • valid values: (true,false)
zones_connected
number

The number of zones using this railgun
2

  • read only
build
string

The build identifier for the railgun receiver
"b1234"

  • read only
version
string

The version of the railgun receiver
"2.1"

  • read only
revision
string

The revision of the railgun receiver
"123"

  • read only
activation_key
string


"e4edc00281cb56ebac22c81be9bac8f3"

  • max length: 32
  • read only
activated_on
string

When the Railgun was activated
"2014-01-02T02:20:00Z"

  • read only
created_on
string

When the Railgun was created
"2014-01-01T05:20:00Z"

  • read only
modified_on
string

When the Railgun was last modified
"2014-01-01T05:20:00Z"

  • read only
upgrade_info
object

Defined when the Railgun version is out of date from the latest release from CloudFlare

Show definition »
Name /type Description /example Constraints

string

Latest version of the Railgun receiver available to install
1.0.0


string

An HTTP link to download the latest binary
https://www.cloudflare.com/downloads/railgun

Custom Pages for a Zone

Custom pages associated with a zone

GET Available Custom Pages permission needed: #zone_settings:read

A list of available Custom Pages the zone can use

GET /zones/:zone_identifier/custom_pages
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/custom_pages"\ -H "X-Auth-Email: user@example.com"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": [ { "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "url": "http://www.example.com", "state": "default", "required_tokens": [ "::CAPTCHA_BOX::" ], "preview_target": "preview:target", "description": true } ], "result_info": { "page": 1, "per_page": 20, "count": 1, "total_count": 2000 } }

GET Custom Page details permission needed: #zone_settings:read

Details about a specific Custom page details

GET /zones/:zone_identifier/custom_pages/:identifier
cURL (example)
$ curl -X GET "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/custom_pages/basic_challenge"\ -H "X-Auth-Email: user@example.com"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "url": "http://www.example.com", "state": "default", "required_tokens": [ "::CAPTCHA_BOX::" ], "preview_target": "preview:target", "description": true } }

PUT Update Custom page URL permission needed: #zone_settings:edit

Update Custom page URL

PUT /zones/:zone_identifier/custom_pages/:identifier

Required parameters

Name /type Description /example Constraints
url
string

A URL that is associated with the Custom Page.
"http://www.example.com"

state
string

The Custom Page state
"default"

  • valid values: (default, customized)
cURL (example)
$ curl -X PUT "https://api.cloudflare.com/client/v4/zones/9a7806061c88ada191ed06f989cc3dac/custom_pages/basic_challenge"\ -H "X-Auth-Email: user@example.com"\ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41"\ -H "Content-Type: application/json"\ --data '{"url":"http://www.example.com","state":"default"}'
Response (example)
{ "success": true, "errors": [], "messages": [], "result": { "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "url": "http://www.example.com", "state": "default", "required_tokens": [ "::CAPTCHA_BOX::" ], "preview_target": "preview:target", "description": true } }

Custom Pages for a Zone: definitions

Basic Challenge

Example object
{ "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "url": "http://www.example.com", "state": "default", "required_tokens": [ "::CAPTCHA_BOX::" ], "preview_target": "preview:target", "description": true }
Name /type Description /example Constraints
id
string


  • valid values: (basic_challenge)
created_on
string

When the Custom Page was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the Custom Page was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
url
string

A URL that is associated with the Custom Page.
"http://www.example.com"

state
string

The Custom Page state
"default"

  • valid values: (default, customized)
required_tokens
array

String tokens that must be present in your customized HTML page
["::CAPTCHA_BOX::"]

  • read only
preview_target
string

The 'target' needed as part of the query string when previewing the Custom Page at cloudflarepreview.com
"preview:target"

  • notes: Should be used like this: cloudflarepreview.com/preview-cpage?act=preview&target=preview:target&url=<your url>
description
string

A short description of the Custom Page.
true

WAF Challenge

Example object
{ "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "url": "http://www.example.com", "state": "default", "required_tokens": [ "::CAPTCHA_BOX::" ], "preview_target": "preview:target", "description": true }
Name /type Description /example Constraints
id
string


  • valid values: (waf_challenge)
created_on
string

When the Custom Page was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the Custom Page was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
url
string

A URL that is associated with the Custom Page.
"http://www.example.com"

state
string

The Custom Page state
"default"

  • valid values: (default, customized)
required_tokens
array

String tokens that must be present in your customized HTML page
["::CAPTCHA_BOX::"]

  • read only
preview_target
string

The 'target' needed as part of the query string when previewing the Custom Page at cloudflarepreview.com
"preview:target"

  • notes: Should be used like this: cloudflarepreview.com/preview-cpage?act=preview&target=preview:target&url=<your url>
description
string

A short description of the Custom Page.
true

WAF Block

Example object
{ "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "url": "http://www.example.com", "state": "default", "required_tokens": [ "::CAPTCHA_BOX::" ], "preview_target": "preview:target", "description": true }
Name /type Description /example Constraints
id
string


  • valid values: (waf_block)
created_on
string

When the Custom Page was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the Custom Page was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
url
string

A URL that is associated with the Custom Page.
"http://www.example.com"

state
string

The Custom Page state
"default"

  • valid values: (default, customized)
required_tokens
array

An array of required tokens that needs to be present for the Custom Page.
["::CAPTCHA_BOX::"]

  • read only
preview_target
string

The 'target' needed as part of the query string when previewing the Custom Page at cloudflarepreview.com
"preview:target"

  • notes: Should be used like this: cloudflarepreview.com/preview-cpage?act=preview&target=preview:target&url=<your url>
description
string

A short description of the Custom Page.
true

Country Challenge

Example object
{ "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "url": "http://www.example.com", "state": "default", "required_tokens": [ "::CAPTCHA_BOX::" ], "preview_target": "preview:target", "description": true }
Name /type Description /example Constraints
id
string


  • valid values: (country_challenge)
created_on
string

When the Custom Page was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the Custom Page was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
url
string

A URL that is associated with the Custom Page.
"http://www.example.com"

state
string

The Custom Page state
"default"

  • valid values: (default, customized)
required_tokens
array

String tokens that must be present in your customized HTML page
["::CAPTCHA_BOX::"]

  • read only
preview_target
string

The 'target' needed as part of the query string when previewing the Custom Page at cloudflarepreview.com
"preview:target"

  • notes: Should be used like this: cloudflarepreview.com/preview-cpage?act=preview&target=preview:target&url=<your url>
description
string

A short description of the Custom Page.
true

Block a specific IP or a range of IPs

Example object
{ "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "url": "http://www.example.com", "state": "default", "required_tokens": [ "::CAPTCHA_BOX::" ], "preview_target": "preview:target", "description": true }
Name /type Description /example Constraints
id
string


  • valid values: (ip_block)
created_on
string

When the Custom Page was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the Custom Page was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
url
string

A URL that is associated with the Custom Page.
"http://www.example.com"

state
string

The Custom Page state
"default"

  • valid values: (default, customized)
required_tokens
array

An array of required tokens that needs to be present for the Custom Page.
["::CAPTCHA_BOX::"]

  • read only
preview_target
string

The 'target' needed as part of the query string when previewing the Custom Page at cloudflarepreview.com
"preview:target"

  • notes: Should be used like this: cloudflarepreview.com/preview-cpage?act=preview&target=preview:target&url=<your url>
description
string

A short description of the Custom Page.
true

I am under attack mode

Example object
{ "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "url": "http://www.example.com", "state": "default", "required_tokens": [ "::IM_UNDER_ATTACK_BOX::" ], "preview_target": "preview:target", "description": true }
Name /type Description /example Constraints
id
string


  • valid values: (under_attack)
created_on
string

When the Custom Page was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the Custom Page was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
url
string

A URL that is associated with the Custom Page.
"http://www.example.com"

state
string

The Custom Page state
"default"

  • valid values: (default, customized)
required_tokens
array

String tokens that must be present in your customized HTML page
["::IM_UNDER_ATTACK_BOX::"]

  • read only
preview_target
string

The 'target' needed as part of the query string when previewing the Custom Page at cloudflarepreview.com
"preview:target"

  • notes: Should be used like this: cloudflarepreview.com/preview-cpage?act=preview&target=preview:target&url=<your url>
description
string

A short description of the Custom Page.
true

HTTP 5xx errors

Example object
{ "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "url": "http://www.example.com", "state": "default", "required_tokens": [ "::CLOUDFLARE_ERROR_500S_BOX::" ], "preview_target": "preview:target", "description": true }
Name /type Description /example Constraints
id
string


  • valid values: (500_errors)
created_on
string

When the Custom Page was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the Custom Page was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
url
string

A URL that is associated with the Custom Page.
"http://www.example.com"

state
string

The Custom Page state
"default"

  • valid values: (default, customized)
required_tokens
array

String tokens that must be present in your customized HTML page
["::CLOUDFLARE_ERROR_500S_BOX::"]

  • read only
preview_target
string

The 'target' needed as part of the query string when previewing the Custom Page at cloudflarepreview.com
"preview:target"

  • notes: Should be used like this: cloudflarepreview.com/preview-cpage?act=preview&target=preview:target&url=<your url>
description
string

A short description of the Custom Page.
true

HTTP 10xx errors

Example object
{ "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "url": "http://www.example.com", "state": "default", "required_tokens": [ "::CLOUDFLARE_ERROR_1000S_BOX::" ], "preview_target": "preview:target", "description": true }
Name /type Description /example Constraints
id
string


  • valid values: (1000_errors)
created_on
string

When the Custom Page was created
"2014-01-01T05:20:00.12345Z"

  • read only
modified_on
string

When the Custom Page was last modified
"2014-01-01T05:20:00.12345Z"

  • read only
url
string

A URL that is associated with the Custom Page.
"http://www.example.com"

state
string

The Custom Page state
"default"

  • valid values: (default, customized)
required_tokens
array

String tokens that must be present in your customized HTML page
["::CLOUDFLARE_ERROR_1000S_BOX::"]

  • read only
preview_target
string

The 'target' needed as part of the query string when previewing the Custom Page at cloudflarepreview.com
"preview:target"

  • notes: Should be used like this: cloudflarepreview.com/preview-cpage?act=preview&target=preview:target&url=<your url>
description
string

A short description of the Custom Page.
true