PUT /service/api/notifications/subscriptions/{subscriptionId}

Edits the information of a specific subscription.

Note for webhook-based subscriptions:

When changing the webhook's DeliveryContext or DeliveryUrl value, a synchronous validation call to the webhook DeliveryUrl will be made. The webhook has to respond successfully and with the expected ValidationResponse value in the response (the value must match the ValidationContext value provided in the webhook request). Otherwise the subscription will not be modified and an error is returned.

See the subchapter about "Webhook Calls: Validation Message" in the webhook section of the Notifications Guide for more information.

Request Information

URI Parameters

NameDescriptionTypeAdditional Information
subscriptionId

The identifier of the subscription to modify.

string

Required

URI Sample(s)

PUT
https://unityapi.webrootcloudav.com/service/api/notifications/subscriptions/3684e7de-c5e1-416c-a5b8-ac4995330572

Body Parameters

The modifications information for the subscription.

Values that are not provided will be left unchanged.

EditSubscriptionRequestModel
NameDescriptionTypeAdditional Information
DeliveryType

The delivery type to change the subscription to. Valid values are: "fetch" or "webhook".

string

None.

EventTypes

The list of event types the subscription should be changed to. This will replace the previous list of subscribed event types.

Collection of string

None.

Webhook

Webhook related properties that should be updated or set for the subscription.

EditSubscriptionRequestModelWebhook

Required, if webhook properties should be changed or when changing the subscription's DeliveryType to "webhook".

Sample Request

{
  "DeliveryType": "webhook",
  "EventTypes": [
    "Endpoint.FileDetection"
  ],
  "Webhook": {
    "DeliveryContext": "MyCustomCorrelationString",
    "DeliveryRateInSeconds": 90,
    "DeliveryUrl": "https://my.company.com/wrunity/notifications/webhook"
  }
}                    
<EditSubscriptionRequestModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Webroot.UnityAPI.ServiceExtension.Notifications.Models">
  <DeliveryType>webhook</DeliveryType>
  <EventTypes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>Endpoint.FileDetection</d2p1:string>
  </EventTypes>
  <Webhook>
    <DeliveryContext>MyCustomCorrelationString</DeliveryContext>
    <DeliveryRateInSeconds>90</DeliveryRateInSeconds>
    <DeliveryUrl>https://my.company.com/wrunity/notifications/webhook</DeliveryUrl>
  </Webhook>
</EditSubscriptionRequestModel>                    

Response Information

Resource Description

Information about the modified subscription.

EditSubscriptionResponseModel
NameDescriptionTypeAdditional Information
SubscriptionId

The subscription identifier.

string

None.

DeliveryType

The delivery type of the subscription.

string

None.

Domain

The domain the subscription has been created for.

SubscriptionResponseModelDomain

None.

EventTypes

The list of subscribed event types.

Collection of string

None.

Webhook

Information about webhook properties set for the subscription. This value is null, if DeliveryType is anything other than "webhook".

SubscriptionResponseModelWebhook

None.

CreatedDate

The time when the subscription was created.

date

None.

UpdatedDate

The time when the subscription was last updated.

date

None.

Sample Response

{
  "SubscriptionId": "a8a1f497-a38c-4f8c-b665-658f46b93a0d",
  "DeliveryType": "webhook",
  "Domain": {
    "Type": "Site",
    "Values": [
      {
        "Name": "GSMKey",
        "Value": "B52D-21A6-5BC7-435C-B273"
      },
      {
        "Name": "SiteKey",
        "Value": "9271-04AA-E55B-4418-9063"
      }
    ]
  },
  "EventTypes": [
    "Endpoint.FileDetection"
  ],
  "Webhook": {
    "DeliveryContext": "MyCustomCorrelationString",
    "DeliveryRateInSeconds": 90,
    "DeliveryUrl": "https://my.company.com/wrunity/notifications/webhook",
    "Suspended": false,
    "Statistics": null
  },
  "CreatedDate": "2024-01-19T16:01:37.8039329Z",
  "UpdatedDate": "2024-04-19T15:59:37.8039329Z"
}                    
<EditSubscriptionResponseModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Webroot.UnityAPI.ServiceExtension.Notifications.Models">
  <CreatedDate>2024-01-19T16:01:37.8039329Z</CreatedDate>
  <DeliveryType>webhook</DeliveryType>
  <Domain>
    <Type>Site</Type>
    <Values>
      <SubscriptionResponseModelDomainValue>
        <Name>GSMKey</Name>
        <Value>B52D-21A6-5BC7-435C-B273</Value>
      </SubscriptionResponseModelDomainValue>
      <SubscriptionResponseModelDomainValue>
        <Name>SiteKey</Name>
        <Value>9271-04AA-E55B-4418-9063</Value>
      </SubscriptionResponseModelDomainValue>
    </Values>
  </Domain>
  <EventTypes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>Endpoint.FileDetection</d2p1:string>
  </EventTypes>
  <SubscriptionId>a8a1f497-a38c-4f8c-b665-658f46b93a0d</SubscriptionId>
  <UpdatedDate>2024-04-19T15:59:37.8039329Z</UpdatedDate>
  <Webhook>
    <DeliveryContext>MyCustomCorrelationString</DeliveryContext>
    <DeliveryRateInSeconds>90</DeliveryRateInSeconds>
    <DeliveryUrl>https://my.company.com/wrunity/notifications/webhook</DeliveryUrl>
    <Statistics i:nil="true" />
    <Suspended>false</Suspended>
  </Webhook>
</EditSubscriptionResponseModel>