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/b7e0ac87-29a4-48a3-a354-180b208e5753

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": "8aca3874-0adf-4d49-9691-c67bf16d649b",
  "DeliveryType": "webhook",
  "Domain": {
    "Type": "Site",
    "Values": [
      {
        "Name": "GSMKey",
        "Value": "7D88-479A-181B-4A57-9A17"
      },
      {
        "Name": "SiteKey",
        "Value": "EF6B-E04E-7B87-4582-B8C6"
      }
    ]
  },
  "EventTypes": [
    "Endpoint.FileDetection"
  ],
  "Webhook": {
    "DeliveryContext": "MyCustomCorrelationString",
    "DeliveryRateInSeconds": 90,
    "DeliveryUrl": "https://my.company.com/wrunity/notifications/webhook",
    "Suspended": false,
    "Statistics": null
  },
  "CreatedDate": "2024-09-21T02:47:09.684479Z",
  "UpdatedDate": "2024-12-21T02:45:09.684479Z"
}                    
<EditSubscriptionResponseModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Webroot.UnityAPI.ServiceExtension.Notifications.Models">
  <CreatedDate>2024-09-21T02:47:09.684479Z</CreatedDate>
  <DeliveryType>webhook</DeliveryType>
  <Domain>
    <Type>Site</Type>
    <Values>
      <SubscriptionResponseModelDomainValue>
        <Name>GSMKey</Name>
        <Value>7D88-479A-181B-4A57-9A17</Value>
      </SubscriptionResponseModelDomainValue>
      <SubscriptionResponseModelDomainValue>
        <Name>SiteKey</Name>
        <Value>EF6B-E04E-7B87-4582-B8C6</Value>
      </SubscriptionResponseModelDomainValue>
    </Values>
  </Domain>
  <EventTypes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>Endpoint.FileDetection</d2p1:string>
  </EventTypes>
  <SubscriptionId>8aca3874-0adf-4d49-9691-c67bf16d649b</SubscriptionId>
  <UpdatedDate>2024-12-21T02:45:09.684479Z</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>