Skip to content
Start here

Retrieve information about all operations on a zone

client.APIGateway.Operations.List(ctx, params) (*V4PagePaginationArray[OperationListResponse], error)
GET/zones/{zone_id}/api_gateway/operations

Lists all API operations tracked by API Shield for a zone with pagination. Returns operation details including method, path, and feature configurations.

Security
API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

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

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

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

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Account API GatewayAccount API Gateway ReadDomain API GatewayDomain API Gateway Read
ParametersExpand Collapse
params OperationListParams
ZoneID param.Field[string]

Path param: Identifier.

maxLength32
Direction param.Field[OperationListParamsDirection]optional

Query param: Direction to order results.

const OperationListParamsDirectionAsc OperationListParamsDirection = "asc"
const OperationListParamsDirectionDesc OperationListParamsDirection = "desc"
Endpoint param.Field[string]optional

Query param: Filter results to only include endpoints containing this pattern.

Feature param.Field[[]OperationListParamsFeature]optional

Query param: 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.

const OperationListParamsFeatureThresholds OperationListParamsFeature = "thresholds"
const OperationListParamsFeatureParameterSchemas OperationListParamsFeature = "parameter_schemas"
const OperationListParamsFeatureSchemaInfo OperationListParamsFeature = "schema_info"
Host param.Field[[]string]optional

Query param: Filter results to only include the specified hosts.

Method param.Field[[]string]optional

Query param: Filter results to only include the specified HTTP methods.

Order param.Field[OperationListParamsOrder]optional

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

const OperationListParamsOrderMethod OperationListParamsOrder = "method"
const OperationListParamsOrderHost OperationListParamsOrder = "host"
const OperationListParamsOrderEndpoint OperationListParamsOrder = "endpoint"
const OperationListParamsOrderThresholdsKey OperationListParamsOrder = "thresholds.$key"
Page param.Field[int64]optional

Query param: Page number of paginated results.

minimum1
PerPage param.Field[int64]optional

Query param: Maximum number of results per page.

maximum50
minimum5
ReturnsExpand Collapse
type OperationListResponse struct{…}
Endpoint string

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/.

formaturi-template
maxLength4096
Host string

RFC3986-compliant host.

formathostname
maxLength255
LastUpdated Time
formatdate-time
Method OperationListResponseMethod

The HTTP method used to access the endpoint.

One of the following:
const OperationListResponseMethodGet OperationListResponseMethod = "GET"
const OperationListResponseMethodPost OperationListResponseMethod = "POST"
const OperationListResponseMethodHead OperationListResponseMethod = "HEAD"
const OperationListResponseMethodOptions OperationListResponseMethod = "OPTIONS"
const OperationListResponseMethodPut OperationListResponseMethod = "PUT"
const OperationListResponseMethodDelete OperationListResponseMethod = "DELETE"
const OperationListResponseMethodConnect OperationListResponseMethod = "CONNECT"
const OperationListResponseMethodPatch OperationListResponseMethod = "PATCH"
const OperationListResponseMethodTrace OperationListResponseMethod = "TRACE"
OperationID string

UUID.

maxLength36
minLength36
Features OperationListResponseFeaturesoptional
One of the following:
type OperationListResponseFeaturesAPIShieldOperationFeatureThresholds struct{…}
Thresholds OperationListResponseFeaturesAPIShieldOperationFeatureThresholdsThresholdsoptional
AuthIDTokens int64optional

The total number of auth-ids seen across this calculation.

DataPoints int64optional

The number of data points used for the threshold suggestion calculation.

LastUpdated Timeoptional
formatdate-time
P50 int64optional

The p50 quantile of requests (in period_seconds).

P90 int64optional

The p90 quantile of requests (in period_seconds).

P99 int64optional

The p99 quantile of requests (in period_seconds).

PeriodSeconds int64optional

The period over which this threshold is suggested.

Requests int64optional

The estimated number of requests covered by these calculations.

SuggestedThreshold int64optional

The suggested threshold in requests done by the same auth_id or period_seconds.

type OperationListResponseFeaturesAPIShieldOperationFeatureParameterSchemas struct{…}
ParameterSchemas OperationListResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas
LastUpdated Timeoptional
formatdate-time
ParameterSchemas OperationListResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemasoptional

An operation schema object containing a response.

Parameters []unknownoptional

An array containing the learned parameter schemas.

Responses unknownoptional

An empty response object. This field is required to yield a valid operation schema.

type OperationListResponseFeaturesAPIShieldOperationFeatureAPIRouting struct{…}
APIRouting OperationListResponseFeaturesAPIShieldOperationFeatureAPIRoutingAPIRoutingoptional

API Routing settings on endpoint.

LastUpdated Timeoptional
formatdate-time
Route stringoptional

Target route.

type OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervals struct{…}
ConfidenceIntervals OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsoptional
LastUpdated Timeoptional
formatdate-time
SuggestedThreshold OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdoptional
ConfidenceIntervals OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsoptional
P90 OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90optional

Upper and lower bound for percentile estimate

Lower float64optional

Lower bound for percentile estimate

Upper float64optional

Upper bound for percentile estimate

P95 OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95optional

Upper and lower bound for percentile estimate

Lower float64optional

Lower bound for percentile estimate

Upper float64optional

Upper bound for percentile estimate

P99 OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99optional

Upper and lower bound for percentile estimate

Lower float64optional

Lower bound for percentile estimate

Upper float64optional

Upper bound for percentile estimate

Mean float64optional

Suggested threshold.

type OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfo struct{…}
SchemaInfo OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfooptional
ActiveSchema OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchemaoptional

Schema active on endpoint.

ID stringoptional

UUID.

maxLength36
minLength36
CreatedAt Timeoptional
formatdate-time
IsLearned booloptional

True if schema is Cloudflare-provided.

Name stringoptional

Schema file name.

LearnedAvailable booloptional

True if a Cloudflare-provided learned schema is available for this endpoint.

MitigationAction OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionoptional

Action taken on requests failing validation.

One of the following:
const OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionNone OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "none"
const OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionLog OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "log"
const OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionBlock OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "block"

Retrieve information about all operations on a zone

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/api_gateway"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.APIGateway.Operations.List(context.TODO(), api_gateway.OperationListParams{
    ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "endpoint": "/api/v1/users/{var1}",
      "host": "www.example.com",
      "last_updated": "2014-01-01T05:20:00.12345Z",
      "method": "GET",
      "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
      "features": {
        "thresholds": {
          "auth_id_tokens": 0,
          "data_points": 0,
          "last_updated": "2014-01-01T05:20:00.12345Z",
          "p50": 0,
          "p90": 0,
          "p99": 0,
          "period_seconds": 0,
          "requests": 0,
          "suggested_threshold": 0
        }
      }
    }
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "endpoint": "/api/v1/users/{var1}",
      "host": "www.example.com",
      "last_updated": "2014-01-01T05:20:00.12345Z",
      "method": "GET",
      "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
      "features": {
        "thresholds": {
          "auth_id_tokens": 0,
          "data_points": 0,
          "last_updated": "2014-01-01T05:20:00.12345Z",
          "p50": 0,
          "p90": 0,
          "p99": 0,
          "period_seconds": 0,
          "requests": 0,
          "suggested_threshold": 0
        }
      }
    }
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}