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 | Enterprise |
Registers a webhook URL / Generates a webhook_id | POST webhooks |
Returns all webhook URLs and their statuses |
GET webhooks |
Delete app’s current webhook configuration |
DELETE webhooks/:webhook_id |
Manually trigger a CRC request |
PUT webhooks/:webhook_id |
Why can’t I just update the webhook URL?
Why are webhook configurations immutable? X 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
Support for thousands of subscriptions is available with the enterprise tier. If you already have an account manager, please reach out to them with questions. To apply for access to the enterprise APIs, click here.
Subscription management endpoints
Method | Enterprise |
Add new user subscription |
POST webhooks/:webhook_id/subscriptions/all |
Retrieve a user subscription |
GET webhooks/:webhook_id/subscriptions/all |
Returns a list of all active subscriptions |
GET webhooks/:webhook_id/subscriptions/all/list |
Deactivates a user subscription using application only OAuth |
DELETE webhooks/:webhook_id/subscriptions/:user_id/all.json |
Next steps
- Learn more about these topics:
- See Account Activity API references.
- See example code:
- Account Activity API dashboard, a node web app that displays webhook events.
- The SnowBot chatbot, a Ruby web app built with the Account Activity and Direct Message APIs. This code base includes a script to help set up Account Activity API webhooks.