Webhook Rules

Comprehensive guide to View's webhook rule management system, including event-driven automation, webhook configuration, retry mechanisms, and real-time integration setup for external system notifications.

Overview

The View Webhook Rule management system provides comprehensive configuration for event-driven automation and real-time integrations. Webhook rules define the conditions and parameters by which webhooks are invoked, enabling automated notifications, data synchronization, and external system integration based on platform events.

Key Features

  • Event-Driven Automation: Automatic webhook triggering based on platform events
  • Retry Mechanisms: Configurable retry logic with customizable intervals and maximum attempts
  • Timeout Control: Configurable timeout settings for webhook delivery
  • Target Integration: Seamless integration with webhook targets for external system notifications
  • Event Type Filtering: Support for various event types including object operations
  • Reliability Features: Built-in retry logic and failure handling for robust webhook delivery
  • Configuration Management: Complete lifecycle management of webhook rule configurations
  • Integration Support: Foundation for real-time system integrations and event-driven workflows

Supported Operations

  • Create: Create new webhook rule configurations with event triggers and delivery parameters
  • Read: Retrieve individual webhook rule configurations and metadata
  • Enumerate: List all webhook rules with pagination support
  • Update: Modify existing webhook rule configurations and settings
  • Delete: Remove webhook rule configurations and associated event triggers
  • Existence Check: Verify webhook rule presence without retrieving details

API Endpoints

Webhook rules are managed via the Configuration server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/webhookrules

Supported HTTP Methods: GET, HEAD, PUT, DELETE

Important: All webhook rule operations require appropriate authentication tokens.

Webhook Rule Object Structure

Webhook rule objects contain comprehensive configuration for event-driven webhook automation. Here's the complete structure:

{
    "GUID": "b4cf5430-9c25-4514-b3e5-fe7fd1108edb",
    "TenantGUID": "00000000-0000-0000-0000-000000000000",
    "TargetGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "My webhook rule",
    "EventType": "ObjectWrite",
    "MaxAttempts": 5,
    "RetryIntervalMs": 10000,
    "TimeoutMs": 30000,
    "CreatedUtc": "2025-03-29T09:23:23.035429Z"
}

Field Descriptions

  • GUID (GUID): Globally unique identifier for the webhook rule object
  • TenantGUID (GUID): Globally unique identifier for the tenant
  • TargetGUID (GUID): Globally unique identifier for the webhook target
  • Name (string): Display name for the webhook rule
  • EventType (string): Type of event that triggers the webhook (e.g., "ObjectWrite", "ObjectDelete")
  • MaxAttempts (number): Maximum number of delivery attempts for failed webhooks
  • RetryIntervalMs (number): Interval between retry attempts in milliseconds
  • TimeoutMs (number): Timeout duration for webhook delivery in milliseconds
  • CreatedUtc (datetime): UTC timestamp when the webhook rule was created

Important Notes

  • Event Triggers: Webhook rules are automatically triggered when matching events occur in the platform
  • Target Association: Each rule must be associated with a valid webhook target for delivery
  • Retry Logic: Failed webhook deliveries are automatically retried according to configured parameters
  • Event Types: Supported event types include object operations and platform events

Create Webhook Rule

Creates a new webhook rule configuration using PUT /v1.0/tenants/[tenant-guid]/webhookrules. This endpoint allows you to configure event-driven webhook automation with retry mechanisms and timeout controls.

Request Parameters

Required Parameters

  • Name (string, Body, Required): Display name for the webhook rule
  • TargetGUID (string, Body, Required): GUID of the webhook target for delivery
  • EventType (string, Body, Required): Type of event that triggers the webhook

Optional Parameters

  • MaxAttempts (number, Body, Optional): Maximum number of delivery attempts (defaults to 5)
  • RetryIntervalMs (number, Body, Optional): Interval between retry attempts in milliseconds (defaults to 10000)
  • TimeoutMs (number, Body, Optional): Timeout duration for webhook delivery in milliseconds (defaults to 30000)

Important Notes

  • Target Validation: Ensure the specified TargetGUID references a valid webhook target
  • Event Types: Use appropriate event types such as "ObjectWrite", "ObjectDelete", etc.
  • Retry Configuration: Configure retry parameters based on your target system's capabilities
  • Timeout Settings: Set appropriate timeout values based on expected response times
curl --location --request PUT 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "Name": "My webhook rule",
    "TargetGUID": "00000000-0000-0000-0000-000000000000",
    "EventType": "ObjectWrite",
    "MaxAttempts": 5,
    "RetryIntervalMs": 10000,
    "TimeoutMs": 30000
}'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
);


const createWebhookRules = async () => {
  try {
    const response = await api.WebhookRule.create({
      Name: "My webhook rule",
      TargetGUID: "<target-guid>",
      EventType: "ObjectWrite",
      MaxAttempts: 5,
      RetryIntervalMs: 10000,
      TimeoutMs: 30000,
    });
    console.log(response, "Webhook rules created successfully");
  } catch (err) {
    console.log("Error creating Webhook rules:", err);
  }
};

createWebhookRules();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def createWebhookRule():
    webhookRule = configuration.WebhookRule.create(
        Name="My webhook rule",
        TargetGUID="<target-guid>",
        EventType="ObjectWrite",
        MaxAttempts=5,
        RetryIntervalMs=10000,
        TimeoutMs=30000
    )
    print(webhookRule)  

createWebhookRule()
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
WebhookRule newWebhookRule = new WebhookRule
{
   Name = "My webhook rule",
   TargetGUID = Guid.Parse("<target-guid>"),
   EventType = WebhookEventTypeEnum.ObjectWrite,
   MaxAttempts = 5,
   RetryIntervalMs = 10000,
   TimeoutMs = 30000,
};

 WebhookRule createdWebhookRule = await sdk.WebhookRule.Create(newWebhookRule);

Response

Returns the created webhook rule object with all configuration details:

{
    "GUID": "b4cf5430-9c25-4514-b3e5-fe7fd1108edb",
    "TenantGUID": "00000000-0000-0000-0000-000000000000",
    "TargetGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "My webhook rule",
    "EventType": "ObjectWrite",
    "MaxAttempts": 5,
    "RetryIntervalMs": 10000,
    "TimeoutMs": 30000,
    "CreatedUtc": "2025-03-29T09:23:23.035429Z"
}

Enumerate Webhook Rules

Retrieves a paginated list of all webhook rule objects in the tenant using GET /v2.0/tenants/[tenant-guid]/webhookrules. This endpoint provides comprehensive enumeration with pagination support for managing multiple webhook rule configurations.

Request Parameters

No additional parameters required beyond authentication.

Response Structure

The enumeration response includes pagination metadata and webhook rule objects with complete configuration details.

curl --location 'http://localhost:8000/v2.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
);


const enumerateWebhookRules = async () => {
  try {
    const response = await api.WebhookRule.enumerate();
    console.log(response, "Webhook rules fetched successfully");
  } catch (err) {
    console.log("Error fetching Webhook rules:", err);
  }
};

enumerateWebhookRules();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def enumerateWebhookRules():
    webhookRules = configuration.WebhookRule.enumerate()
    print(webhookRules)

enumerateWebhookRules()
using View.Sdk;
using View.Sdk.Configuration;


ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
EnumerationResult<WebhookRule> response = await sdk.WebhookRule.Enumerate();

Response

Returns a paginated list of webhook rule objects:

{
    "Success": true,
    "Timestamp": {
        "Start": "2024-10-21T02:36:37.677751Z",
        "TotalMs": 23.58,
        "Messages": {}
    },
    "MaxResults": 10,
    "IterationsRequired": 1,
    "EndOfResults": true,
    "RecordsRemaining": 0,
    "Objects": [
        {
            "GUID": "b4cf5430-9c25-4514-b3e5-fe7fd1108edb",
            "TenantGUID": "00000000-0000-0000-0000-000000000000",
            "TargetGUID": "00000000-0000-0000-0000-000000000000",
            "Name": "My webhook rule",
            "EventType": "ObjectWrite",
            "MaxAttempts": 5,
            "RetryIntervalMs": 10000,
            "TimeoutMs": 30000,
            "CreatedUtc": "2025-03-29T09:23:23.035429Z"
        }
    ],
    "ContinuationToken": null
}

Read Webhook Rule

Retrieves webhook rule configuration and metadata by GUID using GET /v1.0/tenants/[tenant-guid]/webhookrules/[webhookrule-guid]. Returns the complete webhook rule configuration including event triggers, retry settings, and delivery parameters. If the rule doesn't exist, a 404 error is returned.

Request Parameters

  • webhookrule-guid (string, Path, Required): GUID of the webhook rule object to retrieve
curl --location 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
);
const readWebhookRule = async () => {
  try {
    const response = await api.WebhookRule.read(
      "<webhookrule-guid>"
    );
    console.log(response, "Webhook rule fetched successfully");
  } catch (err) {
    console.log("Error fetching Webhook rule:", err);
  }
};

readWebhookRule();;
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def readWebhookRule():
    webhookRule = configuration.WebhookRule.retrieve("<webhookrule-guid>")
    print(webhookRule)

readWebhookRule()
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
WebhookRule webhookRule = await sdk.WebhookRule.Retrieve(Guid.Parse("<webhookrule-guid>"));

Response

Returns the complete webhook rule configuration:

{
    "GUID": "b4cf5430-9c25-4514-b3e5-fe7fd1108edb",
    "TenantGUID": "00000000-0000-0000-0000-000000000000",
    "TargetGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "My webhook rule",
    "EventType": "ObjectWrite",
    "MaxAttempts": 5,
    "RetryIntervalMs": 10000,
    "TimeoutMs": 30000,
    "CreatedUtc": "2025-03-29T09:23:23.035429Z"
}

Read All Webhook Rules

Retrieves all webhook rule objects in the tenant using GET /v1.0/tenants/[tenant-guid]/webhookrules/. Returns an array of webhook rule objects with complete configuration details for all rules in the tenant.

Request Parameters

No additional parameters required beyond authentication.

curl --location 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
);

const readAllWebhookRules = async () => {
  try {
    const response = await api.WebhookRule.readAll();
    console.log(response, "All webhook rules fetched successfully");
  } catch (err) {
    console.log("Error fetching All webhook rules:", err);
  }
};

readAllWebhookRules();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def readAllWebhookRules():
    webhookRules = configuration.WebhookRule.retrieve_all()
    print(webhookRules)

readAllWebhookRules()
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
List<WebhookRule> webhookRules = await sdk.WebhookRule.RetrieveMany();

Response

Returns an array of all webhook rule objects:

[
    {
        "GUID": "b4cf5430-9c25-4514-b3e5-fe7fd1108edb",
        "TenantGUID": "00000000-0000-0000-0000-000000000000",
        "TargetGUID": "00000000-0000-0000-0000-000000000000",
        "Name": "My webhook rule",
        "EventType": "ObjectWrite",
        "MaxAttempts": 5,
        "RetryIntervalMs": 10000,
        "TimeoutMs": 30000,
        "CreatedUtc": "2025-03-29T09:23:23.035429Z"
    },
    {
        "GUID": "c5dg6541-ad36-5625-c4f6-gf8ge2219fec",
        "TenantGUID": "00000000-0000-0000-0000-000000000000",
        "TargetGUID": "00000000-0000-0000-0000-000000000001",
        "Name": "Document delete webhook",
        "EventType": "ObjectDelete",
        "MaxAttempts": 3,
        "RetryIntervalMs": 5000,
        "TimeoutMs": 15000,
        "CreatedUtc": "2025-03-29T10:45:15.123456Z"
    }
]

Update Webhook Rule

Updates an existing webhook rule configuration using PUT /v1.0/tenants/[tenant-guid]/webhookrules/[webhookrule-guid]. This endpoint allows you to modify webhook rule parameters while preserving certain immutable fields.

Request Parameters

  • webhookrule-guid (string, Path, Required): GUID of the webhook rule object to update

Updateable Fields

All configuration parameters can be updated except for:

  • GUID: Immutable identifier
  • TenantGUID: Immutable tenant association
  • CreatedUtc: Immutable creation timestamp

Important Notes

  • Field Preservation: Certain fields cannot be modified and will be preserved across updates
  • Complete Object: Provide a fully populated object in the request body
  • Target Validation: Updated target GUIDs must reference valid webhook targets
  • Configuration Testing: Test updated configurations to ensure proper webhook delivery
curl --location --request PUT 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules/00000000-0000-0000-0000-000000000000' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "TargetGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "My updated webhook rule",
    "EventType": "ObjectWrite",
    "MaxAttempts": 5,
    "RetryIntervalMs": 10000,
    "TimeoutMs": 30000
}'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
);

const updateWebhookRule = async () => {
  try {
    const response = await api.WebhookRule.update({
      GUID: "<webhookrule-guid>",
      TenantGUID: "<tenant-guid>",
      TargetGUID: "<target-guid>",
      Name: "My webhook rule [UPDATED]",
      EventType: "ObjectWrite",
      MaxAttempts: 5,
      RetryIntervalMs: 10000,
      TimeoutMs: 30000,
      CreatedUtc: "2025-03-29T11:27:22.814177Z",
    });
    console.log(response, "Webhook rule updated successfully");
  } catch (err) {
    console.log("Error updating Webhook rule:", err);
  }
};

updateWebhookRule();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def updateWebhookRule():
    webhookRule = configuration.WebhookRule.update("<webhookrule-guid>",
        Name="My webhook rule [updated]",
        TargetGUID="<target-guid>",
        EventType="ObjectWrite",
        MaxAttempts=5,
    )
    print(webhookRule)

updateWebhookRule()
using System.Text.Json;
using View.Sdk;
using View.Sdk.Configuration;

public static class Configuration {
    public static async Task Main(string[] args)
    {
        ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
        var webhookRule = new WebhookRule
        {
            GUID = Guid.Parse("<webhookrule-guid>"),
            TenantGUID = Guid.Parse("<tenant-guid>"),
            TargetGUID = Guid.Parse("<target-guid>"),
            Name = "My webhook rule [UPDATED]",
            EventType = WebhookEventTypeEnum.ObjectWrite,
            MaxAttempts = 5,
            RetryIntervalMs = 10000,
            TimeoutMs = 30000
        };

        WebhookRule updatedWebhookRule = await sdk.WebhookRule.Update(webhookRule);

        string updatedWebhookRuleJson = JsonSerializer.Serialize(updatedWebhookRule, new JsonSerializerOptions { 
            WriteIndented = true 
        });

        Console.WriteLine("WebhookRule updated successfully");
        Console.WriteLine(updatedWebhookRuleJson);
    }
}

Response

Returns the updated webhook rule object with all configuration details:

{
    "GUID": "b4cf5430-9c25-4514-b3e5-fe7fd1108edb",
    "TenantGUID": "00000000-0000-0000-0000-000000000000",
    "TargetGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "My webhook rule [UPDATED]",
    "EventType": "ObjectWrite",
    "MaxAttempts": 5,
    "RetryIntervalMs": 10000,
    "TimeoutMs": 30000,
    "CreatedUtc": "2025-03-29T09:23:23.035429Z"
}

Delete Webhook Rule

Deletes a webhook rule object by GUID using DELETE /v1.0/tenants/[tenant-guid]/webhookrules/[webhookrule-guid]. This operation permanently removes the webhook rule configuration and stops all associated event triggers. Use with caution as this action cannot be undone.

Important Note: Deleting a webhook rule will immediately stop all webhook deliveries for the associated events.

Request Parameters

  • webhookrule-guid (string, Path, Required): GUID of the webhook rule object to delete
curl --location --request DELETE 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules/00000000-0000-0000-0000-000000000000' \
--header 'Content-Type: text/plain' \
--header 'Authorization: ••••••' \
--data '{
    "TenantGUID": "05b702a6-9c0e-4741-a465-581f2456e994",
    "Name": "Another Storage Pool",
    "Provider": "Disk",
    "WriteMode": "GUID",
    "UseSsl": false,
    "DiskDirectory": "./disk2/",
    "Dedupe": false,
    "Compress": "None",
    "EnableReadCaching": false,
    "Encrypt": "None"
}'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
);

const deleteWebhookRule = async () => {
  try {
    const response = await api.WebhookRule.delete(
      "<webhookrule-guid>"
    );
    console.log(response, "Webhook rule deleted successfully");
  } catch (err) {
    console.log("Error deleting Webhook rule:", err);
  }
};

deleteWebhookRule();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def deleteWebhookRule():
    webhookRule = configuration.WebhookRule.delete("<webhookrule-guid>")
    print(webhookRule)

deleteWebhookRule()
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
        
bool deleted = await sdk.WebhookRule.Delete(Guid.Parse("<webhookrule-guid>"));

Response

Returns 200 No Content on successful deletion. No response body is returned.

Check Webhook Rule Existence

Verifies if a webhook rule object exists without retrieving its configuration using HEAD /v1.0/tenants/[tenant-guid]/webhookrules/[webhookrule-guid]. This is an efficient way to check rule presence before performing operations.

Request Parameters

  • webhookrule-guid (string, Path, Required): GUID of the webhook rule object to check
curl --location --head 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
);

const webhookRuleExists = async () => {
  try {
    const response = await api.WebhookRule.exists(
      "<webhookrule-guid>"
    );
    console.log(response, "Webhook rule exists");
  } catch (err) {
    console.log("Error checking Webhook rule:", err);
  }
};

webhookRuleExists();
import view_sdk
from view_sdk import configuration
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def existsWebhookRule():
    webhookRule = configuration.WebhookRule.exists("<webhookrule-guid>")
    print(webhookRule)

existsWebhookRule()  
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
        
bool exists = await sdk.WebhookRule.Exists(Guid.Parse("<webhookrule-guid>"));

Response

  • 200 No Content: Webhook rule exists
  • 404 Not Found: Webhook rule does not exist
  • No response body: Only HTTP status code is returned

Note: HEAD requests do not return a response body, only the HTTP status code indicating whether the webhook rule exists.

Best Practices

When managing webhook rules in the View platform, consider the following recommendations for optimal event-driven automation and integration:

  • Event Type Selection: Choose appropriate event types that match your integration requirements and avoid unnecessary webhook triggers
  • Retry Configuration: Configure retry intervals and maximum attempts based on your target system's reliability and response times
  • Timeout Settings: Set appropriate timeout values to balance between reliability and performance
  • Target Validation: Ensure webhook targets are properly configured and accessible before creating rules
  • Monitoring: Regularly monitor webhook delivery success rates and adjust configurations as needed

Next Steps

After successfully configuring webhook rules, you can:

  • Webhook Targets: Create and configure webhook targets to specify delivery endpoints
  • Webhook Events: Monitor webhook event executions and delivery status
  • Integration Testing: Test webhook delivery with various event types and scenarios
  • Automation Workflows: Build comprehensive event-driven automation workflows
  • Monitoring Systems: Implement monitoring and alerting for webhook delivery performance