createWebhookSubscription
Creates subscription webhook. Requires advanced API access level.
CreateWebhookSubscriptionMutationInput
Autogenerated input type of CreateWebhookSubscriptionMutation
- clientMutationId: String
A unique identifier for the client performing the mutation.
- webhookUrl: Url!required
The URL of the endpoint on your server to be notified when the event occurs
- secret: String!required
The secret used to sign the JWT in the webhook request
- query: String!required
The query containing the subscription and fields required by the webhook endpoint
CreateWebhookSubscriptionMutationPayload
Autogenerated return type of CreateWebhookSubscriptionMutation.
- clientMutationId: String
A unique identifier for the client performing the mutation.
- errors: [InputError!]!
Validation errors
- webhookSubscription: WebhookSubscription
Query
mutation($input: CreateWebhookSubscriptionMutationInput!) {
createWebhookSubscription(input: $input) {
webhookSubscription {
id
webhookUrl
query
}
}
}Variables
{
"input": {
"webhookUrl": "http://example.com/wh",
"secret": "very_secret",
"query": "subscription { userCreated { id, emailAddress } }"
}
}Response
{
"data": {
"createWebhookSubscription": {
"webhookSubscription": {
"id": "WebhookSubscription-MEODC8",
"webhookUrl": "http://example.com/wh",
"query": "subscription { userCreated { id, emailAddress } }"
}
}
}
}