## 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 ### Parameters - `params SubscriptionListParams` - `AccountID param.Field[string]` Path param: A Resource identifier. - `Direction param.Field[SubscriptionListParamsDirection]` Query param: Sort direction - `const SubscriptionListParamsDirectionAsc SubscriptionListParamsDirection = "asc"` - `const SubscriptionListParamsDirectionDesc SubscriptionListParamsDirection = "desc"` - `Order param.Field[SubscriptionListParamsOrder]` 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]` Query param: Page number for pagination - `PerPage param.Field[int64]` Query param: Number of items per page ### Returns - `type SubscriptionListResponse struct{…}` - `ID string` Unique identifier for the subscription - `CreatedAt Time` When the subscription was created - `Destination SubscriptionListResponseDestination` Destination configuration for the subscription - `QueueID string` ID of the target queue - `Type SubscriptionListResponseDestinationType` Type of destination - `const SubscriptionListResponseDestinationTypeQueuesQueue SubscriptionListResponseDestinationType = "queues.queue"` - `Enabled bool` Whether the subscription is active - `Events []string` List of event types this subscription handles - `ModifiedAt Time` When the subscription was last modified - `Name string` Name of the subscription - `Source SubscriptionListResponseSource` Source configuration for the subscription - `type SubscriptionListResponseSourceMqEventSourceImages struct{…}` - `Type SubscriptionListResponseSourceMqEventSourceImagesType` Type of source - `const SubscriptionListResponseSourceMqEventSourceImagesTypeImages SubscriptionListResponseSourceMqEventSourceImagesType = "images"` - `type SubscriptionListResponseSourceMqEventSourceKV struct{…}` - `Type SubscriptionListResponseSourceMqEventSourceKVType` Type of source - `const SubscriptionListResponseSourceMqEventSourceKVTypeKV SubscriptionListResponseSourceMqEventSourceKVType = "kv"` - `type SubscriptionListResponseSourceMqEventSourceR2 struct{…}` - `Type SubscriptionListResponseSourceMqEventSourceR2Type` Type of source - `const SubscriptionListResponseSourceMqEventSourceR2TypeR2 SubscriptionListResponseSourceMqEventSourceR2Type = "r2"` - `type SubscriptionListResponseSourceMqEventSourceSuperSlurper struct{…}` - `Type SubscriptionListResponseSourceMqEventSourceSuperSlurperType` Type of source - `const SubscriptionListResponseSourceMqEventSourceSuperSlurperTypeSuperSlurper SubscriptionListResponseSourceMqEventSourceSuperSlurperType = "superSlurper"` - `type SubscriptionListResponseSourceMqEventSourceVectorize struct{…}` - `Type SubscriptionListResponseSourceMqEventSourceVectorizeType` Type of source - `const SubscriptionListResponseSourceMqEventSourceVectorizeTypeVectorize SubscriptionListResponseSourceMqEventSourceVectorizeType = "vectorize"` - `type SubscriptionListResponseSourceMqEventSourceWorkersAIModel struct{…}` - `ModelName string` Name of the Workers AI model - `Type SubscriptionListResponseSourceMqEventSourceWorkersAIModelType` Type of source - `const SubscriptionListResponseSourceMqEventSourceWorkersAIModelTypeWorkersAIModel SubscriptionListResponseSourceMqEventSourceWorkersAIModelType = "workersAi.model"` - `type SubscriptionListResponseSourceMqEventSourceWorkersBuildsWorker struct{…}` - `Type SubscriptionListResponseSourceMqEventSourceWorkersBuildsWorkerType` Type of source - `const SubscriptionListResponseSourceMqEventSourceWorkersBuildsWorkerTypeWorkersBuildsWorker SubscriptionListResponseSourceMqEventSourceWorkersBuildsWorkerType = "workersBuilds.worker"` - `WorkerName string` Name of the worker - `type SubscriptionListResponseSourceMqEventSourceWorkflowsWorkflow struct{…}` - `Type SubscriptionListResponseSourceMqEventSourceWorkflowsWorkflowType` Type of source - `const SubscriptionListResponseSourceMqEventSourceWorkflowsWorkflowTypeWorkflowsWorkflow SubscriptionListResponseSourceMqEventSourceWorkflowsWorkflowType = "workflows.workflow"` - `WorkflowName string` Name of the workflow ### Example ```go 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) } ``` #### Response ```json { "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 } ```