Webhook Targets

Comprehensive guide to View's webhook target management system, including endpoint configuration, delivery settings, content type management, and external system integration setup for reliable webhook notifications.

Overview

The View Webhook Target management system provides comprehensive configuration for external system integration and reliable webhook delivery. Webhook targets define the endpoints, content types, and delivery parameters for webhook notifications, enabling seamless integration with external systems, APIs, and services for real-time event notifications and data synchronization.

Key Features

  • Endpoint Configuration: Flexible configuration of webhook delivery endpoints and URLs
  • Content Type Management: Support for various content types including JSON, XML, and custom formats
  • Status Code Validation: Configurable expected status codes for successful webhook delivery
  • Delivery Reliability: Built-in retry mechanisms and error handling for robust webhook delivery
  • Integration Support: Seamless integration with external systems and third-party services
  • Configuration Management: Complete lifecycle management of webhook target configurations
  • Security Features: Secure endpoint configuration and delivery validation
  • Monitoring Support: Foundation for webhook delivery monitoring and analytics

Supported Operations

  • Create: Create new webhook target configurations with endpoint and delivery settings
  • Read: Retrieve individual webhook target configurations and metadata
  • Enumerate: List all webhook targets with pagination support
  • Update: Modify existing webhook target configurations and settings
  • Delete: Remove webhook target configurations and associated delivery endpoints
  • Existence Check: Verify webhook target presence without retrieving details

API Endpoints

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

Supported HTTP Methods: GET, HEAD, PUT, DELETE

Important: All webhook target operations require appropriate authentication tokens.

Webhook Target Object Structure

Webhook target objects contain comprehensive configuration for webhook delivery endpoints and external system integration. Here's the complete structure:

{
    "GUID": "f4bd1d87-598a-4e16-ace3-5c2a8ce55511",
    "TenantGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "My webhook target",
    "Url": "http://localhost:8311",
    "ContentType": "application/json",
    "ExpectStatus": 200,
    "CreatedUtc": "2025-04-01T08:32:10.049054Z"
}

Field Descriptions

  • GUID (GUID): Globally unique identifier for the webhook target object
  • TenantGUID (GUID): Globally unique identifier for the tenant
  • Name (string): Display name for the webhook target
  • Url (string): Target URL where webhooks will be delivered
  • ContentType (string): MIME type of the webhook payload content (e.g., "application/json", "application/xml")
  • ExpectStatus (number): Expected HTTP status code for successful webhook delivery
  • CreatedUtc (datetime): UTC timestamp when the webhook target was created

Important Notes

  • URL Validation: Ensure the target URL is accessible and properly configured for webhook reception
  • Content Type: Use appropriate content types that match your target system's expectations
  • Status Codes: Configure expected status codes based on your target system's response patterns
  • Security: Use HTTPS URLs for production webhook targets to ensure secure delivery

Create Webhook Target

Creates a new webhook target configuration using PUT /v1.0/tenants/[tenant-guid]/webhooktargets. This endpoint allows you to configure webhook delivery endpoints with content type and status code validation for external system integration.

Request Parameters

Required Parameters

  • Name (string, Body, Required): Display name for the webhook target
  • Url (string, Body, Required): Target URL where webhooks will be delivered

Optional Parameters

  • ContentType (string, Body, Optional): MIME type of the webhook payload content (defaults to "application/json")
  • ExpectStatus (number, Body, Optional): Expected HTTP status code for successful delivery (defaults to 200)

Important Notes

  • URL Accessibility: Ensure the target URL is accessible and properly configured for webhook reception
  • Content Type: Use appropriate content types that match your target system's expectations
  • Status Code: Configure expected status codes based on your target system's response patterns
  • Security: Use HTTPS URLs for production webhook targets to ensure secure delivery
curl --location --request PUT 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhooktargets' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "Name": "My webhook target",
    "Url": "http://localhost:8311",
    "ContentType": "application/json",
    "ExpectStatus": 200
}
'
import { ViewConfigurationSdk } from "view-sdk";

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

const createWebhookTarget = async () => {
  try {
    const response = await  api.WebhookTarget.create({
      Name: "My webhook target [ASH]",
      Url: "http://localhost:8311",
      ContentType: "application/json",
      ExpectStatus: 200,
    });
    console.log(response, "Webhook target created successfully");
  } catch (err) {
    console.log("Error creating Webhook target:", err);
  }
};

createWebhookTarget();
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 createWebhookTarget():
    webhookTarget = configuration.WebhookTarget.create(
        Name="My webhook target",
        Url="http://localhost:8311",
        ContentType="application/json",
        ExpectStatus=200
    )
    print(webhookTarget)

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

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
WebhookTarget newWebhookTarget = new WebhookTarget
{
   Name = "My webhook target [ASH]",
   Url = "http://localhost:8311",
   ContentType = "application/json",
   ExpectStatus = 200,
};

WebhookTarget createdWebhookTarget = await sdk.WebhookTarget.Create(newWebhookTarget);

Response

Returns the created webhook target object with all configuration details:

{
    "GUID": "f4bd1d87-598a-4e16-ace3-5c2a8ce55511",
    "TenantGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "My webhook target",
    "Url": "http://localhost:8311",
    "ContentType": "application/json",
    "ExpectStatus": 200,
    "CreatedUtc": "2025-04-01T08:32:10.049054Z"
}

Enumerate Webhook Targets

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

Request Parameters

No additional parameters required beyond authentication.

Response Structure

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

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

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

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

enumerateWebhookTargets();
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 enumerateWebhookTargets():
    webhookTargets = configuration.WebhookTarget.enumerate()
    print(webhookTargets)

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


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

Response

Returns a paginated list of webhook target 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": "f4bd1d87-598a-4e16-ace3-5c2a8ce55511",
            "TenantGUID": "00000000-0000-0000-0000-000000000000",
            "Name": "My webhook target",
            "Url": "http://localhost:8311",
            "ContentType": "application/json",
            "ExpectStatus": 200,
            "CreatedUtc": "2025-04-01T08:32:10.049054Z"
        }
    ],
    "ContinuationToken": null
}

Read Webhook Target

Retrieves webhook target configuration and metadata by GUID using GET /v1.0/tenants/[tenant-guid]/webhooktargets/[webhooktarget-guid]. Returns the complete webhook target configuration including endpoint URL, content type, and delivery settings. If the target doesn't exist, a 404 error is returned.

Request Parameters

  • webhooktarget-guid (string, Path, Required): GUID of the webhook target object to retrieve
curl --location 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhooktargets/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 readWebhookTarget = async () => {
  try {
    const response = await api.WebhookTarget.read(
      "<webhooktarget-guid>"
    );
    console.log(response, "Webhook target fetched successfully");
  } catch (err) {
    console.log("Error fetching Webhook target:", err);
  }
};

readWebhookTarget();
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 readWebhookTarget():
    webhookTarget = configuration.WebhookTarget.retrieve("<webhooktarget-guid>")
    print(webhookTarget)

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

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

Response

Returns the complete webhook target configuration:

{
    "GUID": "f4bd1d87-598a-4e16-ace3-5c2a8ce55511",
    "TenantGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "My webhook target",
    "Url": "http://localhost:8311",
    "ContentType": "application/json",
    "ExpectStatus": 200,
    "CreatedUtc": "2025-04-01T08:32:10.049054Z"
}

Read All Webhook Targets

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

Request Parameters

No additional parameters required beyond authentication.

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

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

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

readAllWebhookTargets();
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 readAllWebhookTargets():
    webhookTargets = configuration.WebhookTarget.retrieve_all()
    print(webhookTargets)

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

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

Response

Returns an array of all webhook target objects:

[
    {
        "GUID": "f4bd1d87-598a-4e16-ace3-5c2a8ce55511",
        "TenantGUID": "00000000-0000-0000-0000-000000000000",
        "Name": "My webhook target",
        "Url": "http://localhost:8311",
        "ContentType": "application/json",
        "ExpectStatus": 200,
        "CreatedUtc": "2025-04-01T08:32:10.049054Z"
    },
    {
        "GUID": "a5ce2e98-609b-5f27-bdf4-6d3b9df66622",
        "TenantGUID": "00000000-0000-0000-0000-000000000000",
        "Name": "Production webhook target",
        "Url": "https://api.example.com/webhooks",
        "ContentType": "application/json",
        "ExpectStatus": 201,
        "CreatedUtc": "2025-04-01T10:15:30.123456Z"
    }
]

Update Webhook Target

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

Request Parameters

  • webhooktarget-guid (string, Path, Required): GUID of the webhook target 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
  • URL Validation: Updated URLs must be accessible and properly configured for webhook reception
  • 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/webhooktargets/00000000-0000-0000-0000-000000000000' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "Name": "My updated webhook target",
    "Url": "http://localhost:8311",
    "ContentType": "application/json",
    "ExpectStatus": 200
}'
import { ViewConfigurationSdk } from "view-sdk";

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

const updateWebhookTarget = async () => {
  try {
    const response = await api.WebhookTarget.update({
      GUID: "<webhooktarget-guid>",
      Name: "My webhook target [ASH] [UPDATED]",
      Url: "http://localhost:8311",
      ContentType: "application/json",
      ExpectStatus: 200,
    });
    console.log(response, "Webhook target updated successfully");
  } catch (err) {
    console.log("Error updating Webhook target:", err);
  }
};

updateWebhookTarget();
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 updateWebhookTarget():
    webhookTarget = configuration.WebhookTarget.update("<webhooktarget-guid>",
        Name="My webhook target [updated]",
        Url="http://localhost:8311",
        ContentType="application/json",
        ExpectStatus=200
    )
    print(webhookTarget)

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

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
var webhookTarget = new WebhookTarget
{
   GUID = Guid.Parse("<webhooktarget-guid>"),
   Name = "My webhook target [ASH] [UPDATED]",
   Url = "http://localhost:8311",
   ContentType = "application/json",
   ExpectStatus = 200,
};

WebhookTarget updatedWebhookTarget = await sdk.WebhookTarget.Update(webhookTarget);

Response

Returns the updated webhook target object with all configuration details:

{
    "GUID": "f4bd1d87-598a-4e16-ace3-5c2a8ce55511",
    "TenantGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "My updated webhook target",
    "Url": "http://localhost:8311",
    "ContentType": "application/json",
    "ExpectStatus": 200,
    "CreatedUtc": "2025-04-01T08:32:10.049054Z"
}

Delete Webhook Target

Deletes a webhook target object by GUID using DELETE /v1.0/tenants/[tenant-guid]/webhooktargets/[webhooktarget-guid]. This operation permanently removes the webhook target configuration from the system. Use with caution as this action cannot be undone.

Important Note: Ensure no active webhook rules are using this target before deletion, as this will break webhook delivery.

Request Parameters

  • webhooktarget-guid (string, Path, Required): GUID of the webhook target object to delete
curl --location --request DELETE 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhooktargets/00000000-0000-0000-0000-000000000000' \
--header 'Content-Type: text/plain' \
--header 'Authorization: ••••••' \
import { ViewConfigurationSdk } from "view-sdk";

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

const deleteWebhookTarget = async () => {
  try {
    const response = await api.WebhookTarget.delete(
      "<webhooktarget-guid>"
    );
    console.log(response, "Webhook target deleted successfully");
  } catch (err) {
    console.log("Error deleting Webhook target:", err);
  }
};

deleteWebhookTarget();
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 deleteWebhookTarget():
    webhookTarget = configuration.WebhookTarget.delete("<webhooktarget-guid>")
    print(webhookTarget)

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

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

bool deleted = await sdk.WebhookTarget.Delete(Guid.Parse("<webhooktarget-guid>"));

Response

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

Check Webhook Target Existence

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

Request Parameters

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

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

const existsWebhookTarget = async () => {
  try {
    const response = await api.WebhookTarget.exists(
      "<webhooktarget-guid>"
    );
    console.log(response, "Webhook target exists");
  } catch (err) {
    console.log("Error checking Webhook target:", err);
  }
};

existsWebhookTarget();
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 existsWebhookTarget():
    webhookTarget = configuration.WebhookTarget.exists("<webhooktarget-guid>")
    print(webhookTarget)

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

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

Response

  • 200 No Content: Webhook target exists
  • 404 Not Found: Webhook target 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 target exists.

Best Practices

When managing webhook targets in the View platform, consider the following recommendations for optimal webhook delivery and external system integration:

  • URL Security: Use HTTPS URLs for production webhook targets to ensure secure delivery and data protection
  • Content Type Consistency: Use consistent content types that match your target system's expectations and processing capabilities
  • Status Code Configuration: Configure appropriate expected status codes based on your target system's response patterns
  • Endpoint Testing: Regularly test webhook target endpoints to ensure they remain accessible and responsive
  • Monitoring: Implement monitoring and alerting for webhook delivery success rates and endpoint availability

Next Steps

After successfully configuring webhook targets, you can:

  • Webhook Rules: Create webhook rules to define when and how webhooks are triggered to these targets
  • Webhook Events: Monitor webhook event executions and delivery status for configured targets
  • Integration Testing: Test webhook delivery with various payload types and scenarios
  • External System Integration: Integrate with external systems and third-party services using configured targets
  • Delivery Monitoring: Implement comprehensive monitoring and analytics for webhook delivery performance