POST /webhooks
Creates an account-level webhook subscription.
Request
POST https://api.tropo.com/v1/webhooks/
Headers
This request must be authenticated with HTTP Basic authentication using your Tropo account credentials and contain a content-type of application/json
Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l Content-Type: application/json
Body
{ "event": "cdrCreated", "name": "CDR handler", "targetUrl": "http://example.com/dlr", "resource": "call", "payload": { "apiKey" : "6Tg4CD3GBvmjh897hfgbdgh"}, "enabled": true }
Fields
- event
- (String) Which event this subscription is for. Possible values are
smsdlr
,cdrCreated
, orcdrRated
. See the webhook documentation for details on each event type. This field is required. - resource
- (String) The type of resource this CDR is for. Possible values are "call", "sms", "transcription", and "all". Multiple resources can be subscribed to by separating them by commas. This field is required.
- targetUrl
- (String) The URL of your web application where the event notification will be sent. This field is required.
- payload
- (Object) A freeform JSON object containing arbitrary user-defined data that you wish to include with your event notifications.
- enabled
- (Boolean) Is this subscription active? If set to False, Tropo will not send the event notifications. Default is True.
Response
Returns the URL to the newly created webhook subscription
{ "href": "https://api.tropo.com/v1/webhooks/12" }