GH-EVENT-SUBSCRIPTION-CREATE(1) GitHub CLI manual GH-EVENT-SUBSCRIPTION-CREATE(1)

gh-event-subscription-create - Create an event subscription (preview)

gh event subscription create [flags]

Create a subscription to events of the given types on a resource, without listening to it.

Pass the resource URL with --resource and the event types with --event, repeating the flag or separating types with commas:

  • com.github.pull_request.review.submitted.v1: a review was submitted
  • com.github.pull_request.state.changed.v1: the pull request was merged, closed, reopened, marked ready for review, or converted to draft
  • com.github.pull_request.head.changed.v1: the head branch changed, for example after a push
  • com.github.pull_request.merge_conflict.v1: the pull request has a merge conflict
  • com.github.pull_request.check_suite.status.changed.v1: a check suite on the head commit completed, such as a CI workflow

Creating a subscription is idempotent: if an active subscription for the same resource and event types exists, it is returned instead.

Once successful, the command prints the subscription ID to stdout. Use gh event listen --subscription to receive its events. To create a subscription and listen to it in one step, use gh event listen --resource instead.

Event type to subscribe to; repeat or separate with commas for more than one
Filter JSON output using a jq expression
Output JSON with the specified fields
URL of the resource to subscribe to
Format JSON output using a Go template; see "gh help formatting"

createdAt, eventTypes, eventsUrl, expiresAt, id, resourceUrl, url

0: Successful execution

1: Error

2: Command canceled

4: Authentication required

NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

# Subscribe to reviews and state changes of a pull request
$ gh event subscription create --resource https://github.com/OWNER/REPO/pull/123 --event com.github.pull_request.review.submitted.v1,com.github.pull_request.state.changed.v1

gh-event-subscription(1)

Nov 2026