This is the abridged developer documentation for Duty
# Quickstart
> Create an API key, find a service and open your first request with the Duty API in five minutes.
import { Steps, Tabs, TabItem, Aside } from '@astrojs/starlight/components';
You will create a key, look up the service to file against, open a request and read it back.
1. **Create an API key.** In the Duty portal go to **Integrations → Keys and webhooks** and select **Create key**. Turn on **Write access** so the key can open requests. Copy the key: it starts with `gm_sd_` and is shown only once.
Keep it in an environment variable rather than in your code:
```sh
export DUTY_API_KEY="gm_sd_…"
```
2. **Find the service.** Every request belongs to a service of your catalog. List them and note the `id` of the one to use:
```sh
curl https://api.client.service-desk.goldmaster.io/v1/services \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```json
{
"data": [
{ "id": 12, "name": "VPN and remote access", "description": "Connection problems and access requests", "defaultPriority": "medium", "requiresApproval": false }
]
}
```
3. **Open the request.** Send the service, a subject, a description and who the request is for:
```sh
curl https://api.client.service-desk.goldmaster.io/v1/tickets \
-H "Authorization: Bearer $DUTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"serviceId": 12,
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes.",
"contact": { "name": "Ana Pérez", "email": "ana.perez@example.com" }
}'
```
```js
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/tickets', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
serviceId: 12,
subject: 'VPN disconnects every few minutes',
description: 'Since this morning the VPN drops every 5 to 10 minutes.',
contact: { name: 'Ana Pérez', email: 'ana.perez@example.com' },
}),
});
const { data: request } = await response.json();
console.log(request.number); // GM-000123
```
```python
import os
import requests
response = requests.post(
"https://api.client.service-desk.goldmaster.io/v1/tickets",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
json={
"serviceId": 12,
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes.",
"contact": {"name": "Ana Pérez", "email": "ana.perez@example.com"},
},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"]["number"]) # GM-000123
```
The API answers `201 Created` with the full request. Its `number` (such as `GM-000123`) identifies it from now on, and `responseDueAt` and `resolutionDueAt` already carry the targets of your service level agreement.
4. **Read it back.** Get the request with its current status and the transitions it can make next:
```sh
curl https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123 \
-H "Authorization: Bearer $DUTY_API_KEY"
```
## What's next
- Keep your system in step with [webhooks](/en/api/webhooks/) instead of polling.
- Sync existing requests with [`updatedSince`](/en/api/guides/sync-requests/).
- Learn the [error format](/en/api/errors/) so your integration can explain what went wrong.
# Authentication
> Authenticate to the Duty API with a workspace API key, choose its scopes and keep it safe.
import { Aside } from '@astrojs/starlight/components';
Every call carries an API key in the `Authorization` header:
```http
Authorization: Bearer gm_sd_…
```
A call without a key, or with a key that is unknown, revoked or expired, answers `401`. See [Errors](/en/api/errors/).
## API keys
Administrators create keys in the Duty portal under **Integrations → Keys and webhooks**. A key:
- **belongs to one workspace** and only reads and changes requests there;
- **is shown once**, when it is created. Duty stores only a digest, so a lost key cannot be recovered: create a new one and revoke the old;
- **can expire** on a date you choose, and **can be revoked** at any moment, which takes effect on the next call;
- shows its prefix (`gm_sd_ab12…`) and when it was last used, so you can tell keys apart without exposing them.
Create one key per integration. If one leaks, you revoke only that one.
## Scopes
A key has one or more scopes. A call that needs a scope the key lacks answers `403` with `API_KEY_SCOPE_MISSING`.
| Scope | Allows |
| --- | --- |
| `read` | Read catalogs, requests, comments and attachments. Every key has it. |
| `write` | Open requests, change their status or priority, comment and upload attachments. |
| `webhooks` | Create, change and delete webhooks, and read their deliveries. |
Each endpoint in the reference shows the scope it needs.
## What else is checked
On every call the API also checks the workspace, not only the key:
- the organization must be **active**;
- its plan must include **API access** (`API_ACCESS_NOT_INCLUDED` otherwise);
- with a payment **more than 7 days overdue**, the API keeps answering reads but refuses changes with `SUBSCRIPTION_READ_ONLY`.
## Keep keys safe
- Call the API from your servers, and read the key from an environment variable or a secret manager.
- Give each key only the scopes it needs: a reporting job needs `read` only.
- Set an expiry date for temporary integrations.
- Revoke keys you no longer use. The portal shows when each key was last used.
# API overview
> What the Duty API does, how it is organized and the conventions every endpoint shares.
import { LinkCard, CardGrid } from '@astrojs/starlight/components';
The Duty API lets your systems work with the requests (tickets) of a Duty workspace: open them from your own forms or monitoring tools, follow their progress, move them through the workflow, and talk to the people working on them. Webhooks push every change back to you, so you never need to poll.
## Base URL
```txt
https://api.client.service-desk.goldmaster.io/v1
```
Every endpoint lives under the version prefix (`/v1`). All traffic is HTTPS; plain HTTP is refused.
## What you can do
| Area | Endpoints | Scope |
| --- | --- | --- |
| [Requests](/en/api/reference/requests/list-requests/) | List and filter, open, read one with its next steps, change status or priority | `read`, `write` |
| [Comments](/en/api/reference/comments/list-comments/) | Read the public conversation and add to it | `read`, `write` |
| [Attachments](/en/api/reference/attachments/list-attachments/) | Upload files to a request and download them | `read`, `write` |
| [Catalogs](/en/api/reference/catalogs/list-services/) | Services, statuses, priorities, departments and locations to build forms | `read` |
| [Webhooks](/en/api/reference/webhooks/list-webhook-events/) | Subscribe URLs to request events and inspect deliveries | `webhooks` |
## Conventions
- **JSON everywhere.** Send `Content-Type: application/json` (attachments use `multipart/form-data`). Responses are UTF-8 JSON.
- **One envelope.** A resource comes as `{ "data": … }`; a list adds `pagination`. See [Requests and responses](/en/api/requests-and-responses/).
- **Times in UTC.** Every timestamp is RFC 3339 in UTC, such as `2026-12-06T14:05:00Z`.
- **Requests are identified by number.** Use the human number (`GM-000123`), the same one agents and requesters see.
- **Your language.** Names of statuses, priorities and services, and error messages, follow `Accept-Language` (`en`, `es`, `fr`, `pt`; English by default).
- **Additive changes only** within a version. Ignore fields you don't know. See [Versioning](/en/api/versioning/).
## Next steps
# Errors
> The error format of the Duty API, its HTTP statuses and every error key with its message.
import ErrorCatalog from '../../../../components/api/ErrorCatalog.astro';
An error answers a `4xx` or `5xx` status and a body with a stable key, a readable message and the ID of the call:
```json
{
"error": "VALIDATION_ERROR",
"message": "Check the data you sent",
"traceId": "4f0c2a9e-6f1d-4c55-9d1e-2b7f3f2c8a10",
"fields": [
{ "field": "contact.email", "message": "Must be a valid email address" },
{ "field": "subject", "message": "Must be at least 3 characters long" }
]
}
```
| Field | Meaning |
| --- | --- |
| `error` | Stable key. Branch on it in your code. |
| `message` | Explanation for people, in the language of `Accept-Language`. It may change; don't parse it. |
| `traceId` | ID of the call, also in the `X-Request-ID` header. Quote it to support. |
| `fields` | Only for validation errors: each invalid field, by its path in the body (`contact.email`), with its message. |
| `data` | Only on some errors: values that help you react, such as the limit that was reached. |
## Handling errors
- **400 and 422**: fix the request. Show `fields` next to your form inputs.
- **401**: the key is missing, wrong, revoked or expired.
- **403**: the key lacks a scope, the plan does not include the API, the subscription is read-only, or a plan limit was reached.
- **404**: the request, attachment or webhook does not exist in this workspace.
- **409**: the request changed meanwhile or is in a state that does not allow the change. Read it again and decide.
- **429**: slow down and retry after `Retry-After` seconds. See [Rate limits](/en/api/rate-limits/).
- **5xx**: retry with exponential backoff. Requests that open a resource are not idempotent: read before retrying a `POST` that may have succeeded.
## Error keys
Validation messages inside `fields` use their own keys (`VALIDATION_REQUIRED`, `VALIDATION_MAX_LENGTH`…); rely on `field` to tell them apart and show `message` as is.
# Build with AI agents
> Give coding agents and LLMs the Duty API docs as llms.txt, Markdown pages and the OpenAPI document, with a prompt to start from.
This documentation is built to be read by coding agents (Claude Code, Cursor, Copilot, Codex…) as well as by people.
## What agents can read
| Resource | URL | Use it for |
| --- | --- | --- |
| `llms.txt` | [`/llms.txt`](/llms.txt) | The index: what Duty is and links to every page. |
| `llms-full.txt` | [`/llms-full.txt`](/llms-full.txt) | Every page of the English docs in one file. |
| `llms-small.txt` | [`/llms-small.txt`](/llms-small.txt) | The same, trimmed for small context windows. |
| OpenAPI 3.1 | [`/openapi/v1.json`](/openapi/v1.json) | The exact contract: paths, parameters, schemas. Generate typed clients from it. |
| Markdown pages | Add `index.md` to any page URL | One topic, without navigation or markup. |
Every page also has **Copy as Markdown** under its title, ready to paste into a chat.
## A prompt to start from
```md
You are integrating with the Duty service desk API (v1).
- Docs: https://docs.client.service-desk.goldmaster.io/llms-full.txt
- OpenAPI: https://docs.client.service-desk.goldmaster.io/openapi/v1.json
- Base URL: https://api.client.service-desk.goldmaster.io/v1
- Auth: `Authorization: Bearer $DUTY_API_KEY`, read from the environment. Never hard-code it.
Rules:
- Responses wrap the payload in `data`; lists add `pagination` (perPage up to 100).
- Identify requests by `number` (e.g. GM-000123). Compare `status.code`, display `status.name`.
- On errors read `error` (stable key) and `fields`; log `traceId`.
- Honor `Retry-After` on 429. Verify webhook signatures over the raw body.
Task:
```
## Generate a typed client
The OpenAPI document works with standard generators:
```sh
# TypeScript types
npx openapi-typescript https://docs.client.service-desk.goldmaster.io/openapi/v1.json -o duty-api.d.ts
# Any language supported by OpenAPI Generator
npx @openapitools/openapi-generator-cli generate \
-i https://docs.client.service-desk.goldmaster.io/openapi/v1.json -g python -o duty-client
```
## Keep agents safe
- Give agents a key with only the scopes the task needs; a key with `read` cannot change anything.
- Let agents read the key from an environment variable, never from the prompt or the code.
- Review any code that sends `PATCH` or `DELETE` before running it against your production workspace.
# Receive webhooks
> Build an endpoint that verifies Duty webhook signatures, rejects replays, deduplicates retries and answers in time.
import { Tabs, TabItem, Aside } from '@astrojs/starlight/components';
Your endpoint must do four things on every delivery: verify the signature over the **raw** body, reject old timestamps, skip events it already processed, and answer `2xx` within 10 seconds. The examples below do exactly that.
The signature is `sha256=` followed by the hex HMAC-SHA256 of the timestamp, a dot and the body:
```txt
X-Goldmaster-Signature = "sha256=" + hex(HMAC_SHA256(secret, X-Goldmaster-Timestamp + "." + rawBody))
```
```js
import crypto from 'node:crypto';
import express from 'express';
const app = express();
const secret = process.env.DUTY_WEBHOOK_SECRET;
const seen = new Set(); // use your database in production
app.post('/hooks/duty', express.raw({ type: 'application/json' }), (req, res) => {
const timestamp = req.get('X-Goldmaster-Timestamp') ?? '';
const signature = req.get('X-Goldmaster-Signature') ?? '';
const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(`${timestamp}.`).update(req.body).digest('hex');
const valid = signature.length === expected.length && crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) <= 300;
if (!valid || !fresh) return res.sendStatus(401);
const key = req.get('Idempotency-Key');
if (seen.has(key)) return res.sendStatus(200);
seen.add(key);
const event = JSON.parse(req.body.toString('utf8'));
queue.push(event); // process after answering
res.sendStatus(200);
});
```
```python
import hashlib
import hmac
import os
import time
from flask import Flask, abort, request
app = Flask(__name__)
SECRET = os.environ["DUTY_WEBHOOK_SECRET"].encode()
seen: set[str] = set() # use your database in production
@app.post("/hooks/duty")
def duty_webhook():
timestamp = request.headers.get("X-Goldmaster-Timestamp", "")
signature = request.headers.get("X-Goldmaster-Signature", "")
body = request.get_data() # raw bytes
expected = "sha256=" + hmac.new(SECRET, f"{timestamp}.".encode() + body, hashlib.sha256).hexdigest()
if not hmac.compare_digest(signature, expected) or abs(time.time() - int(timestamp or 0)) > 300:
abort(401)
key = request.headers["Idempotency-Key"]
if key in seen:
return "", 200
seen.add(key)
queue.put(request.get_json()) # process after answering
return "", 200
```
```go
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"io"
"math"
"net/http"
"os"
"strconv"
"time"
)
var secret = []byte(os.Getenv("DUTY_WEBHOOK_SECRET"))
func dutyWebhook(w http.ResponseWriter, r *http.Request) {
body, err := io.ReadAll(io.LimitReader(r.Body, 1<<20))
if err != nil {
http.Error(w, "bad body", http.StatusBadRequest)
return
}
timestamp := r.Header.Get("X-Goldmaster-Timestamp")
mac := hmac.New(sha256.New, secret)
mac.Write([]byte(timestamp + "."))
mac.Write(body)
expected := "sha256=" + hex.EncodeToString(mac.Sum(nil))
sent, _ := strconv.ParseInt(timestamp, 10, 64)
fresh := math.Abs(float64(time.Now().Unix()-sent)) <= 300
if !hmac.Equal([]byte(r.Header.Get("X-Goldmaster-Signature")), []byte(expected)) || !fresh {
http.Error(w, "invalid signature", http.StatusUnauthorized)
return
}
if alreadyProcessed(r.Header.Get("Idempotency-Key")) {
w.WriteHeader(http.StatusOK)
return
}
enqueue(body) // process after answering
w.WriteHeader(http.StatusOK)
}
```
```php
300) {
http_response_code(401);
exit;
}
$key = $_SERVER['HTTP_IDEMPOTENCY_KEY'];
if (!already_processed($key)) {
enqueue(json_decode($body, true)); // process after answering
}
http_response_code(200);
```
```csharp
using System.Security.Cryptography;
using System.Text;
app.MapPost("/hooks/duty", async (HttpRequest request) =>
{
var secret = Encoding.UTF8.GetBytes(Environment.GetEnvironmentVariable("DUTY_WEBHOOK_SECRET")!);
using var buffer = new MemoryStream();
await request.Body.CopyToAsync(buffer);
var body = buffer.ToArray(); // raw bytes
var timestamp = request.Headers["X-Goldmaster-Timestamp"].ToString();
var signed = Encoding.UTF8.GetBytes(timestamp + ".").Concat(body).ToArray();
var expected = "sha256=" + Convert.ToHexString(HMACSHA256.HashData(secret, signed)).ToLowerInvariant();
var provided = request.Headers["X-Goldmaster-Signature"].ToString();
var fresh = long.TryParse(timestamp, out var sent) && Math.Abs(DateTimeOffset.UtcNow.ToUnixTimeSeconds() - sent) <= 300;
if (!fresh || !CryptographicOperations.FixedTimeEquals(Encoding.UTF8.GetBytes(provided), Encoding.UTF8.GetBytes(expected)))
return Results.Unauthorized();
var key = request.Headers["Idempotency-Key"].ToString();
if (!await AlreadyProcessed(key)) Enqueue(body); // process after answering
return Results.Ok();
});
```
```java
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.HexFormat;
public final class DutySignature {
private static final byte[] SECRET = System.getenv("DUTY_WEBHOOK_SECRET").getBytes(StandardCharsets.UTF_8);
/** True when the delivery is authentic and less than five minutes old. */
public static boolean verify(String timestamp, String signature, byte[] rawBody) throws Exception {
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(SECRET, "HmacSHA256"));
mac.update((timestamp + ".").getBytes(StandardCharsets.UTF_8));
String expected = "sha256=" + HexFormat.of().formatHex(mac.doFinal(rawBody));
long age = Math.abs(System.currentTimeMillis() / 1000 - Long.parseLong(timestamp));
return age <= 300 && MessageDigest.isEqual(
expected.getBytes(StandardCharsets.UTF_8),
signature.getBytes(StandardCharsets.UTF_8));
}
}
```
```ruby
require "openssl"
require "rack/utils"
require "sinatra"
SECRET = ENV.fetch("DUTY_WEBHOOK_SECRET")
post "/hooks/duty" do
body = request.body.read # raw bytes
timestamp = request.env["HTTP_X_GOLDMASTER_TIMESTAMP"].to_s
signature = request.env["HTTP_X_GOLDMASTER_SIGNATURE"].to_s
expected = "sha256=" + OpenSSL::HMAC.hexdigest("SHA256", SECRET, "#{timestamp}.#{body}")
halt 401 unless Rack::Utils.secure_compare(expected, signature) && (Time.now.to_i - timestamp.to_i).abs <= 300
key = request.env["HTTP_IDEMPOTENCY_KEY"]
enqueue(JSON.parse(body)) unless already_processed?(key) # process after answering
status 200
end
```
## Test it
1. Expose your endpoint over HTTPS with a public address (in development, a tunnel such as `cloudflared` or `ngrok`).
2. [Create a webhook](/en/api/reference/webhooks/create-a-webhook/) pointing to it and keep the `secret`.
3. Open a request or comment on one in the portal. Within a few seconds the delivery reaches you.
4. Check what happened with [List deliveries](/en/api/reference/webhooks/list-webhook-deliveries/): status, attempts, the response code you returned and the last error.
# Sync requests
> Keep a copy of your Duty requests up to date with incremental reads using updatedSince, without reading everything again.
import { Tabs, TabItem } from '@astrojs/starlight/components';
To keep requests in a data warehouse, a CRM or a reporting tool, read only what changed since your last run with `updatedSince`.
## The loop
1. Remember a **cursor**: the time your last successful sync **started**, in UTC.
2. Ask for the requests changed since then, page by page, at most 100 per page.
3. Upsert each one by its `number`.
4. When every page is stored, move the cursor to the start time of this run.
Starting the next window at the start of the previous run, not at its end, means a request changed while you were reading is fetched again next time instead of being missed. Upserting by `number` makes the overlap harmless.
```js
const BASE_URL = 'https://api.client.service-desk.goldmaster.io/v1';
const headers = { Authorization: `Bearer ${process.env.DUTY_API_KEY}` };
export async function syncRequests(cursor, save) {
const startedAt = new Date().toISOString();
for (let page = 1; ; page++) {
const params = new URLSearchParams({ updatedSince: cursor, perPage: '100', page: String(page) });
const response = await fetch(`${BASE_URL}/tickets?${params}`, { headers });
if (!response.ok) throw new Error(`Duty API ${response.status}: ${(await response.json()).message}`);
const { data, pagination } = await response.json();
for (const request of data) await save(request); // upsert by request.number
if (page >= pagination.totalPages) break;
}
return startedAt; // the next cursor
}
```
```python
import os
from datetime import datetime, timezone
import requests
BASE_URL = "https://api.client.service-desk.goldmaster.io/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"}
def sync_requests(cursor: str, save) -> str:
started_at = datetime.now(timezone.utc).isoformat(timespec="seconds").replace("+00:00", "Z")
page = 1
while True:
response = requests.get(
f"{BASE_URL}/tickets",
headers=HEADERS,
params={"updatedSince": cursor, "perPage": 100, "page": page},
timeout=30,
)
response.raise_for_status()
body = response.json()
for request in body["data"]:
save(request) # upsert by request["number"]
if page >= body["pagination"]["totalPages"]:
return started_at # the next cursor
page += 1
```
## The first run
For the initial load, use a cursor far in the past, such as `2020-01-01T00:00:00Z`, or narrow it with `createdFrom`. Large histories take a few minutes: 120 calls per minute read up to 12,000 requests.
## Combine with webhooks
Webhooks bring changes within seconds; a sync every hour or so catches anything your endpoint missed while it was down. Both write through the same upsert, so the result is the same whichever arrives first.
## Filters you can add
| Parameter | Example | Narrows to |
| --- | --- | --- |
| `status` | `open,in_progress` | Requests in these status codes. |
| `priority` | `high,critical` | Requests with these priorities. |
| `serviceId` | `12` | One service. |
| `contactEmail` | `ana.perez@example.com` | One requester. |
| `q` | `VPN` | Text in the number or the subject. |
| `createdFrom`, `createdTo` | `2026-12-01T00:00:00Z` | A creation window. |
See [List requests](/en/api/reference/requests/list-requests/) for every parameter.
# Rate limits
> How many calls a Duty API key can make per minute, the headers that report it, and how to back off.
Each API key can make **120 requests per minute** by default. The window is per key, so two integrations with their own keys never slow each other down.
Every response reports where you stand:
| Header | Meaning |
| --- | --- |
| `RateLimit-Limit` | Requests allowed per window. |
| `RateLimit-Remaining` | Requests left in the current window. |
| `RateLimit-Reset` | Seconds until the window resets. |
Over the limit, the API answers `429 Too Many Requests` with `RATE_LIMITED` and a `Retry-After` header with the seconds to wait:
```http
HTTP/1.1 429 Too Many Requests
Retry-After: 18
RateLimit-Limit: 120
RateLimit-Remaining: 0
RateLimit-Reset: 18
```
## Staying under the limit
- **Use webhooks** instead of polling for changes. See [Webhooks](/en/api/webhooks/).
- **Sync incrementally** with `updatedSince` instead of reading every page again. See [Sync requests](/en/api/guides/sync-requests/).
- **Cache catalogs.** Services, statuses and priorities rarely change; refresh them every few hours.
- **Honor `Retry-After`**, then resume at a steady pace rather than in a burst.
```js
async function callDuty(url, init) {
for (let attempt = 0; attempt < 5; attempt++) {
const response = await fetch(url, init);
if (response.status !== 429) return response;
const wait = Number(response.headers.get('Retry-After') ?? 1);
await new Promise((resolve) => setTimeout(resolve, wait * 1000));
}
throw new Error('Duty API rate limit: gave up after 5 attempts');
}
```
Need a higher limit for a large migration? Contact Gold Master support with your workspace and the expected volume.
# Download an attachment
> The content of an attachment, as a file.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
The content of an attachment, as a file.
## Path parameters
| Name | Type | Description |
| --- | --- | --- |
| `number` **required** | `string` | Request number, such as `GM-000123`. |
| `attachmentId` **required** | `string` | ID of the attachment, from List attachments. |
## Response
`200 OK`. The response is the file itself, with its Content-Type and a Content-Disposition attachment header.
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments/88/content' \
-H "Authorization: Bearer $DUTY_API_KEY" \
-o attachment.bin
```
```javascript
import { writeFile } from 'node:fs/promises';
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments/88/content', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
if (!response.ok) throw new Error(`Duty API ${response.status}`);
await writeFile('attachment.bin', Buffer.from(await response.arrayBuffer()));
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments/88/content",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
with open("attachment.bin", "wb") as file:
file.write(response.content)
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments/88/content", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
os.WriteFile("attachment.bin", data, 0o644)
fmt.Println(res.Status)
}
```
```php
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
file_put_contents('attachment.bin', $response);
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments/88/content");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
await File.WriteAllBytesAsync("attachment.bin", await response.Content.ReadAsByteArrayAsync());
```
```java
import java.net.URI;
import java.net.http.*;
import java.nio.file.*;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments/88/content"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofFile(Path.of("attachment.bin")));
System.out.println(response.statusCode() + " " + response.body());
```
# List attachments
> Files attached to a request and to its public comments.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
Files attached to a request and to its public comments.
## Path parameters
| Name | Type | Description |
| --- | --- | --- |
| `number` **required** | `string` | Request number, such as `GM-000123`. |
## Response
`200 OK` · `data[]`
| Field | Type | Description |
| --- | --- | --- |
| `contentType` | `string` | MIME type detected from the content. |
| `createdAt` | `date-time` | When it was created. |
| `fileName` | `string` | File name. |
| `id` | `integer` | Unique ID. |
| `sizeBytes` | `integer` | Size in bytes. |
```json title="Example"
{
"data": [
{
"id": 88,
"fileName": "vpn-client.log",
"contentType": "text/plain",
"sizeBytes": 48213,
"createdAt": "2026-12-06T14:30:00Z"
}
]
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/tickets/GM-000123/attachments"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# Upload an attachment
> Attaches a file to a request.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
Attaches a file to a request. Send it as `multipart/form-data` in the `file` field. The type is read from the content and must match the file's extension; the workspace may narrow the accepted types and size.
## Path parameters
| Name | Type | Description |
| --- | --- | --- |
| `number` **required** | `string` | Request number, such as `GM-000123`. |
## Multipart form
| Field | Type | Description |
| --- | --- | --- |
| `file` **required** | `file` | Up to 10 MB. Accepted: `.pdf`, `.png`, `.jpg`, `.jpeg`, `.txt`, `.zip`. |
## Response
`201 Created` · `data`
| Field | Type | Description |
| --- | --- | --- |
| `contentType` | `string` | MIME type detected from the content. |
| `createdAt` | `date-time` | When it was created. |
| `fileName` | `string` | File name. |
| `id` | `integer` | Unique ID. |
| `sizeBytes` | `integer` | Size in bytes. |
```json title="Example"
{
"data": {
"id": 88,
"fileName": "vpn-client.log",
"contentType": "text/plain",
"sizeBytes": 48213,
"createdAt": "2026-12-06T14:30:00Z"
}
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl -X POST 'https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments' \
-H "Authorization: Bearer $DUTY_API_KEY" \
-F "file=@report.pdf"
```
```javascript
import { openAsBlob } from 'node:fs';
const form = new FormData();
form.append('file', await openAsBlob('report.pdf'), 'report.pdf');
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
body: form,
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"POST",
"https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
files={"file": open("report.pdf", "rb")},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"bytes"
"fmt"
"io"
"mime/multipart"
"net/http"
"os"
)
func main() {
var payload bytes.Buffer
form := multipart.NewWriter(&payload)
part, _ := form.CreateFormFile("file", "report.pdf")
content, _ := os.ReadFile("report.pdf")
part.Write(content)
form.Close()
req, _ := http.NewRequest("POST", "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments", &payload)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
req.Header.Set("Content-Type", form.FormDataContentType())
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
'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
CURLOPT_POSTFIELDS => ['file' => new CURLFile('report.pdf')],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
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/tickets/GM-000123/attachments");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
var form = new MultipartFormDataContent();
form.Add(new ByteArrayContent(File.ReadAllBytes("report.pdf")), "file", "report.pdf");
request.Content = form;
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
import java.net.URI;
import java.net.http.*;
import java.nio.file.*;
import java.util.List;
HttpClient client = HttpClient.newHttpClient();
String boundary = "duty-" + System.nanoTime();
byte[] file = Files.readAllBytes(Path.of("report.pdf"));
String head = "--" + boundary + "\r\nContent-Disposition: form-data; name=\"file\"; filename=\"report.pdf\"\r\n\r\n";
String tail = "\r\n--" + boundary + "--\r\n";
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/attachments"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.header("Content-Type", "multipart/form-data; boundary=" + boundary)
.method("POST", HttpRequest.BodyPublishers.ofByteArrays(List.of(head.getBytes(), file, tail.getBytes())))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# List departments
> Active departments of the organization, to set contact.departmentId when you open a request.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
Active departments of the organization, to set `contact.departmentId` when you open a request.
## Response
`200 OK` · `data[]`
| Field | Type | Description |
| --- | --- | --- |
| `code` | `string` | Stable code. Compare against it in your code. |
| `id` | `integer` | Unique ID. |
| `name` | `string` | Name in the language of `Accept-Language`. |
| `parentId` | `integer` | Parent department, if any. |
| `path` | `string` | Full path from the top of the hierarchy. |
```json title="Example"
{
"data": [
{
"id": 4,
"name": "Sales",
"code": "SLS",
"parentId": 1,
"path": "Commercial / Sales"
}
]
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/departments' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/departments', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/departments",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/departments", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/departments");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/departments"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# List locations
> Active locations of the organization, to set contact.locationId when you open a request.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
Active locations of the organization, to set `contact.locationId` when you open a request.
## Response
`200 OK` · `data[]`
| Field | Type | Description |
| --- | --- | --- |
| `city` | `string` | City. |
| `code` | `string` | Stable code. Compare against it in your code. |
| `countryCode` | `string` | ISO 3166-1 country code. |
| `id` | `integer` | Unique ID. |
| `name` | `string` | Name in the language of `Accept-Language`. |
| `parentId` | `integer` | Parent location, if any. |
| `path` | `string` | Full path from the top of the hierarchy. |
| `timezone` | `string` | IANA time zone. |
| `type` | `string` | Kind of location, such as `office` or `site`. |
```json title="Example"
{
"data": [
{
"id": 2,
"name": "Santo Domingo HQ",
"code": "SDQ-HQ",
"type": "office",
"city": "Santo Domingo",
"countryCode": "DO",
"timezone": "America/Santo_Domingo",
"parentId": 1,
"path": "Dominican Republic / Santo Domingo HQ"
}
]
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/locations' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/locations', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/locations",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/locations", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/locations");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/locations"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# List priorities
> The priorities a request can have, with their names in your language.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
The priorities a request can have, with their names in your language.
## Response
`200 OK` · `data[]`
| Field | Type | Description |
| --- | --- | --- |
| `code` | `string` | Stable code. Compare against it in your code. One of `low`, `medium`, `high`, `critical`, `planned`. |
| `name` | `string` | Name in the language of `Accept-Language`. |
```json title="Example"
{
"data": [
{
"code": "high",
"name": "High"
}
]
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/priorities' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/priorities', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/priorities",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/priorities", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/priorities");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/priorities"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# List services
> Services requests can be opened against: active, published and available to the workspace.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
Services requests can be opened against: active, published and available to the workspace. Use their `id` as `serviceId` when you open a request.
## Response
`200 OK` · `data[]`
| Field | Type | Description |
| --- | --- | --- |
| `category` | `object` | Category of the catalog the service belongs to. |
| `category.id` | `integer` | Unique ID. |
| `category.name` | `string` | Name in the language of `Accept-Language`. |
| `defaultPriority` | `string` | Priority used when impact and urgency don't decide one. |
| `description` | `string` | Description. |
| `id` | `integer` | Unique ID. |
| `name` | `string` | Name in the language of `Accept-Language`. |
| `requiresApproval` | `boolean` | Requests wait for an approval before work starts. |
```json title="Example"
{
"data": [
{
"id": 12,
"name": "VPN and remote access",
"description": "Connection problems and access requests for the corporate VPN.",
"category": {
"id": 3,
"name": "Networks"
},
"defaultPriority": "medium",
"requiresApproval": false
}
]
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/services' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/services', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/services",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/services", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/services");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/services"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# List statuses
> The workflow statuses of the workspace, in board order.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
The workflow statuses of the workspace, in board order. Each workspace defines its own; rely on the flags (`initial`, `resolved`, `closed`) rather than on specific codes.
## Response
`200 OK` · `data[]`
| Field | Type | Description |
| --- | --- | --- |
| `closed` | `boolean` | The request is closed in this status. |
| `code` | `string` | Stable code. Compare against it in your code. |
| `color` | `string` | Color of the status on the board, as hex. |
| `description` | `string` | Description. |
| `initial` | `boolean` | New requests start in this status. |
| `name` | `string` | Name in the language of `Accept-Language`. |
| `pausesSla` | `boolean` | Service level clocks stop while the request is in this status. |
| `position` | `integer` | Order on the board, from left to right. |
| `resolved` | `boolean` | The request counts as resolved in this status. |
```json title="Example"
{
"data": [
{
"code": "in_progress",
"name": "In progress",
"description": "An agent is working on it.",
"color": "#2457ff",
"position": 2,
"initial": false,
"resolved": false,
"closed": false,
"pausesSla": false
}
]
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/statuses' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/statuses', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/statuses",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/statuses", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/statuses");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/statuses"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# Add a comment
> Adds a public comment to a request on behalf of your integration.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
Adds a public comment to a request on behalf of your integration. The assigned agents are notified as for any reply.
## Path parameters
| Name | Type | Description |
| --- | --- | --- |
| `number` **required** | `string` | Request number, such as `GM-000123`. |
## Request body
| Field | Type | Description |
| --- | --- | --- |
| `body` **required** | `string` | Text of the comment. Plain text; line breaks are kept. 1 to 20000 characters. |
```json title="Example"
{
"body": "The issue is back after the restart. Attaching the client log."
}
```
## Response
`201 Created` · `data`
| Field | Type | Description |
| --- | --- | --- |
| `author` | `object` | Who wrote it. |
| `author.name` | `string` | Name in the language of `Accept-Language`. |
| `author.type` | `string` | One of `agent`, `contact`, `integration`. |
| `body` | `string` | Text of the comment. |
| `createdAt` | `date-time` | When it was created. |
| `id` | `integer` | Unique ID. |
```json title="Example"
{
"data": {
"id": 512,
"body": "We replaced the VPN profile. Can you confirm it holds?",
"author": {
"type": "agent",
"name": "Luis Gómez"
},
"createdAt": "2026-12-06T15:40:00Z"
}
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl -X POST 'https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments' \
-H "Authorization: Bearer $DUTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"body": "The issue is back after the restart. Attaching the client log."
}'
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"body": "The issue is back after the restart. Attaching the client log."
}),
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"POST",
"https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
json={
"body": "The issue is back after the restart. Attaching the client log."
},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
payload := strings.NewReader(`{
"body": "The issue is back after the restart. Attaching the client log."
}`)
req, _ := http.NewRequest("POST", "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments", 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
'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => <<<'JSON'
{
"body": "The issue is back after the restart. Attaching the client log."
}
JSON,
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
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/tickets/GM-000123/comments");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
request.Content = new StringContent("""
{
"body": "The issue is back after the restart. Attaching the client log."
}
""", System.Text.Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/tickets/GM-000123/comments"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"body": "The issue is back after the restart. Attaching the client log."
}
"""))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# List comments
> The public conversation of a request, oldest first.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
The public conversation of a request, oldest first. Internal notes between agents are never returned.
## Path parameters
| Name | Type | Description |
| --- | --- | --- |
| `number` **required** | `string` | Request number, such as `GM-000123`. |
## Query parameters
| Name | Type | Description |
| --- | --- | --- |
| `page` | `integer` | Page to return, from 1. At least 1. Default: `1`. |
| `perPage` | `integer` | Items per page. From 1 to 100. Default: `25`. |
## Response
`200 OK` · `data[]` + `pagination`
| Field | Type | Description |
| --- | --- | --- |
| `author` | `object` | Who wrote it. |
| `author.name` | `string` | Name in the language of `Accept-Language`. |
| `author.type` | `string` | One of `agent`, `contact`, `integration`. |
| `body` | `string` | Text of the comment. |
| `createdAt` | `date-time` | When it was created. |
| `id` | `integer` | Unique ID. |
```json title="Example"
{
"data": [
{
"id": 512,
"body": "We replaced the VPN profile. Can you confirm it holds?",
"author": {
"type": "agent",
"name": "Luis Gómez"
},
"createdAt": "2026-12-06T15:40:00Z"
}
],
"pagination": {
"page": 1,
"perPage": 25,
"total": 1,
"totalPages": 1
}
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/tickets/GM-000123/comments"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# Get a request
> One request by its number, with transitions: the statuses it can move to next and what each move requires.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
One request by its number, with `transitions`: the statuses it can move to next and what each move requires.
## Path parameters
| Name | Type | Description |
| --- | --- | --- |
| `number` **required** | `string` | Request number, such as `GM-000123`. |
## Response
`200 OK` · `data`
| Field | Type | Description |
| --- | --- | --- |
| `channel` | `string` | Where the request came from: `api`, `portal`, `email`… |
| `closedAt` | `date-time` | When the request was closed. |
| `closureCode` | `string` | Closure code, recorded when it was closed. |
| `contact` | `object` | Who the request is for. |
| `contact.departmentId` | `integer` | Department, from List departments. |
| `contact.email` | `string` | Email address. Duty notifies this contact about the request. |
| `contact.locationId` | `integer` | Location, from List locations. |
| `contact.name` | `string` | Full name. |
| `contact.phone` | `string` | Phone number. |
| `createdAt` | `date-time` | When it was created. |
| `description` | `string` | Description. |
| `firstResponseAt` | `date-time` | When an agent first responded. |
| `impact` | `integer` | How many people or how much business it affects, from 1 (low) to 3 (high). |
| `impactTags` | `string[]` | Business impact markers: `executive`, `regulatory`, `financial`, `security`, `continuity`. |
| `number` | `string` | Request number, such as `GM-000123`. Unique within the organization. |
| `pendingPriority` | `object` | Priority raise waiting for a supervisor's approval. |
| `pendingPriority.code` | `string` | Requested priority code. |
| `pendingPriority.name` | `string` | Requested priority name. |
| `priority` | `object` | Current priority. |
| `priority.code` | `string` | Priority code: `low`, `medium`, `high`, `critical` or `planned`. |
| `priority.name` | `string` | Priority name. |
| `resolution` | `string` | The solution applied, recorded when it was resolved. |
| `resolutionDueAt` | `date-time` | Deadline for the resolution, from the service level agreement. |
| `resolvedAt` | `date-time` | When the request was resolved. |
| `responseDueAt` | `date-time` | Deadline for the first response, from the service level agreement. |
| `service` | `object` | Service of the catalog the request belongs to. |
| `service.id` | `integer` | Service ID. |
| `service.name` | `string` | Service name. |
| `status` | `object` | Current status. |
| `status.code` | `string` | Status code, such as `in_progress`. |
| `status.name` | `string` | Status name. |
| `subject` | `string` | Short summary of the request. |
| `transitions` | `object[]` | Statuses the request can move to next. |
| `transitions[].requiresClosureCode` | `boolean` | Send `closureCode` with this move. |
| `transitions[].requiresReason` | `boolean` | Send `note` (at least 3 characters) with this move. |
| `transitions[].requiresResolution` | `boolean` | Send `resolution` (at least 3 characters) with this move. |
| `transitions[].to` | `object` | Target status. |
| `transitions[].to.code` | `string` | Target status code. Send it as `status` to Update a request. |
| `transitions[].to.name` | `string` | Target status name. |
| `updatedAt` | `date-time` | When it last changed. |
| `urgency` | `integer` | How soon it needs attention, from 1 (low) to 3 (high). |
```json title="Example"
{
"data": {
"number": "GM-000123",
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes for the whole sales team.",
"status": {
"code": "in_progress",
"name": "In progress"
},
"priority": {
"code": "high",
"name": "High"
},
"impact": 3,
"urgency": 2,
"impactTags": [
"continuity"
],
"channel": "api",
"service": {
"id": 12,
"name": "VPN and remote access"
},
"contact": {
"name": "Ana Pérez",
"email": "ana.perez@example.com",
"phone": "+1 809 555 0142",
"departmentId": 4,
"locationId": 2
},
"responseDueAt": "2026-12-06T15:05:00Z",
"resolutionDueAt": "2026-12-06T22:05:00Z",
"firstResponseAt": "2026-12-06T14:21:00Z",
"createdAt": "2026-12-06T14:05:00Z",
"updatedAt": "2026-12-06T14:21:00Z",
"transitions": [
{
"to": {
"code": "waiting_customer",
"name": "Waiting for customer"
},
"requiresReason": true,
"requiresResolution": false,
"requiresClosureCode": false
},
{
"to": {
"code": "resolved",
"name": "Resolved"
},
"requiresReason": false,
"requiresResolution": true,
"requiresClosureCode": false
}
]
}
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/tickets/GM-000123"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# List requests
> Requests of the workspace, most recently created first.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
Requests of the workspace, most recently created first. Combine filters to narrow the list, and use `updatedSince` to sync only what changed since your last read.
## Query parameters
| Name | Type | Description |
| --- | --- | --- |
| `page` | `integer` | Page to return, from 1. At least 1. Default: `1`. |
| `perPage` | `integer` | Items per page. From 1 to 100. Default: `25`. |
| `status` | `string` | Only requests in these status codes, comma-separated. See List statuses. Comma-separated list. |
| `priority` | `string` | Only requests with these priority codes, comma-separated. Comma-separated list. One of `low`, `medium`, `high`, `critical`, `planned`. |
| `serviceId` | `integer` | Only requests of this service. |
| `contactEmail` | `string` | Only requests of this contact. Up to 320 characters. An email address. |
| `q` | `string` | Text to find in the request number or subject. Up to 120 characters. |
| `createdFrom` | `string` | Only requests created at or after this time. RFC 3339 date and time, such as `2026-12-06T10:00:00Z`. |
| `createdTo` | `string` | Only requests created before this time. RFC 3339 date and time, such as `2026-12-06T10:00:00Z`. |
| `updatedSince` | `string` | Only requests changed at or after this time. Use it to sync incrementally. RFC 3339 date and time, such as `2026-12-06T10:00:00Z`. |
## Response
`200 OK` · `data[]` + `pagination`
| Field | Type | Description |
| --- | --- | --- |
| `channel` | `string` | Where the request came from: `api`, `portal`, `email`… |
| `closedAt` | `date-time` | When the request was closed. |
| `closureCode` | `string` | Closure code, recorded when it was closed. |
| `contact` | `object` | Who the request is for. |
| `contact.departmentId` | `integer` | Department, from List departments. |
| `contact.email` | `string` | Email address. Duty notifies this contact about the request. |
| `contact.locationId` | `integer` | Location, from List locations. |
| `contact.name` | `string` | Full name. |
| `contact.phone` | `string` | Phone number. |
| `createdAt` | `date-time` | When it was created. |
| `description` | `string` | Description. |
| `firstResponseAt` | `date-time` | When an agent first responded. |
| `impact` | `integer` | How many people or how much business it affects, from 1 (low) to 3 (high). |
| `impactTags` | `string[]` | Business impact markers: `executive`, `regulatory`, `financial`, `security`, `continuity`. |
| `number` | `string` | Request number, such as `GM-000123`. Unique within the organization. |
| `pendingPriority` | `object` | Priority raise waiting for a supervisor's approval. |
| `pendingPriority.code` | `string` | Requested priority code. |
| `pendingPriority.name` | `string` | Requested priority name. |
| `priority` | `object` | Current priority. |
| `priority.code` | `string` | Priority code: `low`, `medium`, `high`, `critical` or `planned`. |
| `priority.name` | `string` | Priority name. |
| `resolution` | `string` | The solution applied, recorded when it was resolved. |
| `resolutionDueAt` | `date-time` | Deadline for the resolution, from the service level agreement. |
| `resolvedAt` | `date-time` | When the request was resolved. |
| `responseDueAt` | `date-time` | Deadline for the first response, from the service level agreement. |
| `service` | `object` | Service of the catalog the request belongs to. |
| `service.id` | `integer` | Service ID. |
| `service.name` | `string` | Service name. |
| `status` | `object` | Current status. |
| `status.code` | `string` | Status code, such as `in_progress`. |
| `status.name` | `string` | Status name. |
| `subject` | `string` | Short summary of the request. |
| `updatedAt` | `date-time` | When it last changed. |
| `urgency` | `integer` | How soon it needs attention, from 1 (low) to 3 (high). |
```json title="Example"
{
"data": [
{
"number": "GM-000123",
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes for the whole sales team.",
"status": {
"code": "in_progress",
"name": "In progress"
},
"priority": {
"code": "high",
"name": "High"
},
"impact": 3,
"urgency": 2,
"impactTags": [
"continuity"
],
"channel": "api",
"service": {
"id": 12,
"name": "VPN and remote access"
},
"contact": {
"name": "Ana Pérez",
"email": "ana.perez@example.com",
"phone": "+1 809 555 0142",
"departmentId": 4,
"locationId": 2
},
"responseDueAt": "2026-12-06T15:05:00Z",
"resolutionDueAt": "2026-12-06T22:05:00Z",
"firstResponseAt": "2026-12-06T14:21:00Z",
"createdAt": "2026-12-06T14:05:00Z",
"updatedAt": "2026-12-06T14:21:00Z"
}
],
"pagination": {
"page": 1,
"perPage": 25,
"total": 1,
"totalPages": 1
}
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/tickets?perPage=10&status=open%2Cin_progress' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/tickets?perPage=10&status=open%2Cin_progress', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/tickets?perPage=10&status=open%2Cin_progress",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/tickets?perPage=10&status=open%2Cin_progress", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/tickets?perPage=10&status=open%2Cin_progress");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/tickets?perPage=10&status=open%2Cin_progress"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# Open a request
> Opens a request on a service of the catalog for a contact.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
Opens a request on a service of the catalog for a contact. Duty calculates its priority from impact and urgency, sets the service level targets and runs the workspace's routing, approvals and notifications, exactly as for a request opened in the portal.
## Request body
| Field | Type | Description |
| --- | --- | --- |
| `contact` **required** | `object` | Who the request is for. Duty notifies this person about its progress. |
| `contact.departmentId` | `integer` | Department, from List departments. |
| `contact.email` **required** | `string` | Email address. Duty notifies this contact about the request. Up to 320 characters. An email address. |
| `contact.locationId` | `integer` | Location, from List locations. |
| `contact.name` **required** | `string` | Full name. 2 to 200 characters. |
| `contact.phone` | `string` | Phone number. Up to 40 characters. |
| `description` **required** | `string` | Everything the agent needs to start: what happens, since when, what was tried. 3 to 20000 characters. |
| `serviceId` **required** | `integer` | Service to open the request on, from List services. |
| `subject` **required** | `string` | Short summary that agents see in their queue. 3 to 220 characters. |
| `impact` | `integer` | How many people or how much business it affects, from 1 (low) to 3 (high). From 1 to 3. Default: `2`. |
| `impactTags` | `string[]` | Business impact markers that can raise the priority. Up to 5 items. One of `executive`, `regulatory`, `financial`, `security`, `continuity`. |
| `urgency` | `integer` | How soon it needs attention, from 1 (low) to 3 (high). From 1 to 3. Default: `2`. |
```json title="Example"
{
"serviceId": 12,
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes for the whole sales team.",
"impact": 3,
"urgency": 2,
"contact": {
"name": "Ana Pérez",
"email": "ana.perez@example.com",
"phone": "+1 809 555 0142"
}
}
```
## Response
`201 Created` · `data`
| Field | Type | Description |
| --- | --- | --- |
| `channel` | `string` | Where the request came from: `api`, `portal`, `email`… |
| `closedAt` | `date-time` | When the request was closed. |
| `closureCode` | `string` | Closure code, recorded when it was closed. |
| `contact` | `object` | Who the request is for. |
| `contact.departmentId` | `integer` | Department, from List departments. |
| `contact.email` | `string` | Email address. Duty notifies this contact about the request. |
| `contact.locationId` | `integer` | Location, from List locations. |
| `contact.name` | `string` | Full name. |
| `contact.phone` | `string` | Phone number. |
| `createdAt` | `date-time` | When it was created. |
| `description` | `string` | Description. |
| `firstResponseAt` | `date-time` | When an agent first responded. |
| `impact` | `integer` | How many people or how much business it affects, from 1 (low) to 3 (high). |
| `impactTags` | `string[]` | Business impact markers: `executive`, `regulatory`, `financial`, `security`, `continuity`. |
| `number` | `string` | Request number, such as `GM-000123`. Unique within the organization. |
| `pendingPriority` | `object` | Priority raise waiting for a supervisor's approval. |
| `pendingPriority.code` | `string` | Requested priority code. |
| `pendingPriority.name` | `string` | Requested priority name. |
| `priority` | `object` | Current priority. |
| `priority.code` | `string` | Priority code: `low`, `medium`, `high`, `critical` or `planned`. |
| `priority.name` | `string` | Priority name. |
| `resolution` | `string` | The solution applied, recorded when it was resolved. |
| `resolutionDueAt` | `date-time` | Deadline for the resolution, from the service level agreement. |
| `resolvedAt` | `date-time` | When the request was resolved. |
| `responseDueAt` | `date-time` | Deadline for the first response, from the service level agreement. |
| `service` | `object` | Service of the catalog the request belongs to. |
| `service.id` | `integer` | Service ID. |
| `service.name` | `string` | Service name. |
| `status` | `object` | Current status. |
| `status.code` | `string` | Status code, such as `in_progress`. |
| `status.name` | `string` | Status name. |
| `subject` | `string` | Short summary of the request. |
| `transitions` | `object[]` | Statuses the request can move to next. |
| `transitions[].requiresClosureCode` | `boolean` | Send `closureCode` with this move. |
| `transitions[].requiresReason` | `boolean` | Send `note` (at least 3 characters) with this move. |
| `transitions[].requiresResolution` | `boolean` | Send `resolution` (at least 3 characters) with this move. |
| `transitions[].to` | `object` | Target status. |
| `transitions[].to.code` | `string` | Target status code. Send it as `status` to Update a request. |
| `transitions[].to.name` | `string` | Target status name. |
| `updatedAt` | `date-time` | When it last changed. |
| `urgency` | `integer` | How soon it needs attention, from 1 (low) to 3 (high). |
```json title="Example"
{
"data": {
"number": "GM-000123",
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes for the whole sales team.",
"status": {
"code": "in_progress",
"name": "In progress"
},
"priority": {
"code": "high",
"name": "High"
},
"impact": 3,
"urgency": 2,
"impactTags": [
"continuity"
],
"channel": "api",
"service": {
"id": 12,
"name": "VPN and remote access"
},
"contact": {
"name": "Ana Pérez",
"email": "ana.perez@example.com",
"phone": "+1 809 555 0142",
"departmentId": 4,
"locationId": 2
},
"responseDueAt": "2026-12-06T15:05:00Z",
"resolutionDueAt": "2026-12-06T22:05:00Z",
"firstResponseAt": "2026-12-06T14:21:00Z",
"createdAt": "2026-12-06T14:05:00Z",
"updatedAt": "2026-12-06T14:21:00Z",
"transitions": [
{
"to": {
"code": "waiting_customer",
"name": "Waiting for customer"
},
"requiresReason": true,
"requiresResolution": false,
"requiresClosureCode": false
},
{
"to": {
"code": "resolved",
"name": "Resolved"
},
"requiresReason": false,
"requiresResolution": true,
"requiresClosureCode": false
}
]
}
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl -X POST 'https://api.client.service-desk.goldmaster.io/v1/tickets' \
-H "Authorization: Bearer $DUTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"serviceId": 12,
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes for the whole sales team.",
"impact": 3,
"urgency": 2,
"contact": {
"name": "Ana Pérez",
"email": "ana.perez@example.com",
"phone": "+1 809 555 0142"
}
}'
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/tickets', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"serviceId": 12,
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes for the whole sales team.",
"impact": 3,
"urgency": 2,
"contact": {
"name": "Ana Pérez",
"email": "ana.perez@example.com",
"phone": "+1 809 555 0142"
}
}),
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"POST",
"https://api.client.service-desk.goldmaster.io/v1/tickets",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
json={
"serviceId": 12,
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes for the whole sales team.",
"impact": 3,
"urgency": 2,
"contact": {
"name": "Ana Pérez",
"email": "ana.perez@example.com",
"phone": "+1 809 555 0142"
}
},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
payload := strings.NewReader(`{
"serviceId": 12,
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes for the whole sales team.",
"impact": 3,
"urgency": 2,
"contact": {
"name": "Ana Pérez",
"email": "ana.perez@example.com",
"phone": "+1 809 555 0142"
}
}`)
req, _ := http.NewRequest("POST", "https://api.client.service-desk.goldmaster.io/v1/tickets", 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
'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => <<<'JSON'
{
"serviceId": 12,
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes for the whole sales team.",
"impact": 3,
"urgency": 2,
"contact": {
"name": "Ana Pérez",
"email": "ana.perez@example.com",
"phone": "+1 809 555 0142"
}
}
JSON,
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
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/tickets");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
request.Content = new StringContent("""
{
"serviceId": 12,
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes for the whole sales team.",
"impact": 3,
"urgency": 2,
"contact": {
"name": "Ana Pérez",
"email": "ana.perez@example.com",
"phone": "+1 809 555 0142"
}
}
""", System.Text.Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/tickets"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"serviceId": 12,
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes for the whole sales team.",
"impact": 3,
"urgency": 2,
"contact": {
"name": "Ana Pérez",
"email": "ana.perez@example.com",
"phone": "+1 809 555 0142"
}
}
"""))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# Update a request
> Moves a request to another status, changes its priority, or both.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
Moves a request to another status, changes its priority, or both. The move must be one of the request's `transitions`; send `note`, `resolution` or `closureCode` when the transition requires them. Changing the priority requires a `note`; a raise may wait for a supervisor's approval, shown in `pendingPriority`.
## Path parameters
| Name | Type | Description |
| --- | --- | --- |
| `number` **required** | `string` | Request number, such as `GM-000123`. |
## Request body
| Field | Type | Description |
| --- | --- | --- |
| `closureCode` | `string` | Closure code. Required for transitions with `requiresClosureCode`. Up to 80 characters. |
| `note` | `string` | Reason for the change. Required to change the priority and for transitions with `requiresReason`. Up to 500 characters. |
| `priority` | `string` | New priority code. One of `low`, `medium`, `high`, `critical`, `planned`. |
| `resolution` | `string` | Solution applied. Required for transitions with `requiresResolution`. Up to 20000 characters. |
| `status` | `string` | Status code to move to. Must be one of the request's `transitions`. Up to 50 characters. |
```json title="Example"
{
"status": "resolved",
"resolution": "Replaced the VPN profile and restarted the client."
}
```
## Response
`200 OK` · `data`
| Field | Type | Description |
| --- | --- | --- |
| `channel` | `string` | Where the request came from: `api`, `portal`, `email`… |
| `closedAt` | `date-time` | When the request was closed. |
| `closureCode` | `string` | Closure code, recorded when it was closed. |
| `contact` | `object` | Who the request is for. |
| `contact.departmentId` | `integer` | Department, from List departments. |
| `contact.email` | `string` | Email address. Duty notifies this contact about the request. |
| `contact.locationId` | `integer` | Location, from List locations. |
| `contact.name` | `string` | Full name. |
| `contact.phone` | `string` | Phone number. |
| `createdAt` | `date-time` | When it was created. |
| `description` | `string` | Description. |
| `firstResponseAt` | `date-time` | When an agent first responded. |
| `impact` | `integer` | How many people or how much business it affects, from 1 (low) to 3 (high). |
| `impactTags` | `string[]` | Business impact markers: `executive`, `regulatory`, `financial`, `security`, `continuity`. |
| `number` | `string` | Request number, such as `GM-000123`. Unique within the organization. |
| `pendingPriority` | `object` | Priority raise waiting for a supervisor's approval. |
| `pendingPriority.code` | `string` | Requested priority code. |
| `pendingPriority.name` | `string` | Requested priority name. |
| `priority` | `object` | Current priority. |
| `priority.code` | `string` | Priority code: `low`, `medium`, `high`, `critical` or `planned`. |
| `priority.name` | `string` | Priority name. |
| `resolution` | `string` | The solution applied, recorded when it was resolved. |
| `resolutionDueAt` | `date-time` | Deadline for the resolution, from the service level agreement. |
| `resolvedAt` | `date-time` | When the request was resolved. |
| `responseDueAt` | `date-time` | Deadline for the first response, from the service level agreement. |
| `service` | `object` | Service of the catalog the request belongs to. |
| `service.id` | `integer` | Service ID. |
| `service.name` | `string` | Service name. |
| `status` | `object` | Current status. |
| `status.code` | `string` | Status code, such as `in_progress`. |
| `status.name` | `string` | Status name. |
| `subject` | `string` | Short summary of the request. |
| `transitions` | `object[]` | Statuses the request can move to next. |
| `transitions[].requiresClosureCode` | `boolean` | Send `closureCode` with this move. |
| `transitions[].requiresReason` | `boolean` | Send `note` (at least 3 characters) with this move. |
| `transitions[].requiresResolution` | `boolean` | Send `resolution` (at least 3 characters) with this move. |
| `transitions[].to` | `object` | Target status. |
| `transitions[].to.code` | `string` | Target status code. Send it as `status` to Update a request. |
| `transitions[].to.name` | `string` | Target status name. |
| `updatedAt` | `date-time` | When it last changed. |
| `urgency` | `integer` | How soon it needs attention, from 1 (low) to 3 (high). |
```json title="Example"
{
"data": {
"number": "GM-000123",
"subject": "VPN disconnects every few minutes",
"description": "Since this morning the VPN drops every 5 to 10 minutes for the whole sales team.",
"status": {
"code": "in_progress",
"name": "In progress"
},
"priority": {
"code": "high",
"name": "High"
},
"impact": 3,
"urgency": 2,
"impactTags": [
"continuity"
],
"channel": "api",
"service": {
"id": 12,
"name": "VPN and remote access"
},
"contact": {
"name": "Ana Pérez",
"email": "ana.perez@example.com",
"phone": "+1 809 555 0142",
"departmentId": 4,
"locationId": 2
},
"responseDueAt": "2026-12-06T15:05:00Z",
"resolutionDueAt": "2026-12-06T22:05:00Z",
"firstResponseAt": "2026-12-06T14:21:00Z",
"createdAt": "2026-12-06T14:05:00Z",
"updatedAt": "2026-12-06T14:21:00Z",
"transitions": [
{
"to": {
"code": "waiting_customer",
"name": "Waiting for customer"
},
"requiresReason": true,
"requiresResolution": false,
"requiresClosureCode": false
},
{
"to": {
"code": "resolved",
"name": "Resolved"
},
"requiresReason": false,
"requiresResolution": true,
"requiresClosureCode": false
}
]
}
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl -X PATCH 'https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123' \
-H "Authorization: Bearer $DUTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "resolved",
"resolution": "Replaced the VPN profile and restarted the client."
}'
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"status": "resolved",
"resolution": "Replaced the VPN profile and restarted the client."
}),
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"PATCH",
"https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
json={
"status": "resolved",
"resolution": "Replaced the VPN profile and restarted the client."
},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
payload := strings.NewReader(`{
"status": "resolved",
"resolution": "Replaced the VPN profile and restarted the client."
}`)
req, _ := http.NewRequest("PATCH", "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123", 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
'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => <<<'JSON'
{
"status": "resolved",
"resolution": "Replaced the VPN profile and restarted the client."
}
JSON,
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("PATCH"), "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
request.Content = new StringContent("""
{
"status": "resolved",
"resolution": "Replaced the VPN profile and restarted the client."
}
""", System.Text.Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/tickets/GM-000123"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("""
{
"status": "resolved",
"resolution": "Replaced the VPN profile and restarted the client."
}
"""))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# Create a webhook
> Subscribes an HTTPS URL to request events.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
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
| 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`. |
```json title="Example"
{
"name": "ERP sync",
"url": "https://erp.example.com/hooks/duty",
"events": [
"ticket.created",
"ticket.status_changed"
]
}
```
## 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. |
```json title="Example"
{
"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
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
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"
]
}'
```
```javascript
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);
```
```python
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"])
```
```go
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
'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;
```
```csharp
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()}");
```
```java
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());
```
# Delete a webhook
> Stops deliveries at once.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
Stops deliveries at once. Deliveries still queued for the webhook are dropped.
## Path parameters
| Name | Type | Description |
| --- | --- | --- |
| `id` **required** | `string` | ID of the webhook. |
## Response
`204 No Content`. The response has no body.
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl -X DELETE 'https://api.client.service-desk.goldmaster.io/v1/webhooks/7' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/webhooks/7', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
if (!response.ok) throw new Error(`Duty API ${response.status}`);
```
```python
import os
import requests
response = requests.request(
"DELETE",
"https://api.client.service-desk.goldmaster.io/v1/webhooks/7",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.client.service-desk.goldmaster.io/v1/webhooks/7", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("DELETE"), "https://api.client.service-desk.goldmaster.io/v1/webhooks/7");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/7"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# Get a webhook
> One webhook by its ID.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
One webhook by its ID. The signing secret is never returned.
## Path parameters
| Name | Type | Description |
| --- | --- | --- |
| `id` **required** | `string` | ID of the webhook. |
## Response
`200 OK` · `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`. |
| `updatedAt` | `date-time` | When it last changed. |
| `url` | `string` | HTTPS URL that receives the deliveries. |
| `version` | `string` | Payload version the webhook receives. |
```json title="Example"
{
"data": {
"id": 7,
"name": "ERP sync",
"url": "https://erp.example.com/hooks/duty",
"events": [
"ticket.created",
"ticket.status_changed"
],
"enabled": true,
"version": "v1",
"createdAt": "2026-12-01T09:00:00Z",
"updatedAt": "2026-12-01T09:00:00Z"
}
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/webhooks/7' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/webhooks/7', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/webhooks/7",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/webhooks/7", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/webhooks/7");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/7"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# List webhook deliveries
> The latest deliveries of a webhook, newest first: what was sent, how many attempts it took and what your endpoint answered.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
The latest deliveries of a webhook, newest first: what was sent, how many attempts it took and what your endpoint answered.
## Path parameters
| Name | Type | Description |
| --- | --- | --- |
| `id` **required** | `string` | ID of the webhook. |
## Query parameters
| Name | Type | Description |
| --- | --- | --- |
| `page` | `integer` | Page to return, from 1. At least 1. Default: `1`. |
| `perPage` | `integer` | Items per page. From 1 to 100. Default: `25`. |
## Response
`200 OK` · `data[]` + `pagination`
| Field | Type | Description |
| --- | --- | --- |
| `attempts` | `integer` | Attempts made so far. |
| `completedAt` | `date-time` | When it succeeded or ran out of attempts. |
| `createdAt` | `date-time` | When it was created. |
| `event` | `string` | Event delivered. |
| `id` | `integer` | Unique ID. |
| `lastAttemptAt` | `date-time` | When the last attempt ran. |
| `lastError` | `string` | Why the last attempt failed. |
| `nextRunAt` | `date-time` | When the next attempt runs. |
| `responseStatus` | `integer` | HTTP status your endpoint answered on the last attempt. |
| `status` | `string` | `pending`, `running`, `retrying`, `succeeded` or `dead` (no attempts left). One of `pending`, `running`, `retrying`, `succeeded`, `dead`. |
```json title="Example"
{
"data": [
{
"id": 3021,
"event": "ticket.status_changed",
"status": "succeeded",
"attempts": 1,
"responseStatus": 200,
"nextRunAt": "2026-12-06T14:21:05Z",
"lastAttemptAt": "2026-12-06T14:21:06Z",
"completedAt": "2026-12-06T14:21:06Z",
"createdAt": "2026-12-06T14:21:05Z"
}
],
"pagination": {
"page": 1,
"perPage": 25,
"total": 1,
"totalPages": 1
}
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/webhooks/7/deliveries' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/webhooks/7/deliveries', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/webhooks/7/deliveries",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/webhooks/7/deliveries", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/webhooks/7/deliveries");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/7/deliveries"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# List webhook events
> Every event a webhook can subscribe to, with what triggers it.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
Every event a webhook can subscribe to, with what triggers it.
## Response
`200 OK` · `data[]`
| Field | Type | Description |
| --- | --- | --- |
| `description` | `string` | What triggers it. |
| `type` | `string` | Event name to subscribe to. |
```json title="Example"
{
"data": [
{
"type": "ticket.created",
"description": "A request was opened, from any channel."
}
]
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/webhooks/events' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/webhooks/events', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/webhooks/events",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/webhooks/events", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/webhooks/events");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/events"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# List webhooks
> Webhooks created through the API in the key's workspace.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
Webhooks created through the API in the key's workspace.
## Response
`200 OK` · `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`. |
| `updatedAt` | `date-time` | When it last changed. |
| `url` | `string` | HTTPS URL that receives the deliveries. |
| `version` | `string` | Payload version the webhook receives. |
```json title="Example"
{
"data": [
{
"id": 7,
"name": "ERP sync",
"url": "https://erp.example.com/hooks/duty",
"events": [
"ticket.created",
"ticket.status_changed"
],
"enabled": true,
"version": "v1",
"createdAt": "2026-12-01T09:00:00Z",
"updatedAt": "2026-12-01T09:00:00Z"
}
]
}
```
## Errors
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl 'https://api.client.service-desk.goldmaster.io/v1/webhooks' \
-H "Authorization: Bearer $DUTY_API_KEY"
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/webhooks', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
},
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"GET",
"https://api.client.service-desk.goldmaster.io/v1/webhooks",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.client.service-desk.goldmaster.io/v1/webhooks", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY"))
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
'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.client.service-desk.goldmaster.io/v1/webhooks");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# Update a webhook
> Changes the name, URL, events or state of a webhook.
import { Tabs, TabItem } from '@astrojs/starlight/components';
import ApiConsole from '../../../../../../components/api/ApiConsole.astro';
import Endpoint from '../../../../../../components/api/Endpoint.astro';
Changes the name, URL, events or state of a webhook. With `rotateSecret` the response carries a new signing secret and the old one stops working at once.
## Path parameters
| Name | Type | Description |
| --- | --- | --- |
| `id` **required** | `string` | ID of the webhook. |
## Request body
| Field | Type | Description |
| --- | --- | --- |
| `enabled` | `boolean` | Pause (`false`) or resume (`true`) deliveries. |
| `events` | `string[]` | New list of events; it replaces the current one. 1 to 20 items. One of `ticket.created`, `ticket.status_changed`, `ticket.priority_changed`, `ticket.comment_added`, `ticket.attachment_added`. |
| `name` | `string` | New name. 2 to 160 characters. |
| `rotateSecret` | `boolean` | Issue a new signing secret. The old one stops working at once. |
| `url` | `string` | New HTTPS URL. Up to 1000 characters. A public https URL. |
```json title="Example"
{
"events": [
"ticket.created",
"ticket.status_changed",
"ticket.comment_added"
]
}
```
## Response
`200 OK` · `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. |
```json title="Example"
{
"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
Errors share one shape; see [Errors](/en/api/errors/) for every key.
## Code examples
```sh
curl -X PATCH 'https://api.client.service-desk.goldmaster.io/v1/webhooks/7' \
-H "Authorization: Bearer $DUTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"events": [
"ticket.created",
"ticket.status_changed",
"ticket.comment_added"
]
}'
```
```javascript
const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/webhooks/7', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.DUTY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"events": [
"ticket.created",
"ticket.status_changed",
"ticket.comment_added"
]
}),
});
const body = await response.json();
if (!response.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data);
```
```python
import os
import requests
response = requests.request(
"PATCH",
"https://api.client.service-desk.goldmaster.io/v1/webhooks/7",
headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"},
json={
"events": [
"ticket.created",
"ticket.status_changed",
"ticket.comment_added"
]
},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```
```go
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
payload := strings.NewReader(`{
"events": [
"ticket.created",
"ticket.status_changed",
"ticket.comment_added"
]
}`)
req, _ := http.NewRequest("PATCH", "https://api.client.service-desk.goldmaster.io/v1/webhooks/7", 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
'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DUTY_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => <<<'JSON'
{
"events": [
"ticket.created",
"ticket.status_changed",
"ticket.comment_added"
]
}
JSON,
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $response;
```
```csharp
using System.Net.Http.Headers;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("PATCH"), "https://api.client.service-desk.goldmaster.io/v1/webhooks/7");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));
request.Content = new StringContent("""
{
"events": [
"ticket.created",
"ticket.status_changed",
"ticket.comment_added"
]
}
""", System.Text.Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```
```java
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/7"))
.header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("""
{
"events": [
"ticket.created",
"ticket.status_changed",
"ticket.comment_added"
]
}
"""))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
```
# Requests and responses
> Envelopes, pagination, dates, languages and request IDs shared by every Duty API endpoint.
## Response envelope
A single resource comes inside `data`:
```json
{
"data": { "number": "GM-000123", "subject": "VPN disconnects every few minutes" }
}
```
A list adds `pagination`:
```json
{
"data": [{ "number": "GM-000123" }, { "number": "GM-000122" }],
"pagination": { "page": 1, "perPage": 25, "total": 87, "totalPages": 4 }
}
```
Catalog lists are short and come whole, without `pagination`. A deletion answers `204 No Content`.
## Pagination
Paginated endpoints take two query parameters:
| Parameter | Default | Range |
| --- | --- | --- |
| `page` | `1` | 1 or more |
| `perPage` | `25` | 1 to 100 |
Read pages until `page` reaches `totalPages`. To keep a copy in sync, prefer [`updatedSince`](/en/api/guides/sync-requests/) over walking every page again.
## Dates and times
Timestamps are RFC 3339 in UTC: `2026-12-06T14:05:00Z`. Filters such as `createdFrom` and `updatedSince` accept any RFC 3339 value, with or without an offset (`2026-12-06T10:05:00-04:00`).
## Languages
Send `Accept-Language` to choose the language of:
- names of statuses, priorities, services, categories and transitions;
- error messages.
The API speaks English (`en`), Spanish (`es`), French (`fr`) and Portuguese (`pt`). Without the header, or with a language it does not speak, it answers in English. Codes stay the same in every language: compare `status.code`, display `status.name`.
## Request IDs
Every response carries `X-Request-ID`. Send your own (up to 100 letters, digits, `.`, `_`, `:` or `-`) to follow a call through your logs and ours; otherwise the API creates one. Errors repeat it as `traceId`; quote it when you contact support.
## Response headers
| Header | Meaning |
| --- | --- |
| `API-Version` | Version that answered, such as `v1`. |
| `X-Request-ID` | Identifier of this call. |
| `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` | Your [rate limit](/en/api/rate-limits/) window. |
| `Deprecation`, `Sunset`, `Link` | Only on a version being retired. See [Versioning](/en/api/versioning/). |
## Unknown fields
Within a version, new optional fields can appear in responses at any time. Ignore the ones you don't know, and don't fail on them. In request bodies the API ignores fields it does not know, so check field names against the reference: a misspelled optional field is silently skipped.
# Versioning
> How the Duty API is versioned, which changes can happen within a version and how a version is retired.
The version is part of every path: `/v1/tickets`. Every response names the version that answered in the `API-Version` header.
## Within a version
A version only grows. These changes can ship at any time:
- new endpoints;
- new optional fields in request bodies and new query parameters;
- new fields in responses;
- new error keys, new webhook events, and new values of open lists such as statuses (each workspace defines its own).
Write your integration so that it ignores fields and values it doesn't know. Anything else is a breaking change and ships as a new version.
## Retiring a version
When a new version replaces one, the old one keeps working for a period announced in advance. Meanwhile each of its responses carries:
```http
Deprecation: @1798761600
Sunset: Wed, 30 Jun 2027 00:00:00 UTC
Link: ; rel="successor-version"
```
- `Deprecation`: when the version was deprecated.
- `Sunset`: the date it stops answering.
- `Link`: the version that replaces it.
Log these headers when you see them so your team hears about the change early. After the sunset date, the old version answers `API_VERSION_UNSUPPORTED` with the list of versions available.
The current version is **v1**, with no retirement planned.
# Webhooks
> Receive Duty request events on your own HTTPS endpoint, signed with HMAC-SHA256 and retried automatically.
import { Aside } from '@astrojs/starlight/components';
A webhook is a URL of yours that Duty calls whenever something happens to a request of the workspace. Use webhooks to keep another system in step without polling.
Events come from every channel: a request opened through the API, by email or in the portal, and a comment written by an agent or by the requester, all reach your webhook.
## Events
| Event | When | Extra in `data` |
| --- | --- | --- |
| `ticket.created` | A request was opened, from any channel. | — |
| `ticket.status_changed` | A request moved to another status. | `change.from`, `change.to` |
| `ticket.priority_changed` | A request's priority changed. | `change.from`, `change.to` |
| `ticket.comment_added` | A public comment was added. Internal notes are never sent. | `comment` |
| `ticket.attachment_added` | A file was attached. | `attachment` |
[`GET /v1/webhooks/events`](/en/api/reference/webhooks/list-webhook-events/) returns the same list, so your setup code can stay current.
## Create a webhook
Create it with a key that has the `webhooks` scope:
```sh
curl 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"]
}'
```
The response includes `secret`, the key that signs every delivery. **It is shown only once**: store it with your other secrets. To replace it, [update the webhook](/en/api/reference/webhooks/update-a-webhook/) with `"rotateSecret": true`; the old secret stops working at once.
The URL must use HTTPS and point to a public address. Webhooks created through the API are managed through the API. They are separate from the webhooks administrators create in the portal, which send operational alerts such as SLA warnings with a different payload.
## The delivery
Duty sends a `POST` with a JSON body:
```json
{
"id": "6f2d0c8e9a1b4e73b6a1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3",
"type": "ticket.status_changed",
"version": "v1",
"createdAt": "2026-12-06T14:05:00Z",
"data": {
"ticket": {
"number": "GM-000123",
"subject": "VPN disconnects every few minutes",
"status": { "code": "in_progress", "name": "In progress" },
"priority": { "code": "high", "name": "High" },
"service": { "id": 12, "name": "VPN and remote access" },
"contact": { "name": "Ana Pérez", "email": "ana.perez@example.com" },
"updatedAt": "2026-12-06T14:05:00Z"
},
"change": {
"from": { "code": "open", "name": "Open" },
"to": { "code": "in_progress", "name": "In progress" }
}
}
}
```
`data.ticket` has the same fields as a request in [List requests](/en/api/reference/requests/list-requests/) (shortened here). Names come in the workspace's language.
And these headers:
| Header | Meaning |
| --- | --- |
| `X-Goldmaster-Timestamp` | Unix time (seconds) when the delivery was signed. |
| `X-Goldmaster-Signature` | `sha256=` and the hex HMAC-SHA256 of `{timestamp}.{body}` with your secret. |
| `Idempotency-Key` | Same as the body's `id`. Equal on every retry of the same event. |
| `X-Request-ID` | Trace of the delivery, for support. |
## Verify every delivery
Before you trust a delivery:
1. Read the raw body as bytes, **before** parsing the JSON.
2. Compute `HMAC-SHA256(secret, timestamp + "." + body)` and compare it in constant time with the hex after `sha256=`.
3. Reject timestamps older than five minutes, to stop replays.
4. Skip `Idempotency-Key` values you already processed.
[Receive webhooks](/en/api/guides/receive-webhooks/) has the code in seven languages.
## Answer fast, retry safe
- Answer with any `2xx` within **10 seconds**. Do slow work after answering, in a queue.
- Any other status, a timeout or a connection error schedules a retry: after 1, 2, 4, 8, 16, 32 and 64 minutes, **8 attempts** in all.
- After the last attempt the delivery is marked `dead`. Administrators can requeue it from the portal under **Integrations → Retries**, and you can inspect it with [List deliveries](/en/api/reference/webhooks/list-webhook-deliveries/).
- Deliveries can arrive more than once and out of order. Use `Idempotency-Key` to deduplicate and the ticket's `updatedAt` to keep the latest state.
# Build on Duty
> Open and follow service desk requests from your own systems, get signed webhooks the moment something changes, and try every endpoint live with your key.
import { Card, CardGrid, LinkCard } from '@astrojs/starlight/components';
Read catalogs, open requests, change their status, comment and attach files. JSON over HTTPS with one API key per workspace.
Subscribe a URL and receive every new request, status change, comment and attachment, signed with HMAC-SHA256 and retried for you.
Add your API key once and send real requests from any reference page. Copy the same call in cURL, JavaScript, Python, Go, PHP, C# or Java.
Every page is available as Markdown, the whole site as `llms.txt`, and the contract as an OpenAPI 3.1 document.
## Start here
# Portal guide
> How requesters, agents, supervisors and administrators use the Duty service desk portal.
import { CardGrid, Card } from '@astrojs/starlight/components';
The Duty portal is the web workspace where your organization opens, works on and resolves requests. Each person sees what their role allows, always inside the organization and group they work for.
## Who uses it
Open requests from the service catalog, follow their progress, reply to agents and search the knowledge base.
Work the queue, move requests through the workflow, talk to requesters and record what solved each case.
Watch service levels, approve priority changes and requests that need sign-off, and balance the team's load.
Configure services, workflows, service level agreements, users and integrations, including API keys and webhooks.
## Connect it with your systems
Everything the portal records can also be read and changed through the [API](/en/api/), and every change can reach your systems through [webhooks](/en/api/webhooks/). API keys are created in the portal under **Integrations → Keys and webhooks**.
The step-by-step guide to each area of the portal is coming to this section.