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/24067844-34cd-4a63-a7a1-44b40934e0ee

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": "4ae0e471-6d88-4d5e-b900-79ae41764bde",
  "DeliveryType": "webhook",
  "Domain": {
    "Type": "Site",
    "Values": [
      {
        "Name": "GSMKey",
        "Value": "4515-18B9-6AC8-4D99-A13E"
      },
      {
        "Name": "SiteKey",
        "Value": "7DD3-3E0F-DE59-45CB-B970"
      }
    ]
  },
  "EventTypes": [
    "Endpoint.FileDetection"
  ],
  "Webhook": {
    "DeliveryContext": "MyCustomCorrelationString",
    "DeliveryRateInSeconds": 90,
    "DeliveryUrl": "https://my.company.com/wrunity/notifications/webhook",
    "Suspended": false,
    "Statistics": null
  },
  "CreatedDate": "2024-08-17T21:28:36.9726661Z",
  "UpdatedDate": "2024-11-17T21:26:36.9726661Z"
}                    
<EditSubscriptionResponseModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Webroot.UnityAPI.ServiceExtension.Notifications.Models">
  <CreatedDate>2024-08-17T21:28:36.9726661Z</CreatedDate>
  <DeliveryType>webhook</DeliveryType>
  <Domain>
    <Type>Site</Type>
    <Values>
      <SubscriptionResponseModelDomainValue>
        <Name>GSMKey</Name>
        <Value>4515-18B9-6AC8-4D99-A13E</Value>
      </SubscriptionResponseModelDomainValue>
      <SubscriptionResponseModelDomainValue>
        <Name>SiteKey</Name>
        <Value>7DD3-3E0F-DE59-45CB-B970</Value>
      </SubscriptionResponseModelDomainValue>
    </Values>
  </Domain>
  <EventTypes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>Endpoint.FileDetection</d2p1:string>
  </EventTypes>
  <SubscriptionId>4ae0e471-6d88-4d5e-b900-79ae41764bde</SubscriptionId>
  <UpdatedDate>2024-11-17T21:26:36.9726661Z</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>