Managing webhooks and subscriptions

Managing webhooks and subscriptions

Creating & changing webhooks

In order to change webhook URLs, you must delete your existing webhook and then create a new one. Note that when you do this, you will be required to re-add user subscriptions to the new webhook.

Webhook configuration management endpoints:

Method Endpoint
Registers a webhook URL / Generates a webhook_id POST :env_name/webhooks
Returns all webhook URLs and their statuses
GET webhooks
Delete app’s current webhook configuration
DELETE :env_name/webhooks/:webhook_id
Manually trigger a CRC request
PUT :env_name/webhooks/:webhook_id


Why can’t I just update the webhook URL?

Why are webhook configurations immutable? Twitter takes security very seriously. If your webhook URL is changed, there is a possibility that your application consumer key and consumer secret have been compromised. By requiring you to create a new webhook configuration, you are also required to re-subscribe to your user’s events. This requires the use of access tokens that a malicious party is less likely to possess. As a result, the likelihood that another party will receive your user’s private information is reduced.

Adding & removing User subscriptions

For the premium tier of the Account Activity API, the free "sandbox" offering includes 15 subscriptions. Paid premium access provides for up to 250 subscriptions per webhook and up to one webhook per Twitter application. If you have a need for access beyond these levels, please let us know by providing more information using this form.


Subscription management endpoints

Method Endpoint
Add new user subscription
POST :env_name/subscriptions 
Retrieve a user subscription
GET :env_name/subscriptions
Returns a list of all active subscriptions
GET :env_name/subscriptions/list
Deactivates a user subscription using application only OAuth
DELETE :env_name/subscriptions/:user_id.json
Deactivates a user subscription using 3-legged OAuth (DEPRECATED)
DELETE :env_name/subscriptions


Next steps