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 objectTenantGUID
GUID
globally unique identifier for the tenantName
string
name of the objectURL
string
webhook target urlContentType``string
Content typeExpectStatus
number
Expect statusCreatedUtc
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(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const createWebhookTarget = async () => {
try {
const response = await api.createWebhookTarget({
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();
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(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const enumerateWebhookTargets = async () => {
try {
const response = await api.enumerateWebhookTargets();
console.log(response, "Webhook targets fetched successfully");
} catch (err) {
console.log("Error fetching Webhook targets:", err);
}
};
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(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const readWebhookTarget = async () => {
try {
const response = await api.retrieveWebhookTarget(
"4bd187db-3a56-495e-b7fe-d00c963d5333"
);
console.log(response, "Webhook target fetched successfully");
} catch (err) {
console.log("Error fetching Webhook target:", err);
}
};
readWebhookTarget();
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(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const readAllWebhookTargets = async () => {
try {
const response = await api.retrieveWebhookTargets();
console.log(response, "All webhook targets fetched successfully");
} catch (err) {
console.log("Error fetching All webhook targets:", err);
}
};
readAllWebhookTargets();
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(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const updateWebhookTarget = async () => {
try {
const response = await api.updateWebhookTarget({
GUID: "4bd187db-3a56-495e-b7fe-d00c963d5333",
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();
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(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const deleteWebhookTarget = async () => {
try {
const response = await api.deleteWebhookTarget(
"4bd187db-3a56-495e-b7fe-d00c963d5333"
);
console.log(response, "Webhook target deleted successfully");
} catch (err) {
console.log("Error deleting Webhook target:", err);
}
};
deleteWebhookTarget();
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(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const existsWebhookTarget = async () => {
try {
const response = await api.existsWebhookTarget(
"4bd187db-3a56-495e-b7fe-d00c963d5333"
);
console.log(response, "Webhook target exists");
} catch (err) {
console.log("Error checking Webhook target:", err);
}
};
existsWebhookTarget();