Activates/deactivates a subscriber or rotates its secretToken. When rotateSecretToken is true, the response contains the new token — the previous token will no longer validate signatures.
PUT
/
api
/
webhook
/
subscribers
/
{id}
Update a subscriber
curl --request PUT \
--url https://gateway-api.guardhousehq.com/api/webhook/subscribers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'external-gh-apim-sub-key: <api-key>' \
--data '
{
"isActive": true,
"rotateSecretToken": true
}
'import requests
url = "https://gateway-api.guardhousehq.com/api/webhook/subscribers/{id}"
payload = {
"isActive": True,
"rotateSecretToken": True
}
headers = {
"Authorization": "Bearer <token>",
"external-gh-apim-sub-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'external-gh-apim-sub-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({isActive: true, rotateSecretToken: true})
};
fetch('https://gateway-api.guardhousehq.com/api/webhook/subscribers/{id}', 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://gateway-api.guardhousehq.com/api/webhook/subscribers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'isActive' => true,
'rotateSecretToken' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"external-gh-apim-sub-key: <api-key>"
],
]);
$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://gateway-api.guardhousehq.com/api/webhook/subscribers/{id}"
payload := strings.NewReader("{\n \"isActive\": true,\n \"rotateSecretToken\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("external-gh-apim-sub-key", "<api-key>")
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.put("https://gateway-api.guardhousehq.com/api/webhook/subscribers/{id}")
.header("Authorization", "Bearer <token>")
.header("external-gh-apim-sub-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"isActive\": true,\n \"rotateSecretToken\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway-api.guardhousehq.com/api/webhook/subscribers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["external-gh-apim-sub-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"isActive\": true,\n \"rotateSecretToken\": true\n}"
response = http.request(request)
puts response.read_body{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": {
"id": 123,
"companyId": 123,
"secretToken": "<string>",
"createdDateTime": "2023-11-07T05:31:56Z",
"modifiedDateTime": "2023-11-07T05:31:56Z"
},
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}Authorizations
JWT issued by POST /api/external/token/request. Send as Authorization: Bearer <token>.
Guardhouse API Management subscription key. Required on every request. The same value is used by all API consumers within a region — contact Guardhouse Support for the subscription key.
Path Parameters
Body
application/json
⌘I
Update a subscriber
curl --request PUT \
--url https://gateway-api.guardhousehq.com/api/webhook/subscribers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'external-gh-apim-sub-key: <api-key>' \
--data '
{
"isActive": true,
"rotateSecretToken": true
}
'import requests
url = "https://gateway-api.guardhousehq.com/api/webhook/subscribers/{id}"
payload = {
"isActive": True,
"rotateSecretToken": True
}
headers = {
"Authorization": "Bearer <token>",
"external-gh-apim-sub-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'external-gh-apim-sub-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({isActive: true, rotateSecretToken: true})
};
fetch('https://gateway-api.guardhousehq.com/api/webhook/subscribers/{id}', 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://gateway-api.guardhousehq.com/api/webhook/subscribers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'isActive' => true,
'rotateSecretToken' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"external-gh-apim-sub-key: <api-key>"
],
]);
$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://gateway-api.guardhousehq.com/api/webhook/subscribers/{id}"
payload := strings.NewReader("{\n \"isActive\": true,\n \"rotateSecretToken\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("external-gh-apim-sub-key", "<api-key>")
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.put("https://gateway-api.guardhousehq.com/api/webhook/subscribers/{id}")
.header("Authorization", "Bearer <token>")
.header("external-gh-apim-sub-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"isActive\": true,\n \"rotateSecretToken\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway-api.guardhousehq.com/api/webhook/subscribers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["external-gh-apim-sub-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"isActive\": true,\n \"rotateSecretToken\": true\n}"
response = http.request(request)
puts response.read_body{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": {
"id": 123,
"companyId": 123,
"secretToken": "<string>",
"createdDateTime": "2023-11-07T05:31:56Z",
"modifiedDateTime": "2023-11-07T05:31:56Z"
},
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}