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/272a23cf-abeb-4904-8d6e-53a767c455d7

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": "5e5dd660-2233-4821-a4db-300515a37f46",
  "DeliveryType": "webhook",
  "Domain": {
    "Type": "Site",
    "Values": [
      {
        "Name": "GSMKey",
        "Value": "B3D0-2B9E-54EC-4DA6-9325"
      },
      {
        "Name": "SiteKey",
        "Value": "60E0-B4CC-7CDB-4D4D-AFED"
      }
    ]
  },
  "EventTypes": [
    "Endpoint.FileDetection"
  ],
  "Webhook": {
    "DeliveryContext": "MyCustomCorrelationString",
    "DeliveryRateInSeconds": 90,
    "DeliveryUrl": "https://my.company.com/wrunity/notifications/webhook",
    "Suspended": false,
    "Statistics": null
  },
  "CreatedDate": "2022-11-09T05:58:55.1543181Z",
  "UpdatedDate": "2023-02-09T05:56:55.1543181Z"
}                    
<EditSubscriptionResponseModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Webroot.UnityAPI.ServiceExtension.Notifications.Models">
  <CreatedDate>2022-11-09T05:58:55.1543181Z</CreatedDate>
  <DeliveryType>webhook</DeliveryType>
  <Domain>
    <Type>Site</Type>
    <Values>
      <SubscriptionResponseModelDomainValue>
        <Name>GSMKey</Name>
        <Value>B3D0-2B9E-54EC-4DA6-9325</Value>
      </SubscriptionResponseModelDomainValue>
      <SubscriptionResponseModelDomainValue>
        <Name>SiteKey</Name>
        <Value>60E0-B4CC-7CDB-4D4D-AFED</Value>
      </SubscriptionResponseModelDomainValue>
    </Values>
  </Domain>
  <EventTypes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>Endpoint.FileDetection</d2p1:string>
  </EventTypes>
  <SubscriptionId>5e5dd660-2233-4821-a4db-300515a37f46</SubscriptionId>
  <UpdatedDate>2023-02-09T05:56:55.1543181Z</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>