Header name | Description |
---|---|
Content-Type required |
application/json |
X-API-KEY required |
YOUR_API_KEY |
Param name | Description |
---|---|
name required |
Webhook name Validations:
|
http_url required |
Webhook URL Validations:
|
http_method required |
Webhook Method Validations:
|
trigger_events required |
Webhook trigger events Validations:
|
project_id optional |
Id of the webhook project Validations:
|
// Successful request POST /api/v2/admin/webhooks { "name": "Sample Webhook", "http_url": "https://example.website.com", "http_method": "POST", "trigger_events": [ "ASSET_ADDED" ], "project_id": "GsrwPNm6nJ7CKRYnQZl6" } 200 { "webhook": { "id": 5, "name": "Sample Webhook", "http_url": "https://example.website.com", "http_method": "POST", "trigger_events": [ "ASSET_ADDED" ], "created_at": "2023-11-27T09:42:39.937Z", "updated_at": "2023-11-27T09:42:39.937Z", "disabled": false, "project_id": "GsrwPNm6nJ7CKRYnQZl6", "queue_length": 0, "retry_queue_length": 0, "latest_run": null, "webhook_users": [], "webhook_headers": [] } }
// Successful request POST /api/v2/admin/webhooks { "name": "Sample Webhook", "http_url": "https://example.website.com", "http_method": "POST", "trigger_events": [ "ASSET_ADDED" ] } 200 { "webhook": { "id": 6, "name": "Sample Webhook", "http_url": "https://example.website.com", "http_method": "POST", "trigger_events": [ "ASSET_ADDED" ], "created_at": "2023-11-27T09:42:40.100Z", "updated_at": "2023-11-27T09:42:40.100Z", "disabled": false, "project_id": null, "queue_length": 0, "retry_queue_length": 0, "latest_run": null, "webhook_users": [], "webhook_headers": [] } }
// Not admin user POST /api/v2/admin/webhooks 401
// Missing parameters POST /api/v2/admin/webhooks { "name": "Sample Webhook", "http_url": null, "http_method": "POST", "trigger_events": [ "ASSET_ADDED" ] } 422 { "error": "Invalid parameter 'http_url' value nil: Must be a String" }
// Project not found POST /api/v2/admin/webhooks { "name": "Sample Webhook", "http_url": "https://example.website.com", "http_method": "POST", "trigger_events": [ "ASSET_ADDED" ], "project_id": "test_id" } 404 { "error": "project not found" }
Code | Description |
---|---|
401 | Unauthorized |
404 | Not found |
500 | Internal Server Error |
422 | Missing parameters |