Skip to main content

Data Structure

CreateWebhookSubscriptionInput

An input object for WebhookSubscription creation
ParameterTypeDescription
labelStringOptional webhook subscription record label.
triggerEventWebhookTriggerEvent!An event ID that triggers this webhook.
targetUrlString!An endpoint URL where the webhook will be sent.
signatureStringOptional signature that could be used for payload authentication.

Mutations

createWebhookSubscription

Creates a new webhook subscription for a given event type by CreateWebhookSubscriptionInput input object. Once created, the subscription becomes active and will receive event payloads when the specified event is triggered.
  • The API user context must have AUTHENTICATED scope to access webhook subscriptions. Anonymous users cannot retrieve this data.
  • The API user context must have permission to create webhook subscriptions.
  • The API user context must be present and valid - otherwise, access is denied.
The following arguments can be used in the mutation:
ArgumentTypeDescription
inputCreateWebhookSubscriptionInput!Input data for creating a webhook subscription.
mutation createWebhookSubscription {
  createWebhookSubscription(input: {
    label: "User have complete a training",
    triggerEvent: USER_COMPLETED_TRAINING,
    targetUrl: "https://HOOKS_TARGET_ENDPOINT",
    signature: "MySecretSignature"
  }) {
    response {
      id
      label
      triggerEvent
      targetUrl
      status
    }
    errors
  }
}
The createWebhookSubscription mutation supports the same advanced features as other mutations: Common error scenarios and solutions:
  • 401 Unauthorized: Ensure you’re using a valid authentication token with AUTHENTICATED scope
  • 403 Forbidden: Verify your user account has the necessary permissions to access webhook subscription data