Skip to content
Start here

Delete Event Subscription

client.Queues.Subscriptions.Delete(ctx, subscriptionID, body) (*SubscriptionDeleteResponse, error)
DELETE/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}

Delete 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
body SubscriptionDeleteParams
AccountID param.Field[string]

A Resource identifier.

maxLength32
ReturnsExpand Collapse
type SubscriptionDeleteResponse struct{…}
ID string

Unique identifier for the subscription

CreatedAt Time

When the subscription was created

formatdate-time
Destination SubscriptionDeleteResponseDestination

Destination configuration for the subscription

QueueID string

ID of the target queue

Type SubscriptionDeleteResponseDestinationType

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 SubscriptionDeleteResponseSource

Source configuration for the subscription

One of the following:
type SubscriptionDeleteResponseSourceMqEventSourceImages struct{…}
Type SubscriptionDeleteResponseSourceMqEventSourceImagesTypeoptional

Type of source

type SubscriptionDeleteResponseSourceMqEventSourceKV struct{…}
Type SubscriptionDeleteResponseSourceMqEventSourceKVTypeoptional

Type of source

type SubscriptionDeleteResponseSourceMqEventSourceR2 struct{…}
Type SubscriptionDeleteResponseSourceMqEventSourceR2Typeoptional

Type of source

type SubscriptionDeleteResponseSourceMqEventSourceSuperSlurper struct{…}
Type SubscriptionDeleteResponseSourceMqEventSourceSuperSlurperTypeoptional

Type of source

type SubscriptionDeleteResponseSourceMqEventSourceVectorize struct{…}
Type SubscriptionDeleteResponseSourceMqEventSourceVectorizeTypeoptional

Type of source

type SubscriptionDeleteResponseSourceMqEventSourceWorkersAIModel struct{…}
ModelName stringoptional

Name of the Workers AI model

Type SubscriptionDeleteResponseSourceMqEventSourceWorkersAIModelTypeoptional

Type of source

type SubscriptionDeleteResponseSourceMqEventSourceWorkersBuildsWorker struct{…}
Type SubscriptionDeleteResponseSourceMqEventSourceWorkersBuildsWorkerTypeoptional

Type of source

WorkerName stringoptional

Name of the worker

type SubscriptionDeleteResponseSourceMqEventSourceWorkflowsWorkflow struct{…}
Type SubscriptionDeleteResponseSourceMqEventSourceWorkflowsWorkflowTypeoptional

Type of source

WorkflowName stringoptional

Name of the workflow

Delete 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.Delete(
    context.TODO(),
    "023e105f4ecef8ad9ca31a8372d0c353",
    queues.SubscriptionDeleteParams{
      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
}