Skip to main content
POST
/
webhooks
Python
import os
from datagrid_ai import Datagrid

client = Datagrid(
    api_key=os.environ.get("DATAGRID_API_KEY"),  # This is the default and can be omitted
)
webhook = client.webhooks.create(
    events=["batch_prediction.completed", "batch_prediction.failed"],
    url="https://example.com/webhooks/datagrid",
)
print(webhook)
{
  "object": "webhook",
  "id": "<string>",
  "url": "<string>",
  "events": [
    "knowledge.processing.completed"
  ],
  "enabled": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "secret": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://developers.datagrid.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
url
string
required

HTTPS destination URL for webhook deliveries.

events
enum<string>[]
required

List of event types to subscribe to. Currently delivered events include knowledge.processing.completed, batch_prediction.completed, batch_prediction.failed, batch_prediction.expired, and batch_prediction.cancelled.

Minimum array length: 1
Available options:
knowledge.processing.completed,
batch_prediction.completed,
batch_prediction.failed,
batch_prediction.expired,
batch_prediction.cancelled

Response

Successfully created webhook

The webhook object represents an outbound webhook subscription.

object
enum<string>
required

The object type, which is always webhook.

Available options:
webhook
id
string
required

The webhook identifier.

url
string
required

The destination URL for webhook deliveries.

events
enum<string>[]
required

The subscribed event types. Currently delivered events include knowledge.processing.completed, batch_prediction.completed, batch_prediction.failed, batch_prediction.expired, and batch_prediction.cancelled.

Available options:
knowledge.processing.completed,
batch_prediction.completed,
batch_prediction.failed,
batch_prediction.expired,
batch_prediction.cancelled
enabled
boolean
required

Whether delivery is enabled for this webhook.

created_at
string<date-time>
required

The ISO string for when the webhook was created.

updated_at
string<date-time>
required

The ISO string for when the webhook was last updated.

secret
string
required

The signing secret shown only when creating a webhook.