Skip to content

Configure webhooks

Webhooks let you integrate the Comet model registry with your CI/CD pipeline.

Specifically, you can set your webhook to listen for any change that is made to the status of a model registered with Comet.

When one of those events is triggered, Comet sends an HTTP POST payload to the webhook's configured URL. The POSTs are in the form of JSON documents that contain data relating to the event that your webhook has identified.

The webhook is implemented by the web server as a URL that can accept the POST requests and pass on the data that they deliver for further processing.

You can set a webhook for several registered models, across several workspaces. Events can be delivered to several URLs.

All you need to do is specify the URL to which Comet should deliver the events.

Configure the webhook

You can set up new webhooks and retrieve the current settings for existing webhooks through the UI or by using our REST APIs.

To set up webhooks using the UI, navigate to the model registry and select the webhooks tab. From there, you can view, create, edit, and delete webhooks specific to that model.

webhooks

POST configuration

You can also configure them using our REST api. To configure webhooks, issue an HTTP POST request to your full Comet domain URL, using the following syntax:

POST {http/https}://{your-comet-domain}/api/rest/v2/webhooks/config

The payload structure follows this format:

{
  "webhookConfigs": [
    {
      "workspaceName": "your_workspace",
      "modelName": "your_model",
      "webhookUrls": [
        {
          "triggers": [
            "MODEL_VERSION_CREATED"
          ],
          "name": "webhook_name",
          "url": "https://{customer-webhook-url-a}",
          "header": {
            "Authorization": "secret_token",
            "Other": "other_info"
          }
        }
      ]
    }
  ]
}

Just like in the UI, you can configure different triggers for the webhook by defining them under triggers: [].

The following triggers are currently supported:

  • MODEL_VERSION_CREATED
  • MODEL_VERSION_DELETED
  • MODEL_TAG_CHANGED
  • MODEL_STATUS_CHANGED
  • MODEL_STAGE_CHANGED

GET configuration

To retrieve the current configuration, issue an HTTP GET request to your full Comet domain URL, using the following syntax:

GET {http/https}://{your-comet-domain}/api/rest/v2/webhooks/config?workspaceName=<workspace>&modelName=<model>

Webhook events and payloads

Each webhook event payload contains properties unique to the event.

For example the payload for when a model status changes:

{
  "workspaceName": "someteamname",
  "registryModelName": "some-registry-model-name",
  "modelVersion": "2.3.42",
  "eventTrigger": "MODEL_STATUS_CHANGED",
  "status": "PROD"
}

or when a tag has changed:

{
  "workspaceName": "someteamname",
  "registryModelName": "some-registry-model-name",
  "modelVersion": "2.3.42",
  "eventTrigger": "MODEL_TAGS_CHANGED",
  "tags": [
    "tags",
    "someTag"
  ],
  "deletedTags": [
    "someDeletedTag"
  ]
}

Learn more

For a full list of endpoints provided with Comet, see:

Feb. 9, 2024