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=["string"],
    url="url",
)
print(webhook)
{
  "object": "webhook",
  "id": "<string>",
  "url": "<string>",
  "events": [
    "<string>"
  ],
  "enabled": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "secret": "<string>"
}

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
string[]
required

List of event types to subscribe to.

Minimum array length: 1

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
string[]
required

The subscribed event types.

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.