Update a Subscription

Example Update Request

$ curl -XPOST \
https://api.intercom.io/subscriptions/nsub_6ab4c480-fd8b-11e3-958f-c779cae3e1b3 \
-H 'Authorization:Bearer <Your access token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' -d'
{
  "topics": ["conversation", "company", "users"],
  "url": "https://example.org/hooks/1"
}'
HTTP/1.1 200 Ok

{
  "type": "notification_subscription",
  "id": "nsub_6ab4c480-fd8b-11e3-958f-c779cae3e1b3",
  "created_at": 1392731331,
  "updated_at": 1392732945,
  "service_type": "web",
  "topics": ["conversation", "company", "user"],
  "url": "https://example.org/hooks/1"
  "active": true,
  "hub_secret": null
}
Subscription sub = Subscription.find("nsub_60ca7690");
sub.setUrl(new URI("https://example.org/webhooks/2"));
Subscription.update(sub);

You can update a subscription's topics, active status and url, by submitting a POST to the subscription's URL, along with the JSON for the subscription. The topics, url, active and hub_secret fields can be updated.

The topics array sent during an update will replace the existing list of topics and is not merged. For example if the subscription is susbcribed to the topics ["company", "users"] and is updated with the list ["conversation", "company"], the final result will be ["conversation", "company"] and the users topic will be unsubscribed from.

Setting the active status to false means the subscription will stop receiving events. Note that events triggered when a subscription is inactive may not be sent when the subscription is later re-activated.