## Update Event Subscription `client.Queues.Subscriptions.Update(ctx, subscriptionID, params) (*SubscriptionUpdateResponse, error)` **patch** `/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}` Update an existing event subscription ### Parameters - `subscriptionID string` A Resource identifier. - `params SubscriptionUpdateParams` - `AccountID param.Field[string]` Path param: A Resource identifier. - `Destination param.Field[SubscriptionUpdateParamsDestination]` Body param: Destination configuration for the subscription - `QueueID string` ID of the target queue - `Type SubscriptionUpdateParamsDestinationType` Type of destination - `const SubscriptionUpdateParamsDestinationTypeQueuesQueue SubscriptionUpdateParamsDestinationType = "queues.queue"` - `Enabled param.Field[bool]` Body param: Whether the subscription is active - `Events param.Field[[]string]` Body param: List of event types this subscription handles - `Name param.Field[string]` Body param: Name of the subscription ### Returns - `type SubscriptionUpdateResponse struct{…}` - `ID string` Unique identifier for the subscription - `CreatedAt Time` When the subscription was created - `Destination SubscriptionUpdateResponseDestination` Destination configuration for the subscription - `QueueID string` ID of the target queue - `Type SubscriptionUpdateResponseDestinationType` Type of destination - `const SubscriptionUpdateResponseDestinationTypeQueuesQueue SubscriptionUpdateResponseDestinationType = "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 SubscriptionUpdateResponseSource` Source configuration for the subscription - `type SubscriptionUpdateResponseSourceMqEventSourceImages struct{…}` - `Type SubscriptionUpdateResponseSourceMqEventSourceImagesType` Type of source - `const SubscriptionUpdateResponseSourceMqEventSourceImagesTypeImages SubscriptionUpdateResponseSourceMqEventSourceImagesType = "images"` - `type SubscriptionUpdateResponseSourceMqEventSourceKV struct{…}` - `Type SubscriptionUpdateResponseSourceMqEventSourceKVType` Type of source - `const SubscriptionUpdateResponseSourceMqEventSourceKVTypeKV SubscriptionUpdateResponseSourceMqEventSourceKVType = "kv"` - `type SubscriptionUpdateResponseSourceMqEventSourceR2 struct{…}` - `Type SubscriptionUpdateResponseSourceMqEventSourceR2Type` Type of source - `const SubscriptionUpdateResponseSourceMqEventSourceR2TypeR2 SubscriptionUpdateResponseSourceMqEventSourceR2Type = "r2"` - `type SubscriptionUpdateResponseSourceMqEventSourceSuperSlurper struct{…}` - `Type SubscriptionUpdateResponseSourceMqEventSourceSuperSlurperType` Type of source - `const SubscriptionUpdateResponseSourceMqEventSourceSuperSlurperTypeSuperSlurper SubscriptionUpdateResponseSourceMqEventSourceSuperSlurperType = "superSlurper"` - `type SubscriptionUpdateResponseSourceMqEventSourceVectorize struct{…}` - `Type SubscriptionUpdateResponseSourceMqEventSourceVectorizeType` Type of source - `const SubscriptionUpdateResponseSourceMqEventSourceVectorizeTypeVectorize SubscriptionUpdateResponseSourceMqEventSourceVectorizeType = "vectorize"` - `type SubscriptionUpdateResponseSourceMqEventSourceWorkersAIModel struct{…}` - `ModelName string` Name of the Workers AI model - `Type SubscriptionUpdateResponseSourceMqEventSourceWorkersAIModelType` Type of source - `const SubscriptionUpdateResponseSourceMqEventSourceWorkersAIModelTypeWorkersAIModel SubscriptionUpdateResponseSourceMqEventSourceWorkersAIModelType = "workersAi.model"` - `type SubscriptionUpdateResponseSourceMqEventSourceWorkersBuildsWorker struct{…}` - `Type SubscriptionUpdateResponseSourceMqEventSourceWorkersBuildsWorkerType` Type of source - `const SubscriptionUpdateResponseSourceMqEventSourceWorkersBuildsWorkerTypeWorkersBuildsWorker SubscriptionUpdateResponseSourceMqEventSourceWorkersBuildsWorkerType = "workersBuilds.worker"` - `WorkerName string` Name of the worker - `type SubscriptionUpdateResponseSourceMqEventSourceWorkflowsWorkflow struct{…}` - `Type SubscriptionUpdateResponseSourceMqEventSourceWorkflowsWorkflowType` Type of source - `const SubscriptionUpdateResponseSourceMqEventSourceWorkflowsWorkflowTypeWorkflowsWorkflow SubscriptionUpdateResponseSourceMqEventSourceWorkflowsWorkflowType = "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"), ) subscription, err := client.Queues.Subscriptions.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", queues.SubscriptionUpdateParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", subscription.ID) } ``` #### 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" } }, "success": true } ```