Help Center/ EventGrid/ API Reference/ APIs/ Event Management/ Prechecking Event Publishing Status
Updated on 2025-05-06 GMT+08:00

Prechecking Event Publishing Status

Function

This API is used to precheck whether the events from an event source can be published successfully. For example, an event can be published successfully only if there is a subscription to the event source.

URI

POST /v1/{project_id}/events/check

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant resource space ID.

Request Parameters

Table 2 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 3 Request body parameters

Parameter

Mandatory

Type

Description

sources

No

Array of sources objects

Event source parameters.

Table 4 sources

Parameter

Mandatory

Type

Description

channel_id

No

String

ID of the event channel.

source_name

No

String

Name of the event source.

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 events that fail the precheck.

sources

Array of CheckPutEventsResult objects

Event source parameters.

Table 7 CheckPutEventsResult

Parameter

Type

Description

channel_id

String

ID of the event channel.

source_name

String

Name of the event source.

check_result

Boolean

Result indicating whether the event will be successfully published.

check_detail

String

Details about the precheck result.

Example Requests

Precheck event publishing status.

POST https://{endpoint}/v1/{project_id}/events/check

{
  "sources" : [ {
    "channel_id" : "092e1243e88146768798b0e8c9933192",
    "source_name" : "source-demo"
  } ]
}

Example Responses

Status code: 200

Information

{
  "failed_count" : 0,
  "sources" : [ { } ]
}

Status Codes

Status Code

Description

200

Information

Error Codes

See Error Codes.