API Gateway APIs (4.0.0)

Download OpenAPI specification:Download

The Cloudflare Client API

API Shield Settings

Retrieve information about specific configuration properties

Authorizations:
(api_tokenapi_keyapi_email)
path Parameters
zone_id
required
string (identifier) <= 32 characters
Example: 023e105f4ecef8ad9ca31a8372d0c353

Identifier

query Parameters
properties
Array of strings (properties) unique
Items Value: "auth_id_characteristics"
Example: properties=auth_id_characteristics

Requests information about certain properties.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "errors": [ ],
  • "messages": [ ],
  • "result": {
    }
}

Set configuration properties

Authorizations:
(api_tokenapi_keyapi_email)
path Parameters
zone_id
required
string (identifier) <= 32 characters
Example: 023e105f4ecef8ad9ca31a8372d0c353

Identifier

Request Body schema: application/json
Array of objects (characteristics) <= 10 items unique

Responses

Request samples

Content type
application/json
{
  • "auth_id_characteristics": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "errors": [ ],
  • "messages": [ ],
  • "result": { }
}

API Shield Endpoint Management

Retrieve information about an operation

Authorizations:
(api_tokenapi_keyapi_email)
path Parameters
operation_id
required
string (uuid) <= 36 characters
Example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415

UUID

zone_id
required
string (identifier) <= 32 characters
Example: 023e105f4ecef8ad9ca31a8372d0c353

Identifier

query Parameters
feature
Array of strings unique
Items Enum: "thresholds" "parameter_schemas"
Example: feature=thresholds

Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "errors": [ ],
  • "messages": [ ],
  • "result": {
    }
}

Delete an operation

Authorizations:
(api_tokenapi_keyapi_email)
path Parameters
operation_id
required
string (uuid) <= 36 characters
Example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415

UUID

zone_id
required
string (identifier) <= 32 characters
Example: 023e105f4ecef8ad9ca31a8372d0c353

Identifier

Request Body schema: application/json
Schema not provided

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "errors": [ ],
  • "messages": [ ],
  • "result": { }
}

Retrieve information about all operations on a zone

Authorizations:
(api_tokenapi_keyapi_email)
path Parameters
zone_id
required
string (identifier) <= 32 characters
Example: 023e105f4ecef8ad9ca31a8372d0c353

Identifier

query Parameters
per_page
number (per_page) [ 5 .. 50 ]
Default: 20

Maximum number of results per page.

order
string
Enum: "method" "host" "endpoint" "thresholds.$key"
Example: order=method

Field to order by. When requesting a feature, the feature keys are available for ordering as well, e.g., thresholds.suggested_threshold.

host
Array of strings unique
Example: host=api.cloudflare.com

Filter results to only include the specified hosts.

method
Array of strings unique
Example: method=GET

Filter results to only include the specified HTTP methods.

endpoint
string
Example: endpoint=/api/v1

Filter results to only include endpoints containing this pattern.

page
number >= 1
Default: 1

Page number of paginated results.

feature
Array of strings unique
Items Enum: "thresholds" "parameter_schemas"
Example: feature=thresholds

Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.

direction
string
Enum: "asc" "desc"
Example: direction=desc

Direction to order results.

Responses

Response samples

Content type
application/json
Example
{
  • "success": true,
  • "errors": [ ],
  • "messages": [ ],
  • "result": {
    },
  • "result_info": {
    }
}

Add operations to a zone

Add one or more operations to a zone. Endpoints can contain path variables. Host, method, endpoint will be normalized to a canoncial form when creating an operation and must be unique on the zone. Inserting an operation that matches an existing one will return the record of the already existing operation and update its last_updated date.

Authorizations:
(api_tokenapi_keyapi_email)
path Parameters
zone_id
required
string (identifier) <= 32 characters
Example: 023e105f4ecef8ad9ca31a8372d0c353

Identifier

Request Body schema: application/json
Array
host
string <hostname> (host) <= 255 characters

RFC3986-compliant host.

method
string (method)
Enum: "GET" "POST" "HEAD" "OPTIONS" "PUT" "DELETE" "CONNECT" "PATCH" "TRACE"

The HTTP method used to access the endpoint.

endpoint
string <uri-template> (endpoint) <= 4096 characters ^/.*$

The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "success": true,
  • "errors": [ ],
  • "messages": [ ],
  • "result": [
    ],
  • "result_info": {
    }
}

Retrieve operations and features as OpenAPI schemas

Authorizations:
(api_tokenapi_keyapi_email)
path Parameters
zone_id
required
string (identifier) <= 32 characters
Example: 023e105f4ecef8ad9ca31a8372d0c353

Identifier

query Parameters
host
Array of strings unique
Example: host=www.example.com

Receive schema only for the given host(s).

feature
Array of strings unique
Items Enum: "thresholds" "parameter_schemas"
Example: feature=thresholds

Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "errors": [ ],
  • "messages": [ ],
  • "result": {
    }
}

Retrieve API Discovery results for a zone

Retrieve the most up to date view of API Discovery on a zone.

Authorizations:
(api_tokenapi_keyapi_email)
path Parameters
zone_id
required
string (identifier) <= 32 characters
Example: 023e105f4ecef8ad9ca31a8372d0c353

Identifier

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "errors": [ ],
  • "messages": [ ],
  • "result": {
    }
}

API Shield Sequence Rules

List rules

List all currently configured sequence rules.

Authorizations:
(api_tokenapi_keyapi_email)
path Parameters
zone_id
required
string (identifier) <= 32 characters
Example: 023e105f4ecef8ad9ca31a8372d0c353

Identifier

query Parameters
page
number >= 1
Default: 1

Page number of paginated results.

per_page
number [ 5 .. 50 ]
Default: 20

Maximum number of results per page.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "errors": [ ],
  • "messages": [ ],
  • "result_info": {
    },
  • "result": {
    }
}

Set rules

Replace the existing set of rules with the ones provided.

Authorizations:
(api_tokenapi_keyapi_email)
path Parameters
zone_id
required
string (identifier) <= 32 characters
Example: 023e105f4ecef8ad9ca31a8372d0c353

Identifier

Request Body schema: application/json
Array of objects (seq-rule-request)

Responses

Request samples

Content type
application/json
{
  • "rules": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "errors": [ ],
  • "messages": [ ],
  • "result": {
    }
}

Add a rule

Adds a single rule to the set of sequence rules.

Authorizations:
(api_tokenapi_keyapi_email)
path Parameters
zone_id
required
string (identifier) <= 32 characters
Example: 023e105f4ecef8ad9ca31a8372d0c353

Identifier

Request Body schema: application/json
title
string [ 1 .. 50 ] characters

A short description of the rule

kind
string
Enum: "block" "allow"

Describes if the sequence should be allowed or forbidden

action
string
Enum: "block" "log"

The action that should be performed when the sequence rules is activated

sequence
Array of strings (schemas-uuid) [ items <= 36 characters ]

References to operations from endpoint management which form a sequence. Operations must all have the same host.

priority
integer
Default: 0

An indicator which precedence this rules has over other rules. Rules with a higher priority number are executed before rules with a lower priority number. Rules with the same priority are executed in order that they were added.

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "kind": "block",
  • "action": "block",
  • "sequence": [
    ],
  • "priority": 0
}

Response samples

Content type
application/json
{
  • "success": true,
  • "errors": [ ],
  • "messages": [ ],
  • "result": {
    }
}

Delete a rule

Removes a single rule from the set of sequence rules.

Authorizations:
(api_tokenapi_keyapi_email)
path Parameters
zone_id
required
string (identifier) <= 32 characters
Example: 023e105f4ecef8ad9ca31a8372d0c353

Identifier

rule_id
required
string (schemas-uuid) <= 36 characters
Example: 0d9bf70c-92e1-4bb3-9411-34a3bcc59003

UUID identifier

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "errors": [ ],
  • "messages": [ ],
  • "result": {
    }
}