Webhook Subscriptions

Subscribe to events and then wait for Trackdrive to deliver the payload when things happen. The gist is: you POST a subscription to /api/v1/subscription/ requesting to receive hooks at some target URL. Every time the event happens, Trackdrive pings you at the target URL with the payload.

GET /subscriptions

Authorization Required
https://[your-subdomain].trackdrive.com/api/v1/subscriptions

List Subscriptions

List all webhook event subscriptions on your account. Supports pagination with the page parameter.

Params

Param name Description
page
Optional

Return the next page of results.

  • Must be a number.

GET /subscriptions/new

Authorization Required
https://[your-subdomain].trackdrive.com/api/v1/subscriptions/new

Build Webhook Subscription with defaults.

Return a new, unsaved subscription pre-filled with your company defaults, useful for previewing the record shape before creating one.

POST /subscriptions

Authorization Required
https://[your-subdomain].trackdrive.com/api/v1/subscriptions

Create a subscription

Subscribe a target_url to a Trackdrive event such as new_call. Trackdrive POSTs the event payload to that URL every time the event fires. If a subscription already exists for the same target_url and event it is updated instead of duplicated. Optional trigger_fields limit delivery to records matching specific field values.

Params

Param name Description
target_url
Required

The unique auto-generated subscription URL where Trackdrive will send JSON data when the event is triggered.

  • Must be a valid URL.

event
Required

The event that will be triggered. EG: When a new call comes in.

  • Must be one of: new_call, call_ringing, call_forwarded, call_ended, call_changed, new_lead, lead_ended, lead_converted, lead_opted_out, lead_changed, incoming_text_message.

trigger_fields
Optional

Filter the data returned by the subscription. Only trigger if the object matches the given trigger fields. For example:
{buyer_converted: true, offer_id: 1} would only fire the trigger if the call converted and came from offer 1. Acceptable triggers: schedule_id traffic_source_id offer_id buyer_converted has_recording either_converted buyer_id offer_converted number_id

  • Must be a Hash

GET /subscriptions/:id

Authorization Required
https://[your-subdomain].trackdrive.com/api/v1/subscriptions/:id

Get a subscription

Retrieve a single webhook subscription by id.

PUT /subscriptions/:id

Authorization Required
https://[your-subdomain].trackdrive.com/api/v1/subscriptions/:id

Update a subscription

Change the target_url, event, or trigger_fields on an existing subscription.

Params

Param name Description
target_url
Optional

The unique auto-generated subscription URL where Trackdrive will send JSON data when the event is triggered.

  • Must be a valid URL.

event
Optional

The event that will be triggered. EG: When a new call comes in.

  • Must be one of: new_call, call_ringing, call_forwarded, call_ended, call_changed, new_lead, lead_ended, lead_converted, lead_opted_out, lead_changed, incoming_text_message.

DELETE /subscriptions/:id

Authorization Required
https://[your-subdomain].trackdrive.com/api/v1/subscriptions/:id

Delete a subscription

Permanently remove a subscription. It will stop receiving event payloads.

DELETE /subscriptions

Authorization Required
https://[your-subdomain].trackdrive.com/api/v1/subscriptions

Delete a subscription matching a target_url

Remove the subscription matching the given target_url instead of an id, useful when you only know the URL you registered and not its id.

Params

Param name Description
target_url
Optional

The unique auto-generated subscription URL where Trackdrive will send JSON data when the event is triggered.

  • Must be a String