Skip to content

Webhooks API

Audience: All Immuta users

Content Summary: Webhooks notify users or other systems when actions happen in Immuta. Every action that generates a notification is available as a webhook.

Application Admins can create webhooks that are triggered by events that happens in the system (such as when data sources or projects are created), but any user can create webhooks that are triggered by access requests and activity notifications.

This page lists the REST endpoints for managing webhooks and provides examples of requests.

Webhook Workflow

  1. Create a webhook
  2. Retrieve webhook information
  3. Retry webhook.
  4. Delete a webhook

Create a Webhook

Endpoint

Method Path Purpose
POST /webhooks Create a new webhook. Users can create multiple webhooks in a single request.

Query Parameters

Attribute Description Required
Body value A set value that creates a new webhook. Yes

Webhook Notifications

Type Triggers
AcknowledgedAccess A project member acknowledges the purposes on a project.
AddedToProject A data source is added to a project.
ApiKeyRevoked A user's API key is revoked.
AttributeAdded An attribute is added to a group or user.
AttributeRemoved An attribute is removed from a group or user.
AttributeUpdated Attributes for a group or user are updated.
BulkJobStatus A bulk action is completed (whether success/failure).
CertificationRequired A Global Policy that requires certification by the data source owner is applied to a data source.
ConflictingGlobalPolicies Global Policies are applied to the same column on a data source.
DataSourceExpired A data source that was configured to expire has expired.
DataSourceExpiring A data source that was configured to expire expires tomorrow.
DataSourceUpdated A data source is updated.
DeletedDatasourceRemovedFromProject A data source has been deleted and then removed from a project.
ExpiredDatasourceRemovedFromProject A data source that has expired and been deleted is removed from a project.
FirstQuery A data source is queried for the first time through Immuta.
GlobalPolicyCreated A Global Policy is created.
GlobalPolicyDeleted A Global Policy is deleted.
GlobalPolicyDisabled A Global Policy is disabled.
GlobalPolicyUpdated A Global Policy is updated.
GroupUserAdded A user is added to a group.
GroupUserDeleted A user is removed from a group.
HealthCheckFailed A health check runs and returns not healthy.
HealthCheckResolved A health check runs and returns healthy.
ModelAccessApproved A user's access request is approved for a data source or project.
ModelAccessDenied A user's access request is denied for a data source or project.
ModelAccessRequested A user requests access to a data source or project.
ModelAccessRevoked A user's access request is revoked for a data source or project.
ModelAccessUpdated A user's access level is updated for a data source or project.
ModelCommentCreated A comment is left on a data source, data source column, data source query, or project.
ModelCommentReply A reply is left on a data source, data source column, data source query, or project comment.
ModelCommentResolved A comment or reply is resolved on a data source, data source column, data source query, or project.
ModelCreated A data source or project is created.
ModelDeleted A data source or project is deleted.
ModelTagAdded A tag is added to a data source or a data source column.
ModelTagRemoved A tag is removed from a data source or a data source column.
ModelUserAdded A user is added to a data source.
ModelUserDeleted A user is removed from a data source.
ModelUserJoined A user joins a data source that they are already allowed to join.
NativeWorkspaceStateChanged A native workspace configuration within a project changes.
PermissionsUpdated A user's permissions are updated.
PolicyAdjustmentCreated A policy adjustment is created.
PolicyAdjustmentExpired A policy adjustment has expired (the default is after a year).
PolicyCertificationExpired A policy certification on a data source has expired.
PolicyUpdated A data source's policies have been updated by a user or Global Policy. Policy updates are triggered for many reasons, including when a data source is created, a user updates them, a Global Policy changed, tags are added to a data source or column, the data dictionary changed, a fingerprint is recomputed, an external catalog modifies tags on a linked data source, or a policy disabled.
ProjectDisabled A project is disabled.
ProjectEqualizationMemberNotInCompliance A member of an equalized project is out of compliance.
ProjectEqualizationToggled Project equalization is toggled on or off.
ProjectUpdated A project is updated.
PurposeCreated A purpose is created.
PurposeDeleted A purpose is deleted.
PurposeUpdated A purpose is updated.
QueryCanceled A running query is canceled due to a change on a data source.
QueryCreated A user creates a public query on a data source.
QueryUpdated A public query is updated.
RemovedFromProject A data source is removed from a project.
SwitchedCurrentProject A user switches their current project.
TagCreated A tag is created.
TagDeleted A tag is deleted.
TagUpdated A tag is updated.
TaskDeleted An outstanding data source task is deleted without validation.
TaskValidated An outstanding data source task is validated.
UserCloned A user is cloned.
UserCreated A user or group is created.
UserDeleted A user or group is deleted.
UserDisabled A user is disabled.
UserEnabled A user is enabled.
UserMigrated A user is migrated from an old IAM to a new IAM.
UsernameUpdated A user's name is updated.
UserUpdated A group is updated.

Payload Parameters

Attribute Description Required
Webhooks array[object] The details for each webhook you would like to create including the values for url, name, global, notificationType, actionType, secret, and internalPlugin. Yes
URL string URL for outbound webhook request. Yes
Name string The webhook's name. Yes
Global boolean If true, you will receive all notifications even if they do not pertain to you. Yes
NotificationType array A list of the webhook notifications you would like to receive. Yes
ActionType string The options are triggered or receive. Yes
Secret string Shared secret for computing the webhook signature. No
InternalPlugin boolean If true, this routes the request internally to a custom plugin that was uploaded. No

Response Parameters

Attribute Description
CreatedWebhooks array[object] Details on each webhook that was created including values for id, url, name, global, actionType, internalPlugin, and the date it was created.

Request Example

The following request with the payload below creates a new webhook.

curl \
    --request POST \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    --data @example-payload.json \
    https://demo.immuta.com/webhooks

Payload Example

{
  "webhooks": [
    {
      "url": "https://demo.service.com/processWebhook",
      "name": "ViewMonitorHook",
      "global": false,
      "notificationType": [
        "ALL_NOTIFICATIONS"
      ],
      "actionType": "triggered"
    }
  ]
}

Response Example

{
  "createdWebhooks": [
    {
      "id": 3,
      "url": "https://demo.service.com/processWebhook",
      "name": "ViewMonitorHook",
      "global": false,
      "actionType": "triggered",
      "internalPlugin": false,
      "createdBy": 2,
      "createdAt": "2021-10-15T15:22:10.079Z",
      "updatedAt": "2021-10-15T15:22:10.079Z"
    }
  ],
  "errors": []
}

Retrieve Webhook Information

Endpoint Purpose
/webhooks Return a list of webhooks the user can see. (Admins can see all webhooks; users can only see their own webhooks.)
/webhooks/actions Return a list of valid notification actions that a webhook can be triggered by.
/webhooks/history Return historical records for webhook requests, including requests and responses.
/webhooks/{id} Return specified webhook by ID.

Search for Webhooks

Endpoint

Method Path Purpose
GET /webhooks Return a list of webhooks the user can see. (Admins can see all webhooks; users can only see their own webhooks.)

Query Parameters

None.

Response Parameters

Attribute Description
Value metadata Details regarding the returned list of webhooks including, id, name, url, notificationType, global, and createdBy.

Request Example

The following request returns a list of webhooks the user can see.

curl \
    --request GET \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    https://demo.immuta.com/webhooks

Response Example

{
  "id": 1,
  "name": "internal-automatic-subscription-webhook",
  "url": "/internal-webhook/automatic-subscription",
  "notificationType": [
    "groupUserAdded",
    "groupUserDeleted",
    "attributeAdded",
    "attributeRemoved",
    "attributeUpdated",
    "userDeleted",
    "userMigrated",
    "userCreated",
    "policyUpdated",
    "dataSourceUpdated",
    "modelCreated"
  ],
  "global": true,
  "createdBy": 1
}

Search for Notification Actions

Endpoint

Method Path Purpose
GET /webhooks/actions Return a list of valid notification actions that a webhook can be triggered by.

Query Parameters

None.

Response Parameters

Attribute Description
Value metadata Details regarding the list of actions that a webhook can be created for.

Request Example

The following request returns a list of valid notification actions that a webhook can be triggered by.

curl \
    --request GET \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    https://demo.immuta.com/webhooks/actions

Response Example

[
  "ALL_NOTIFICATIONS",
  "modelCreated",
  "modelDeleted",
  "modelCopied",
  "dataSourceUpdated",
  "dataSourceExpired",
  "dataSourceExpiring",
  "healthCheckFailed",
  "healthCheckResolved",
  "modelUserAdded",
  "modelUserDeleted",
  "modelUserJoined",
  "modelAccessRequested",
  "modelAccessApproved",
  "modelAccessRevoked",
  "modelAccessUpdated",
  "modelAccessDenied",
  "modelTagAdded",
  "modelTagRemoved",
  "projectUpdated",
  "projectEqualizationToggled",
  "projectEqualizationMemberNotInCompliance",
  "projectDisabled",
  "addedToProject",
  "removedFromProject",
  "deletedDatasourceRemovedFromProject",
  "expiredDatasourceRemovedFromProject",
  "updatedModelInProject",
  "nativeWorkspaceStateChanged",
  "policyUpdated",
  "modelCommentCreated",
  "modelCommentReply",
  "modelCommentResolved",
  "queryCreated",
  "queryCanceled",
  "queryUpdated",
  "firstQuery",
  "userCreated",
  "userDeleted",
  "userEnabled",
  "userCloned",
  "userDisabled",
  "userMigrated",
  "groupUserAdded",
  "groupUserDeleted",
  "userUpdated",
  "attributeUpdated",
  "attributeAdded",
  "attributeRemoved",
  "permissionsUpdated",
  "switchedCurrentProject",
  "usernameUpdated",
  "acknowledgedAccess",
  "purposeCreated",
  "purposeUpdated",
  "purposeDeleted",
  "tagCreated",
  "tagUpdated",
  "tagDeleted",
  "governanceSettingsUpdated",
  "apiKeyRevoked",
  "conflictingGlobalPolicies",
  "globalPolicyCreated",
  "globalPolicyUpdated",
  "globalPolicyDeleted",
  "globalPolicyDisabled",
  "bulkJobStatus",
  "taskValidated",
  "taskDeleted",
  "certificationRequired",
  "policyCertificationExpired",
  "policyAdjustmentExpired",
  "policyAdjustmentCreated"
]

View Webhook Notifications

Search for Webhook Records

Endpoint

Method Path Purpose
GET /webhooks/history Return historical records for webhook requests, including requests and responses.

Query Parameters

Attribute Description Required
Offset integer The number of records to skip for this query. No
PageSize integer The number of records to return in this query. The default is 20. No
SortField string The field to use for sorting. The default is createdAt. No
SortOrder string The sort order to use. The default is desc. No
NotificationType string If set will only return activities of this type. No
IncludeGlobal boolean If true, global records will be included. No
IncludeUser boolean If true, personal webhooks will be returned for the given user. The default is true. No
SuccessOrFailure string If set will only retrieve records that were successful or failed. No

Response Parameters

Attribute Description
Count integer The number of results for the request.
Records metadata Details on each webhook result.

Request Example

The following request returns historical records for webhook requests, including requests and responses.

curl \
    --request GET \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    https://demo.immuta.com/webhooks/history?pageSize=20&includeUser=true

Response Example

{
  "count": "0",
  "records": []
}

Search for Webhook by ID

Endpoint

Method Path Purpose
GET /webhooks/{id} Return specified webhook by ID.

Query Parameters

Attribute Description Required
Id string The webhook ID. Yes

Response Parameters

Attribute Description
Value metadata Details regarding the returned list of webhooks including, id, name, url, notificationType, global, and createdBy.

Request Example

The following request returns details on the webhook with the ID 1.

curl \
    --request GET \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    https://demo.immuta.com/webhooks/1

Response Example

{
  "id": 1,
  "name": "internal-automatic-subscription-webhook",
  "url": "/internal-webhook/automatic-subscription",
  "notificationType": [
    "groupUserAdded",
    "groupUserDeleted",
    "attributeAdded",
    "attributeRemoved",
    "attributeUpdated",
    "userDeleted",
    "userMigrated",
    "userCreated",
    "policyUpdated",
    "dataSourceUpdated",
    "modelCreated"
  ],
  "global": true,
  "createdBy": 1
}

Retry Webhook by ID

Endpoint

Method Path Purpose
POST /webhooks/history/retry/{id} Retry webhook requests by history ID. This can be done against any history record, regardless of failure or success.

Query Parameters

Attribute Description Required
Id integer ID of the history record to retry. Yes

Response Parameters

Attribute Description
ID integer The ID of the history record.
Request array Details on the request, including values for test, metadata, webhookId, and webhookName.
Response array Details on the response.
StatusCode integer The status code for the webhook. A value of 200 is successful.
NotificationType string The type of notification.
WebhooksActivityId integer The ID for the activity.
CreatedAt timestamp The date the webhook was created.
UpdatedAt timestamp The date the webhook was last updated.

Request Example

The following request retries the webhook with the ID 1.

curl \
    --request POST \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    https://demo.immuta.com/webhooks/history/retry/1

Response Example

{
  "id": 228,
  "request": {
    "text": "Katie has created the Public (https://demo.example.com/#/project/1) project. Please click here (https://demo.example.com/#/project/1) for additional information.",
    "metadata": {
      "modelId": 1,
      "actionBy": 2,
      "modelType": "project",
      "targetUser": 2,
      "projectName": "Public",
      "targetGroup": null,
      "actionByName": "Katie",
      "targetUserName": "Katie",
      "notifyInitiator": true,
      "notificationType": "modelCreated"
    },
    "webhookId": 1,
    "webhookName": "internal-automatic-subscription-webhook"
  },
  "response": {},
  "statusCode": 200,
  "notificationType": "modelCreated",
  "webhooksActivityId": 11,
  "createdAt": "2021-10-15T16:44:06.872Z",
  "updatedAt": "2021-10-15T16:44:06.872Z"
}

Delete a Webhook

Endpoint

Method Path Purpose
DELETE /webhooks/{id} Delete a webhook by ID.

Query Parameters

Attribute Description Required
Id integer The webhook ID. Yes

Response Parameters

Attribute Description
Value metadata Details regarding the webhook, id, url, name, global, actionType, internalPlugin, createdBy, createdAt, updatedAt.

Request Example

The following request deletes the webhook with the ID 1.

curl \
    --request DELETE \
    --header "Authorization: Bearer dea464c07bd07300095caa8" \
    https://demo.immuta.com/webhooks/1

Response Example

{
  "id": 1,
  "url": "/internal-webhook/automatic-subscription",
  "name": "internal-automatic-subscription-webhook",
  "global": true,
  "actionType": null,
  "internalPlugin": true,
  "createdBy": 1,
  "createdAt": "2021-06-24T15:08:58.906Z",
  "updatedAt": "2021-06-24T15:08:58.906Z"
}