Help Center/ EventGrid/ API Reference/ APIs/ Event Subscription Management/ Enabling or Disabling Event Subscriptions
Updated on 2025-11-07 GMT+08:00

Enabling or Disabling Event Subscriptions

Function

This API is used to enable or disable event subscriptions.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

URI

POST /v1/{project_id}/subscriptions/operation

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant resource space ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

ID of an enterprise project used for creating a subscription.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

subscription_ids

No

Array of strings

List of subscription IDs. A maximum of 10 subscriptions are supported in batch.

operation

No

String

Operation type.

Response Parameters

Status code: 200

Table 5 Response header parameters

Parameter

Type

Description

X-Request-Id

String

This field is the request ID number for task tracking. Format is request_uuid-timestamp-hostname.

Table 6 Response body parameters

Parameter

Type

Description

failed_count

Integer

Number of subscriptions that fail to be operated.

events

Array of events objects

Event list.

Table 7 events

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Failure cause.

subscription_id

String

Subscription ID.

Example Requests

Enable or disable event subscriptions.

POST https://{endpoint}/v1/{project_id}/subscriptions/operation

{
  "subscription_ids" : [ "23709d68-54d5-423b-a6be-03302e893152" ],
  "operation" : "DISABLE"
}

Example Responses

Status code: 200

Demo Information

{
  "failed_count" : 0,
  "events" : [ {
    "subscription_id" : "23709d68-54d5-423b-a6be-03302e893152"
  } ]
}

Status Codes

Status Code

Description

200

Demo Information

Error Codes

See Error Codes.