Documentation/Webhooks

Webhooks

Webhooks

Receive real-time notifications for events like completion completion, quota alerts, and more.

⚠️ Plan Required: Webhooks require Pro plan or higher.

Available Events

EventDescription
completion.createdNew completion started
completion.completedCompletion finished successfully
completion.failedCompletion failed
embedding.createdEmbedding created
agent.run.completedAgent execution finished
file.uploadedFile uploaded
file.processedFile processing complete
usage.threshold_reachedQuota threshold reached
account.quota_exceededQuota exceeded
GET /api/v1/webhooks

List Webhooks

Returns a list of webhooks for the organization.

POST /api/v1/webhooks

Create Webhook

Create a new webhook endpoint.

Parameters

NameTypeReqDescriptionDefault
urlstringYesWebhook endpoint URL (HTTPS)—
eventsarrayYesEvent types to subscribe to—
secretstringNoSigning secret for verification—
POST /api/v1/webhooks/{webhook_id}/test

Test Webhook

Send a test event to a webhook.

GET /api/v1/webhooks/{id}

Retrieve Webhook

Retrieve details for a specific webhook by its ID.

PUT /api/v1/webhooks/{id}

Update Webhook

Update the configuration of an existing webhook.

Parameters

NameTypeReqDescriptionDefault
urlstringYesWebhook endpoint URL (HTTPS)—
eventsarrayYesEvent types to subscribe to—
secretstringNoSigning secret for verification—
DELETE /api/v1/webhooks/{id}

Delete Webhook

Permanently delete a webhook by its ID.

Response Examples

Create Webhook (201)
{
  "id": "wh_abc123def456",
  "url": "https://your-app.com/webhook",
  "events": ["chat.completion.created", "chat.completion.completed"],
  "secret": "whsec_abc123",
  "status": "active",
  "created_at": 1791815801
}

Code Examples

List Webhooks
curl https://api.meedoo.co/api/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY"
Test Webhook
curl -X POST https://api.meedoo.co/api/v1/webhooks/wh_abc123/test \
  -H "Authorization: Bearer YOUR_API_KEY"
Retrieve Webhook Python
import requests

resp = requests.get(
    "https://api.meedoo.co/api/v1/webhooks/wh_abc123",
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)
print(resp.json())
Update Webhook Python
import requests

resp = requests.put(
    "https://api.meedoo.co/api/v1/webhooks/wh_abc123",
    headers={"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"},
    json={"events": ["chat.completion.created", "chat.completion.completed", "file.uploaded"]}
)
print(resp.json())
Delete Webhook Python
import requests

resp = requests.delete(
    "https://api.meedoo.co/api/v1/webhooks/wh_abc123",
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)
print(f"Status: {resp.status_code}")
Create Webhook
curl -X POST https://api.meedoo.co/api/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/webhook",
    "events": ["chat.completion.completed", "quota.alert"],
    "secret": "my_signing_secret"
  }'