Create a webhook
POST/v1/webhooksScope webhooks
Subscribes an HTTPS URL to request events. The response carries the signing secret once; store it to verify X-Goldmaster-Signature on every delivery.
Request body
Section titled “Request body”| Field | Type | Description |
|---|---|---|
events required |
string[] |
Events to receive. See List webhook events. 1 to 20 items. One of ticket.created, ticket.status_changed, ticket.priority_changed, ticket.comment_added, ticket.attachment_added. |
name required |
string |
Name to recognize the webhook. Unique in the workspace. 2 to 160 characters. |
url required |
string |
HTTPS URL on a public address that receives the deliveries. Up to 1000 characters. A public https URL. |
enabled |
boolean |
Whether deliveries start right away. Default: true. |
{ "name": "ERP sync", "url": "https://erp.example.com/hooks/duty", "events": [ "ticket.created", "ticket.status_changed" ]}Response
Section titled “Response”201 Created · data
| Field | Type | Description |
|---|---|---|
createdAt |
date-time |
When it was created. |
enabled |
boolean |
Whether deliveries are active. |
events |
string[] |
Events the webhook receives. |
id |
integer |
Unique ID. |
name |
string |
Name in the language of Accept-Language. |
secret |
string |
Signing secret. Store it now: it is never shown again. |
updatedAt |
date-time |
When it last changed. |
url |
string |
HTTPS URL that receives the deliveries. |
version |
string |
Payload version the webhook receives. |
{ "data": { "id": 7, "name": "ERP sync", "url": "https://erp.example.com/hooks/duty", "events": [ "ticket.created", "ticket.status_changed" ], "enabled": true, "version": "v1", "secret": "whsec_5b1f0e8c2a9d4e7f8a6b3c1d0e9f2a4b", "createdAt": "2026-12-01T09:00:00Z", "updatedAt": "2026-12-01T09:00:00Z" }}Errors
Section titled “Errors”Errors share one shape; see Errors for every key.
Code examples
Section titled “Code examples”curl -X POST 'https://api.client.service-desk.goldmaster.io/v1/webhooks' \ -H "Authorization: Bearer $DUTY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "ERP sync", "url": "https://erp.example.com/hooks/duty", "events": [ "ticket.created", "ticket.status_changed" ]}'const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/webhooks', { method: 'POST', headers: { Authorization: `Bearer ${process.env.DUTY_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "name": "ERP sync", "url": "https://erp.example.com/hooks/duty", "events": [ "ticket.created", "ticket.status_changed" ] }),});const body = await response.json();if (!response.ok) throw new Error(`${body.error}: ${body.message}`);console.log(body.data);import os
import requests
response = requests.request( "POST", "https://api.client.service-desk.goldmaster.io/v1/webhooks", headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"}, json={ "name": "ERP sync", "url": "https://erp.example.com/hooks/duty", "events": [ "ticket.created", "ticket.status_changed" ] }, timeout=30,)response.raise_for_status()print(response.json()["data"])package main
import ( "fmt" "io" "net/http" "os" "strings")
func main() { payload := strings.NewReader(`{ "name": "ERP sync", "url": "https://erp.example.com/hooks/duty", "events": [ "ticket.created", "ticket.status_changed" ]}`) req, _ := http.NewRequest("POST", "https://api.client.service-desk.goldmaster.io/v1/webhooks", payload) req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY")) req.Header.Set("Content-Type", "application/json") res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() data, _ := io.ReadAll(res.Body) fmt.Println(res.Status, string(data))}<?php$ch = curl_init('https://api.client.service-desk.goldmaster.io/v1/webhooks');curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . getenv('DUTY_API_KEY'), 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => <<<'JSON'{ "name": "ERP sync", "url": "https://erp.example.com/hooks/duty", "events": [ "ticket.created", "ticket.status_changed" ]}JSON,]);$response = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);echo $status, PHP_EOL, $response;using System.Net.Http.Headers;
using var client = new HttpClient();using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.client.service-desk.goldmaster.io/v1/webhooks");request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));request.Content = new StringContent(""" { "name": "ERP sync", "url": "https://erp.example.com/hooks/duty", "events": [ "ticket.created", "ticket.status_changed" ] } """, System.Text.Encoding.UTF8, "application/json");using var response = await client.SendAsync(request);Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");import java.net.URI;import java.net.http.*;
HttpClient client = HttpClient.newHttpClient();HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.client.service-desk.goldmaster.io/v1/webhooks")) .header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY")) .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString(""" { "name": "ERP sync", "url": "https://erp.example.com/hooks/duty", "events": [ "ticket.created", "ticket.status_changed" ] } """)) .build();var response = client.send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.statusCode() + " " + response.body());