Webhook Targets

This page covers configuration and management of Webhook Target objects.

Object Overview

Webhook targets.

Endpoint, URL, and Supported Methods

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

Supported methods include: GET HEAD PUT DELETE

Structure

Objects have the following 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"
}
  • GUID GUID globally unique identifier for the object
  • TenantGUID GUID globally unique identifier for the tenant
  • Name string name of the object
  • URL string webhook target url
  • ContentType``string Content type
  • ExpectStatus number Expect status
  • CreatedUtc datetime timestamp from creation, in UTC time

Create

To create, call PUT /v1.0/tenants/[tenant-guid]/webhooktargets with the following properties using the Configuration server

curl --location --request PUT 'http://view.homedns.org: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

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

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.CreateWebhookTarget(newWebhookTarget);

Enumerate

Enumerate objects by using GET /v2.0/tenants/[tenant-guid]/webhooktargets

curl --location 'http://view.homedns.org: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

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

def enumerateWebhookTargets():
    webhookTargets = configuration.WebhookTarget.enumerate()
    print(webhookTargets)

enumerateWebhookTargets()

Read

To read an object by GUID, call GET /v1.0/tenants/[tenant-guid]/webhooktargets/[webhooktarget-guid]. If the object exists, it will be returned as a JSON object in the response body. If it does not exist, a 404 will be returned with a NotFound error response.

curl --location 'http://view.homedns.org: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

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

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.RetrieveWebhookTarget(Guid.Parse("<webhooktarget-guid>"));

Read all

o read all objects, call GET /v1.0/tenants/[tenant-guid]/webhooktargets/. If the object exists, it will be returned as an array of JSON object in the response body

curl --location 'http://view.homedns.org: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

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

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.RetrieveWebhookTargets();

Update

To update, call PUT /v1.0/tenants/[tenant-guid]/webhooktargets/{webhooktarget-guid} with the object properties using the Configuration server

curl --location --request PUT 'http://view.homedns.org: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

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

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.UpdateWebhookTarget(webhookTarget);

Delete

To delete an object by GUID, call DELETE /v1.0/tenants/[tenant-guid]/webhooktargets/[webhooktarget-guid].

curl --location --request DELETE 'http://view.homedns.org: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

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

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.DeleteWebhookTarget(Guid.Parse("<webhooktarget-guid>"));

Check Existence

Note: the HEAD method can be used as an alternative to get to simply check the existence of the object. HEAD requests return either a 200/OK in the event the object exists, or a 404/Not Found if not. No response body is returned with a HEAD request.

curl --location --head 'http://view.homedns.org: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

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

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.ExistsWebhookTarget(Guid.Parse("<webhooktarget-guid>"));