Subscribe to webhook events

Receive events when cases change.

Use createWebhookSubscription to receive events for an organization. Add officeKeys to a target to only receive events for those offices. Keep the verificationKey to check that events you receive came from First AML.

Required scope: api-management

Request

mutation createWebhookSubscription($input: CreateWebhookInput!) {
  createWebhookSubscription(input: $input) {
    ... on WebhookSubscription {
      id
      endpoint
      eventTypes
      failureEmail
      verificationKey
    }
    ... on ValidationErrors {
      errors {
        message
      }
    }
  }
}

Variables

{
  "input": {
    "endpoint": "https://integrations.example.com/first-aml/webhooks",
    "eventTypes": [
      "CASE_STATUS_UPDATED"
    ],
    "failureEmail": "integrations@example.com",
    "targets": [
      {
        "organizationKey": "3f2b8c1e9a4d4e7f8b6c5d4e3f2a1b0c",
        "officeKeys": [
          "8e7d6c5b4a3f4e2d9c1b0a9f8e7d6c5b"
        ]
      }
    ]
  }
}

Response

{
  "data": {
    "createWebhookSubscription": {
      "id": "318",
      "endpoint": "https://integrations.example.com/first-aml/webhooks",
      "eventTypes": [
        "CASE_STATUS_UPDATED"
      ],
      "failureEmail": "integrations@example.com",
      "verificationKey": "q3Jx9vT2mZ8wLk4sYp7aHn1cRf6uEd0bGi5oVt3Ws2A="
    }
  }
}