Subscribe to Webhook
curl --request POST \
--url https://api.thehyperstack.com/v1/webhook/subscribe \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": {}
}
'import requests
url = "https://api.thehyperstack.com/v1/webhook/subscribe"
payload = {
"url": "<string>",
"events": {}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: {}})
};
fetch('https://api.thehyperstack.com/v1/webhook/subscribe', 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://api.thehyperstack.com/v1/webhook/subscribe",
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' => '<string>',
'events' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://api.thehyperstack.com/v1/webhook/subscribe"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://api.thehyperstack.com/v1/webhook/subscribe")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.thehyperstack.com/v1/webhook/subscribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Webhook updated successfully"
}
{
"success": false,
"message": "",
"error": "URL and Event(s) are required",
"error_code": "missing_url_event"
}
{
"success": false,
"message": "",
"error": "Invalid Event(s)",
"error_code": "invalid_event"
}
{
"success": false,
"message": "",
"error": "Invalid URL",
"error_code": "invalid_url"
}
{
"detail": "Invalid token or organization not found"
}
Webhooks
Subscribe to Webhook
POST
/
v1
/
webhook
/
subscribe
Subscribe to Webhook
curl --request POST \
--url https://api.thehyperstack.com/v1/webhook/subscribe \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": {}
}
'import requests
url = "https://api.thehyperstack.com/v1/webhook/subscribe"
payload = {
"url": "<string>",
"events": {}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: {}})
};
fetch('https://api.thehyperstack.com/v1/webhook/subscribe', 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://api.thehyperstack.com/v1/webhook/subscribe",
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' => '<string>',
'events' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://api.thehyperstack.com/v1/webhook/subscribe"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://api.thehyperstack.com/v1/webhook/subscribe")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.thehyperstack.com/v1/webhook/subscribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Webhook updated successfully"
}
{
"success": false,
"message": "",
"error": "URL and Event(s) are required",
"error_code": "missing_url_event"
}
{
"success": false,
"message": "",
"error": "Invalid Event(s)",
"error_code": "invalid_event"
}
{
"success": false,
"message": "",
"error": "Invalid URL",
"error_code": "invalid_url"
}
{
"detail": "Invalid token or organization not found"
}
Description
Tells Hyperstack where to send events. Your organization has one webhook endpoint. If you call this again, the new URL and events replace the old ones. There is one event for now:credential.issued: sent each time a credential is published. See Webhook Events for what your endpoint receives.
Headers
string
required
Your API key:
Bearer YOUR_API_KEY. Create a key in the Studio under Settings → Developers.Body Parameters
string
required
The URL Hyperstack sends events to. It must start with
http:// or https://. Use https://.array[string]
required
The events to receive. Send
["credential.issued"].Success Response Fields
boolean
true when the webhook was saved.string
"Webhook updated successfully", or an empty string on an error.Responses
Errors also come with status200. Check success.
{
"success": true,
"message": "Webhook updated successfully"
}
{
"success": false,
"message": "",
"error": "URL and Event(s) are required",
"error_code": "missing_url_event"
}
{
"success": false,
"message": "",
"error": "Invalid Event(s)",
"error_code": "invalid_event"
}
{
"success": false,
"message": "",
"error": "Invalid URL",
"error_code": "invalid_url"
}
{
"detail": "Invalid token or organization not found"
}
curl -X POST "https://api.thehyperstack.com/v1/webhook/subscribe" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://acme.example.com/webhooks/hyperstack",
"events": ["credential.issued"]
}'
Last modified on October 20, 2026
Was this page helpful?

