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.
/zones/{zone_id}/api_gateway/operations
post
API Shield Endpoint Management
api-shield-endpoint-management-add-operations-to-a-zone
null null [
{
"in": "path",
"name": "zone_id",
"required": true,
"schema": {
"description": "Identifier",
"example": "023e105f4ecef8ad9ca31a8372d0c353",
"maxLength": 32,
"readOnly": true,
"type": "string"
}
}
] {
"content": {
"application/json": {
"schema": {
"items": {
"properties": {
"endpoint": {
"description": "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/.",
"example": "/api/v1/users/{var1}",
"format": "uri-template",
"maxLength": 4096,
"pattern": "^/.*$",
"type": "string"
},
"host": {
"description": "RFC3986-compliant host.",
"example": "www.example.com",
"format": "hostname",
"maxLength": 255,
"type": "string"
},
"method": {
"description": "The HTTP method used to access the endpoint.",
"enum": [
"GET",
"POST",
"HEAD",
"OPTIONS",
"PUT",
"DELETE",
"CONNECT",
"PATCH",
"TRACE"
],
"example": "GET",
"type": "string"
}
},
"required": [
"method",
"host",
"endpoint"
],
"type": "object"
},
"type": "array"
}
}
},
"required": true
} {
"200": {
"content": {
"application/json": {
"schema": {
"allOf": [
{
"allOf": [
{
"properties": {
"errors": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"messages": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"result": {
"anyOf": [
{
"type": "object"
},
{
"items": {},
"type": "array"
},
{
"type": "string"
}
]
},
"success": {
"description": "Whether the API call was successful",
"example": true,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
},
{
"properties": {
"result": {
"items": {},
"nullable": true,
"type": "array"
},
"result_info": {
"properties": {
"count": {
"description": "Total number of results for the requested service",
"example": 1,
"type": "number"
},
"page": {
"description": "Current page within paginated list of results",
"example": 1,
"type": "number"
},
"per_page": {
"description": "Number of results per page of results",
"example": 20,
"type": "number"
},
"total_count": {
"description": "Total results available without any search parameters",
"example": 2000,
"type": "number"
}
},
"type": "object"
}
}
}
],
"type": "object"
},
{
"properties": {
"result": {
"items": {
"allOf": [
{
"allOf": [
{
"allOf": [
{
"properties": {
"endpoint": {
"description": "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/.",
"example": "/api/v1/users/{var1}",
"format": "uri-template",
"maxLength": 4096,
"pattern": "^/.*$",
"type": "string"
},
"host": {
"description": "RFC3986-compliant host.",
"example": "www.example.com",
"format": "hostname",
"maxLength": 255,
"type": "string"
},
"method": {
"description": "The HTTP method used to access the endpoint.",
"enum": [
"GET",
"POST",
"HEAD",
"OPTIONS",
"PUT",
"DELETE",
"CONNECT",
"PATCH",
"TRACE"
],
"example": "GET",
"type": "string"
}
},
"required": [
"method",
"host",
"endpoint"
],
"type": "object"
},
{
"properties": {
"features": {
"anyOf": [
{
"properties": {
"thresholds": {
"properties": {
"auth_id_tokens": {
"description": "The total number of auth-ids seen across this calculation.",
"readOnly": true,
"type": "integer"
},
"data_points": {
"description": "The number of data points used for the threshold suggestion calculation.",
"readOnly": true,
"type": "integer"
},
"last_updated": {
"example": "2014-01-01T05:20:00.12345Z",
"format": "date-time",
"readOnly": true,
"type": "string"
},
"p50": {
"description": "The p50 quantile of requests (in period_seconds).",
"readOnly": true,
"type": "integer"
},
"p90": {
"description": "The p90 quantile of requests (in period_seconds).",
"readOnly": true,
"type": "integer"
},
"p99": {
"description": "The p99 quantile of requests (in period_seconds).",
"readOnly": true,
"type": "integer"
},
"period_seconds": {
"description": "The period over which this threshold is suggested.",
"readOnly": true,
"type": "integer"
},
"requests": {
"description": "The estimated number of requests covered by these calculations.",
"readOnly": true,
"type": "integer"
},
"suggested_threshold": {
"description": "The suggested threshold in requests done by the same auth_id or period_seconds.",
"readOnly": true,
"type": "integer"
}
},
"type": "object"
}
},
"readOnly": true,
"required": [
"period_seconds",
"suggested_threshold",
"p50",
"p90",
"p99",
"requests",
"auth_id_tokens",
"data_points",
"last_updated"
],
"type": "object"
},
{
"properties": {
"parameter_schemas": {
"properties": {
"last_updated": {
"example": "2014-01-01T05:20:00.12345Z",
"format": "date-time",
"readOnly": true,
"type": "string"
},
"parameter_schemas": {
"description": "An operation schema object containing a response.",
"example": {
"parameters": [
{
"description": "Sufficient requests have been observed for this parameter to provide high confidence in this parameter schema.",
"in": "path",
"name": "var1",
"required": true,
"schema": {
"maximum": 10,
"minimum": 1,
"type": "integer"
}
}
],
"responses": null
},
"properties": {
"parameters": {
"description": "An array containing the learned parameter schemas.",
"example": [
{
"description": "Sufficient requests have been observed for this parameter to provide high confidence in this parameter schema.",
"in": "path",
"name": "var1",
"required": true,
"schema": {
"maximum": 10,
"minimum": 1,
"type": "integer"
}
}
],
"items": {},
"readOnly": true,
"type": "array"
},
"responses": {
"description": "An empty response object. This field is required to yield a valid operation schema.",
"nullable": true,
"readOnly": true,
"type": "object"
}
},
"readOnly": true,
"type": "object"
}
},
"type": "object"
}
},
"readOnly": true,
"required": [
"parameter_schemas",
"last_updated"
],
"type": "object"
}
],
"readOnly": true,
"type": "object"
},
"last_updated": {
"example": "2014-01-01T05:20:00.12345Z",
"format": "date-time",
"readOnly": true,
"type": "string"
},
"operation_id": {
"description": "UUID identifier",
"example": "0d9bf70c-92e1-4bb3-9411-34a3bcc59003",
"format": "uuid",
"maxLength": 36,
"readOnly": true,
"type": "string"
}
},
"required": [
"operation_id",
"last_updated"
]
}
],
"type": "object"
}
]
},
{
"properties": {
"features": {}
}
}
]
},
"type": "array"
}
}
}
]
}
}
},
"description": "Add operations to a zone response"
},
"4XX": {
"content": {
"application/json": {
"schema": {
"allOf": [
{
"allOf": [
{
"allOf": [
{
"properties": {
"errors": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"messages": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"result": {
"anyOf": [
{
"type": "object"
},
{
"items": {},
"type": "array"
},
{
"type": "string"
}
]
},
"success": {
"description": "Whether the API call was successful",
"example": true,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
},
{
"properties": {
"result": {
"items": {},
"nullable": true,
"type": "array"
},
"result_info": {
"properties": {
"count": {
"description": "Total number of results for the requested service",
"example": 1,
"type": "number"
},
"page": {
"description": "Current page within paginated list of results",
"example": 1,
"type": "number"
},
"per_page": {
"description": "Number of results per page of results",
"example": 20,
"type": "number"
},
"total_count": {
"description": "Total results available without any search parameters",
"example": 2000,
"type": "number"
}
},
"type": "object"
}
}
}
],
"type": "object"
},
{
"properties": {
"result": {
"items": {
"allOf": [
{
"allOf": [
{
"allOf": [
{
"properties": {
"endpoint": {
"description": "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/.",
"example": "/api/v1/users/{var1}",
"format": "uri-template",
"maxLength": 4096,
"pattern": "^/.*$",
"type": "string"
},
"host": {
"description": "RFC3986-compliant host.",
"example": "www.example.com",
"format": "hostname",
"maxLength": 255,
"type": "string"
},
"method": {
"description": "The HTTP method used to access the endpoint.",
"enum": [
"GET",
"POST",
"HEAD",
"OPTIONS",
"PUT",
"DELETE",
"CONNECT",
"PATCH",
"TRACE"
],
"example": "GET",
"type": "string"
}
},
"required": [
"method",
"host",
"endpoint"
],
"type": "object"
},
{
"properties": {
"features": {
"anyOf": [
{
"properties": {
"thresholds": {
"properties": {
"auth_id_tokens": {
"description": "The total number of auth-ids seen across this calculation.",
"readOnly": true,
"type": "integer"
},
"data_points": {
"description": "The number of data points used for the threshold suggestion calculation.",
"readOnly": true,
"type": "integer"
},
"last_updated": {
"example": "2014-01-01T05:20:00.12345Z",
"format": "date-time",
"readOnly": true,
"type": "string"
},
"p50": {
"description": "The p50 quantile of requests (in period_seconds).",
"readOnly": true,
"type": "integer"
},
"p90": {
"description": "The p90 quantile of requests (in period_seconds).",
"readOnly": true,
"type": "integer"
},
"p99": {
"description": "The p99 quantile of requests (in period_seconds).",
"readOnly": true,
"type": "integer"
},
"period_seconds": {
"description": "The period over which this threshold is suggested.",
"readOnly": true,
"type": "integer"
},
"requests": {
"description": "The estimated number of requests covered by these calculations.",
"readOnly": true,
"type": "integer"
},
"suggested_threshold": {
"description": "The suggested threshold in requests done by the same auth_id or period_seconds.",
"readOnly": true,
"type": "integer"
}
},
"type": "object"
}
},
"readOnly": true,
"required": [
"period_seconds",
"suggested_threshold",
"p50",
"p90",
"p99",
"requests",
"auth_id_tokens",
"data_points",
"last_updated"
],
"type": "object"
},
{
"properties": {
"parameter_schemas": {
"properties": {
"last_updated": {
"example": "2014-01-01T05:20:00.12345Z",
"format": "date-time",
"readOnly": true,
"type": "string"
},
"parameter_schemas": {
"description": "An operation schema object containing a response.",
"example": {
"parameters": [
{
"description": "Sufficient requests have been observed for this parameter to provide high confidence in this parameter schema.",
"in": "path",
"name": "var1",
"required": true,
"schema": {
"maximum": 10,
"minimum": 1,
"type": "integer"
}
}
],
"responses": null
},
"properties": {
"parameters": {
"description": "An array containing the learned parameter schemas.",
"example": [
{
"description": "Sufficient requests have been observed for this parameter to provide high confidence in this parameter schema.",
"in": "path",
"name": "var1",
"required": true,
"schema": {
"maximum": 10,
"minimum": 1,
"type": "integer"
}
}
],
"items": {},
"readOnly": true,
"type": "array"
},
"responses": {
"description": "An empty response object. This field is required to yield a valid operation schema.",
"nullable": true,
"readOnly": true,
"type": "object"
}
},
"readOnly": true,
"type": "object"
}
},
"type": "object"
}
},
"readOnly": true,
"required": [
"parameter_schemas",
"last_updated"
],
"type": "object"
}
],
"readOnly": true,
"type": "object"
},
"last_updated": {
"example": "2014-01-01T05:20:00.12345Z",
"format": "date-time",
"readOnly": true,
"type": "string"
},
"operation_id": {
"description": "UUID identifier",
"example": "0d9bf70c-92e1-4bb3-9411-34a3bcc59003",
"format": "uuid",
"maxLength": 36,
"readOnly": true,
"type": "string"
}
},
"required": [
"operation_id",
"last_updated"
]
}
],
"type": "object"
}
]
},
{
"properties": {
"features": {}
}
}
]
},
"type": "array"
}
}
}
]
},
{
"properties": {
"errors": {
"allOf": [
{
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
}
],
"example": [
{
"code": 7003,
"message": "No route for the URI"
}
],
"minLength": 1
},
"messages": {
"allOf": [
{
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
}
],
"example": []
},
"result": {
"nullable": true,
"type": "object"
},
"success": {
"description": "Whether the API call was successful",
"example": false,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
}
]
}
}
},
"description": "Add operations to a zone response failure"
}
} [
{
"api_email": [],
"api_key": []
}
]