go-flashduty is the official Go client for the Flashduty Open API — a thin, strongly-typed SDK. It is generated from the same OpenAPI specification this documentation is built on, covers every Open API endpoint, and is validated by unit tests and end-to-end against the live API.
If your service is written in Go, use the SDK to call Flashduty rather than hand-writing HTTP requests — you get typed request parameters, response structs, and error codes out of the box, with no manual JSON assembly or response parsing.
Install
Requires Go 1.24 or later.Quick start
Create a client with your APP Key and call endpoints grouped by service (client.Incidents, client.Alerts, …). Each method maps to exactly one HTTP call and returns (*T, *Response, error):
Design
Thin and typed
Every method maps to exactly one HTTP call and returns
(*T, *Response, error). No hidden cross-endpoint enrichment.Service-grouped
Endpoints are organized into services on the client (
client.Incidents, client.Alerts, …), generated from the OpenAPI specification.Composable transport
Cross-cutting concerns (retry, caching, tracing, rate-limit handling) compose as
http.RoundTripper middleware via WithTransport.Human-readable timestamps
Response time fields are typed
Timestamp / TimestampMilli, rendering as RFC3339 in JSON, logs, and LLM-facing output — while the raw epoch is one call away.Options
NewClient accepts a set of options:
Errors and rate limits
The SDK returns typed errors you can unwrap witherrors.As, plus convenience predicates that see through wrapped errors:
Timestamps
Time fields on responses are typedTimestamp (Unix seconds) or TimestampMilli (milliseconds). They marshal to an RFC3339 string in the local timezone and unmarshal from either a numeric epoch or an RFC3339 string, so a value round-trips cleanly. The zero value stays the numeric 0 sentinel (never a 1970 date) and is dropped by omitempty.
Request time fields stay plain
int64 — the API expects a numeric epoch on the wire. Most endpoints take seconds, but RUM and webhook-history endpoints take milliseconds.Retries
Automatic retries are not built into the core. Compose them at the transport layer with the optionalretry subpackage — a safe-by-default retrying http.RoundTripper (retries 429 and 5xx, honors Retry-After, deterministic exponential backoff, and only replays requests whose body is replayable, which all SDK requests are):
Resources
GitHub repository
Source, full README, and issues. Licensed under Apache-2.0.
API Catalog
Browse every endpoint — each maps to a typed method in the SDK.