Create webhook
import requests
url = "https://api.datagrid.com/v1/webhooks"
payload = {
"url": "https://example.com/webhooks/datagrid",
"events": ["batch_prediction.completed", "batch_prediction.failed"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/webhooks/datagrid',
events: ['batch_prediction.completed', 'batch_prediction.failed']
})
};
fetch('https://api.datagrid.com/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.datagrid.com/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/webhooks/datagrid",
"events": [
"batch_prediction.completed",
"batch_prediction.failed"
]
}
'{
"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>"
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}Webhooks
Create webhook
Create an HTTPS webhook subscription for your teamspace. Datagrid returns the signing secret only in this response; store it securely and use it to verify future Datagrid-Signature headers.
POST
/
webhooks
Create webhook
import requests
url = "https://api.datagrid.com/v1/webhooks"
payload = {
"url": "https://example.com/webhooks/datagrid",
"events": ["batch_prediction.completed", "batch_prediction.failed"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/webhooks/datagrid',
events: ['batch_prediction.completed', 'batch_prediction.failed']
})
};
fetch('https://api.datagrid.com/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.datagrid.com/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/webhooks/datagrid",
"events": [
"batch_prediction.completed",
"batch_prediction.failed"
]
}
'{
"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>"
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}Authorizations
Body
application/json
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:
1Available 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.
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