Create Webhook
curl --request POST \
--url https://access.utgl.io/v1/webhooks \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/webhook",
"events": [
"<string>"
],
"name": "My Webhook"
}
'import requests
url = "https://access.utgl.io/v1/webhooks"
payload = {
"url": "https://example.com/webhook",
"events": ["<string>"],
"name": "My Webhook"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/webhook', events: ['<string>'], name: 'My Webhook'})
};
fetch('https://access.utgl.io/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://access.utgl.io/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://example.com/webhook',
'events' => [
'<string>'
],
'name' => 'My Webhook'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://access.utgl.io/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://example.com/webhook\",\n \"events\": [\n \"<string>\"\n ],\n \"name\": \"My Webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://access.utgl.io/v1/webhooks")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/webhook\",\n \"events\": [\n \"<string>\"\n ],\n \"name\": \"My Webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://access.utgl.io/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/webhook\",\n \"events\": [\n \"<string>\"\n ],\n \"name\": \"My Webhook\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "My Webhook",
"url": "https://your-webhook.server/utgl-access-webhooks",
"status": "created",
"events": [
"<string>"
]
}Webhooks
Create Webhook
Create a Webhook to receive notifications when an event occurs
POST
/
webhooks
Create Webhook
curl --request POST \
--url https://access.utgl.io/v1/webhooks \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/webhook",
"events": [
"<string>"
],
"name": "My Webhook"
}
'import requests
url = "https://access.utgl.io/v1/webhooks"
payload = {
"url": "https://example.com/webhook",
"events": ["<string>"],
"name": "My Webhook"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/webhook', events: ['<string>'], name: 'My Webhook'})
};
fetch('https://access.utgl.io/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://access.utgl.io/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://example.com/webhook',
'events' => [
'<string>'
],
'name' => 'My Webhook'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://access.utgl.io/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://example.com/webhook\",\n \"events\": [\n \"<string>\"\n ],\n \"name\": \"My Webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://access.utgl.io/v1/webhooks")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/webhook\",\n \"events\": [\n \"<string>\"\n ],\n \"name\": \"My Webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://access.utgl.io/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/webhook\",\n \"events\": [\n \"<string>\"\n ],\n \"name\": \"My Webhook\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "My Webhook",
"url": "https://your-webhook.server/utgl-access-webhooks",
"status": "created",
"events": [
"<string>"
]
}Authorizations
BasicBearer
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
URL to receive notifications. Must be a valid https:// url with a valid SSL certificate signed by a trusted CA.
Example:
"https://example.com/webhook"
The list of events to enable for this webhook endpoint. You may specify [’*’] to enable all events.
Name of the webhook, for your reference. If name is not provided, default name (webhook id) will be used.
Example:
"My Webhook"
Response
200 - application/json
Webhook created
Webhook ID
Name of webhook
Example:
"My Webhook"
URL of webhook endpoint
Example:
"https://your-webhook.server/utgl-access-webhooks"
createdwebhook has been recently created, pending initial health checkhealthywebhook is active and there are no delivery issuesunhealthywebhook is in degraded state and deliveries are being retriederrorwebhook is in error state and deliveries are suspendedremovedwebhook has been removed
Available options:
created, healthy, unhealthy, error, removed List of subscribed events
Was this page helpful?

