Skip to content
Start here

Get Event Subscription

client.Queues.Subscriptions.Get(ctx, subscriptionID, query) (*SubscriptionGetResponse, error)
GET/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}

Get details about an existing event subscription

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 WriteWorkers Scripts Write
ParametersExpand Collapse
subscriptionID string

A Resource identifier.

maxLength32
query SubscriptionGetParams
AccountID param.Field[string]

A Resource identifier.

maxLength32
ReturnsExpand Collapse
type SubscriptionGetResponse struct{…}
ID string

Unique identifier for the subscription

CreatedAt Time

When the subscription was created

formatdate-time
Destination SubscriptionGetResponseDestination

Destination configuration for the subscription

QueueID string

ID of the target queue

Type SubscriptionGetResponseDestinationType

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 SubscriptionGetResponseSource

Source configuration for the subscription

One of the following:
type SubscriptionGetResponseSourceMqEventSourceImages struct{…}
Type SubscriptionGetResponseSourceMqEventSourceImagesTypeoptional

Type of source

type SubscriptionGetResponseSourceMqEventSourceKV struct{…}
Type SubscriptionGetResponseSourceMqEventSourceKVTypeoptional

Type of source

type SubscriptionGetResponseSourceMqEventSourceR2 struct{…}
Type SubscriptionGetResponseSourceMqEventSourceR2Typeoptional

Type of source

type SubscriptionGetResponseSourceMqEventSourceSuperSlurper struct{…}
Type SubscriptionGetResponseSourceMqEventSourceSuperSlurperTypeoptional

Type of source

type SubscriptionGetResponseSourceMqEventSourceVectorize struct{…}
Type SubscriptionGetResponseSourceMqEventSourceVectorizeTypeoptional

Type of source

type SubscriptionGetResponseSourceMqEventSourceWorkersAIModel struct{…}
ModelName stringoptional

Name of the Workers AI model

Type SubscriptionGetResponseSourceMqEventSourceWorkersAIModelTypeoptional

Type of source

type SubscriptionGetResponseSourceMqEventSourceWorkersBuildsWorker struct{…}
Type SubscriptionGetResponseSourceMqEventSourceWorkersBuildsWorkerTypeoptional

Type of source

WorkerName stringoptional

Name of the worker

type SubscriptionGetResponseSourceMqEventSourceWorkflowsWorkflow struct{…}
Type SubscriptionGetResponseSourceMqEventSourceWorkflowsWorkflowTypeoptional

Type of source

WorkflowName stringoptional

Name of the workflow

Get Event Subscription

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"),
  )
  subscription, err := client.Queues.Subscriptions.Get(
    context.TODO(),
    "023e105f4ecef8ad9ca31a8372d0c353",
    queues.SubscriptionGetParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", subscription.ID)
}
{
  "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"
    }
  },
  "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"
    }
  },
  "success": true
}