.nh .TH "GH-EVENT-SUBSCRIPTION-CREATE" "1" "Nov 2026" "" "GitHub CLI manual" .SH NAME gh-event-subscription-create - Create an event subscription (preview) .SH SYNOPSIS \fBgh event subscription create [flags]\fR .SH DESCRIPTION Create a subscription to events of the given types on a resource, without listening to it. .PP Pass the resource URL with \fB--resource\fR and the event types with \fB--event\fR, repeating the flag or separating types with commas: .IP \(bu 2 \fBcom.github.pull_request.review.submitted.v1\fR: a review was submitted .IP \(bu 2 \fBcom.github.pull_request.state.changed.v1\fR: the pull request was merged, closed, reopened, marked ready for review, or converted to draft .IP \(bu 2 \fBcom.github.pull_request.head.changed.v1\fR: the head branch changed, for example after a push .IP \(bu 2 \fBcom.github.pull_request.merge_conflict.v1\fR: the pull request has a merge conflict .IP \(bu 2 \fBcom.github.pull_request.check_suite.status.changed.v1\fR: a check suite on the head commit completed, such as a CI workflow .PP Creating a subscription is idempotent: if an active subscription for the same resource and event types exists, it is returned instead. .PP Once successful, the command prints the subscription ID to stdout. Use \fBgh event listen --subscription\fR to receive its events. To create a subscription and listen to it in one step, use \fBgh event listen --resource\fR instead. .SH OPTIONS .TP \fB--event\fR \fB\fR Event type to subscribe to; repeat or separate with commas for more than one .TP \fB-q\fR, \fB--jq\fR \fB\fR Filter JSON output using a jq expression .TP \fB--json\fR \fB\fR Output JSON with the specified fields .TP \fB--resource\fR \fB\fR URL of the resource to subscribe to .TP \fB-t\fR, \fB--template\fR \fB\fR Format JSON output using a Go template; see "gh help formatting" .SH JSON FIELDS \fBcreatedAt\fR, \fBeventTypes\fR, \fBeventsUrl\fR, \fBexpiresAt\fR, \fBid\fR, \fBresourceUrl\fR, \fBurl\fR .SH EXIT CODES 0: Successful execution .PP 1: Error .PP 2: Command canceled .PP 4: Authentication required .PP NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. .SH EXAMPLE .EX # 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 .EE .SH SEE ALSO \fBgh-event-subscription(1)\fR