Skip to content
Start here

List Event Subscriptions

client.Queues.Subscriptions.List(ctx, params) (*V4PagePaginationArray[SubscriptionListResponse], error)
GET/accounts/{account_id}/event_subscriptions/subscriptions

Get a paginated list of event subscriptions with optional sorting and filtering

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)
Queues WriteQueues ReadWorkers Scripts WriteWorkers Scripts Read
ParametersExpand Collapse
params SubscriptionListParams
AccountID param.Field[string]

Path param: A Resource identifier.

maxLength32
Direction param.Field[SubscriptionListParamsDirection]optional

Query param: Sort direction

const SubscriptionListParamsDirectionAsc SubscriptionListParamsDirection = "asc"
const SubscriptionListParamsDirectionDesc SubscriptionListParamsDirection = "desc"
Order param.Field[SubscriptionListParamsOrder]optional

Query param: Field to sort by

const SubscriptionListParamsOrderCreatedAt SubscriptionListParamsOrder = "created_at"
const SubscriptionListParamsOrderName SubscriptionListParamsOrder = "name"
const SubscriptionListParamsOrderEnabled SubscriptionListParamsOrder = "enabled"
const SubscriptionListParamsOrderSource SubscriptionListParamsOrder = "source"
Page param.Field[int64]optional

Query param: Page number for pagination

minimum1
PerPage param.Field[int64]optional

Query param: Number of items per page

maximum100
minimum1
ReturnsExpand Collapse
type SubscriptionListResponse struct{…}
ID string

Unique identifier for the subscription

CreatedAt Time

When the subscription was created

formatdate-time
Destination SubscriptionListResponseDestination

Destination configuration for the subscription

QueueID string

ID of the target queue

Type SubscriptionListResponseDestinationType

Type of destination

Enabled bool

Whether the subscription is active

Events []string

List of event types this subscription handles

ModifiedAt Time

When the subscription was last modified

formatdate-time
Name string

Name of the subscription

Source SubscriptionListResponseSource

Source configuration for the subscription

One of the following:
type SubscriptionListResponseSourceMqEventSourceImages struct{…}
Type SubscriptionListResponseSourceMqEventSourceImagesTypeoptional

Type of source

type SubscriptionListResponseSourceMqEventSourceKV struct{…}
Type SubscriptionListResponseSourceMqEventSourceKVTypeoptional

Type of source

type SubscriptionListResponseSourceMqEventSourceR2 struct{…}
Type SubscriptionListResponseSourceMqEventSourceR2Typeoptional

Type of source

type SubscriptionListResponseSourceMqEventSourceSuperSlurper struct{…}
Type SubscriptionListResponseSourceMqEventSourceSuperSlurperTypeoptional

Type of source

type SubscriptionListResponseSourceMqEventSourceVectorize struct{…}
Type SubscriptionListResponseSourceMqEventSourceVectorizeTypeoptional

Type of source

type SubscriptionListResponseSourceMqEventSourceWorkersAIModel struct{…}
ModelName stringoptional

Name of the Workers AI model

Type SubscriptionListResponseSourceMqEventSourceWorkersAIModelTypeoptional

Type of source

type SubscriptionListResponseSourceMqEventSourceWorkersBuildsWorker struct{…}
Type SubscriptionListResponseSourceMqEventSourceWorkersBuildsWorkerTypeoptional

Type of source

WorkerName stringoptional

Name of the worker

type SubscriptionListResponseSourceMqEventSourceWorkflowsWorkflow struct{…}
Type SubscriptionListResponseSourceMqEventSourceWorkflowsWorkflowTypeoptional

Type of source

WorkflowName stringoptional

Name of the workflow

List Event Subscriptions

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.Queues.Subscriptions.List(context.TODO(), queues.SubscriptionListParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "errors": [
    {
      "code": 7003,
      "message": "No route for the URI",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "destination": {
        "queue_id": "queue_id",
        "type": "queues.queue"
      },
      "enabled": true,
      "events": [
        "string"
      ],
      "modified_at": "2019-12-27T18:11:19.117Z",
      "name": "name",
      "source": {
        "type": "images"
      }
    }
  ],
  "result_info": {
    "count": 0,
    "page": 0,
    "per_page": 0,
    "total_count": 0,
    "total_pages": 0
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 7003,
      "message": "No route for the URI",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "destination": {
        "queue_id": "queue_id",
        "type": "queues.queue"
      },
      "enabled": true,
      "events": [
        "string"
      ],
      "modified_at": "2019-12-27T18:11:19.117Z",
      "name": "name",
      "source": {
        "type": "images"
      }
    }
  ],
  "result_info": {
    "count": 0,
    "page": 0,
    "per_page": 0,
    "total_count": 0,
    "total_pages": 0
  },
  "success": true
}