Add a webhook subscription target

Receive events for the whole organization or an office.

Use addWebhookSubscriptionTarget to receive events for more offices, or the whole organization, on an existing subscription. The target must be for the organization the subscription already targets.

Required scope: api-management

Request

mutation addWebhookSubscriptionTarget($input: AddWebhookTargetInput!) {
  addWebhookSubscriptionTarget(input: $input) {
    ... on WebhookSubscription {
      id
      endpoint
      eventTypes
    }
    ... on ValidationErrors {
      errors {
        message
      }
    }
  }
}

Variables

{
  "input": {
    "webhookSubscriptionId": "318",
    "target": {
      "organizationKey": "3f2b8c1e9a4d4e7f8b6c5d4e3f2a1b0c",
      "officeKeys": [
        "2c4e6a8b1d3f4b5a8c7e9f0a1b2c3d4e"
      ]
    }
  }
}

Response

{
  "data": {
    "addWebhookSubscriptionTarget": {
      "id": "318",
      "endpoint": "https://integrations.example.com/first-aml/webhooks",
      "eventTypes": [
        "CASE_STATUS_UPDATED"
      ]
    }
  }
}