Skip to content

Update an existing webhook subscription

Request

After creation, subscriptions can be updated to change what events are subscribed to, what url to send the payloads to, and other settings such as whether the subscription is active. Any values that can be set on the subscription when creating it can be updated.


The update method is a patch operation, so only properties you send in the request will be updated on the record. The events property, however, does not support partial updates as an array.


The access token used when updating a subscription must have the webhooks.writeauth scope.

Security
oauth2_as_a_user(Required scopes: webhooks.write) or oauth2_as_a_server(Required scopes: webhooks.write)
Path
subscription_idstringrequired

Id of the subscription to update

Bodyapplication/json

Attributes of the webhook subscription to update.

urlstring, (url)(Webhooks.Subscription.url)

The url that will be called when delivering events for this subscription.

Example:"https://example.com/webhook"
authorization_headerstring(Webhooks.Subscription.authorization_header)

A value will be sent in every delivery as the 'Authorization' header value in the POST request.

Example:"Bearer abc123-some-token"
activeboolean(Webhooks.Subscription.active)

Whether the subscription is "turned on". Inactive subscriptions will not send deliveries to the subscription url except for ping deliveries.

Example:true
eventsArray of objects(Webhooks.Subscription.Event)
curl -i -X PUT \
  'https://partner.socialchorus.com/v2/webhooks/subscriptions/{subscription_id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://example.com/webhook",
    "authorization_header": "Bearer abc123-some-token",
    "active": true,
    "events": [
      {
        "name": "content_published",
        "version": "1"
      }
    ]
  }'

Responses

Success

Bodyapplication/json
dataobject(Webhooks.Subscription.Resource)required
Response
{ "data": { "id": "abc123", "url": "https://example.com/webhook", "authorization_header": "Bearer abc123-some-token", "active": true, "events": [], "created_at": "2000-01-01T00:00:00Z", "updated_at": "2000-01-01T00:00:00Z" } }