Header name | Description |
---|---|
Content-Type required |
application/json |
X-API-KEY required |
YOUR_API_KEY |
Param name | Description |
---|---|
name optional |
Webhook name Validations:
|
http_url optional |
Webhook URL Validations:
|
http_method optional |
Webhook Method Validations:
|
trigger_events optional |
Webhook trigger events Validations:
|
disabled optional |
Determines whether webhook is active or not Validations:
|
project_id optional |
Id of the webhook project Validations:
|
// Successful request POST /api/v2/admin/webhooks/7 { "name": "Sample Webhook", "http_url": "https://example.website.com", "http_method": "POST", "trigger_events": [ "ASSET_ADDED" ], "project_id": "dh2NNcH3slJtkJqnfCD2" } 200 { "webhook": { "id": 7, "name": "Sample Webhook", "http_url": "https://example.website.com", "http_method": "POST", "trigger_events": [ "ASSET_ADDED" ], "created_at": "2023-11-27T09:42:40.460Z", "updated_at": "2023-11-27T09:42:40.608Z", "disabled": false, "project_id": "dh2NNcH3slJtkJqnfCD2", "queue_length": 0, "retry_queue_length": 0, "latest_run": null, "webhook_users": [], "webhook_headers": [] } }
// Successful request POST /api/v2/admin/webhooks/8 { "name": "Sample Webhook", "http_url": "https://example.website.com", "http_method": "POST", "trigger_events": [ "ASSET_ADDED" ] } 200 { "webhook": { "name": "Sample Webhook", "http_url": "https://example.website.com", "http_method": "POST", "trigger_events": [ "ASSET_ADDED" ], "project_id": null, "id": 8, "created_at": "2023-11-27T09:42:40.684Z", "updated_at": "2023-11-27T09:42:40.780Z", "disabled": false, "queue_length": 0, "retry_queue_length": 0, "latest_run": null, "webhook_users": [], "webhook_headers": [] } }
// Not admin user POST /api/v2/admin/webhooks/:webhook_id 401
// Webhook not found POST /api/v2/admin/webhooks/-1 { "name": "Sample Webhook", "http_url": "https://example.website.com", "http_method": "POST", "trigger_events": [ "ASSET_ADDED" ] } 404 { "error": "Couldn't find Webhook with 'id'=-1" }
// Project not found POST /api/v2/admin/webhooks/9 { "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 |