Skip to main content
The .NET SDK gives you a typed client for the whole incident.io API. There’s a method for every endpoint and a type for every request and response, generated from our OpenAPI specification with Kiota. The methods follow the shape of the URL, so it’s easy to go from an endpoint in the API reference to the code that calls it. It targets .NET 8 and .NET 10.

Installing

Your first request

You’ll need an API key from Settings > API keys (see API keys). Then:
The client holds an HttpClient, so create one and reuse it.

Finding an endpoint

The methods follow the URL:
  • GET /v2/incidents is client.V2.Incidents.GetAsync().
  • GET /v2/incidents/{id} is client.V2.Incidents[id].GetAsync().
  • POST /v2/incidents is client.V2.Incidents.PostAsync(body).
Path segments are PascalCase, so /v2/alert_attributes is client.V2.AlertAttributes. Every method is async and takes an optional CancellationToken. Query parameters go on request.QueryParameters, and request and response types live in IncidentIo.Models.

Pagination

List endpoints are cursor-paginated. Read the next cursor from PaginationMeta.After and pass it back:

Filtering

Some list endpoints take filters in the form field[operator]=value, like status[one_of]=firing. The generator can’t express these as typed parameters, so the SDK leaves them out. You can still use them: pass them in the URL with WithUrl, which keeps authentication and everything else about the request.
Escape values with Uri.EscapeDataString if they can contain &, =, or spaces.

Errors

A documented error status throws IncidentIo.Models.ErrorResponse, which carries the API’s error body. Anything else throws Kiota’s ApiException, which ErrorResponse derives from:
If you contact us about a failed request, include the RequestId.

Configuration

The API key is only ever sent to the configured host. If you need your own HttpClient, you can build the client from a Kiota request adapter instead. The README shows how.

Retries

Unlike most of our other SDKs, this one retries for you. Requests that fail with 429, 503, or 504 are retried up to three times, honouring the Retry-After header the API sends when you hit the rate limit. One thing to watch out for: a retried POST can be applied twice if the first attempt reached us before failing. Creating an incident or an escalation takes an IdempotencyKey for exactly this reason, so set it.

Enum values

We add enum values as a backwards-compatible change. When a response carries a value your version of the SDK doesn’t know, that property reads as null rather than throwing, and the rest of the response is unaffected. Upgrade the package to see the new value.

Deprecated endpoints

Endpoints we’ve deprecated stay available and are marked [Obsolete], so the compiler warns at the call site (CS0618). Don’t go by the version in the name: some V2 endpoints are deprecated too. If you build with TreatWarningsAsErrors, add CS0618 to WarningsNotAsErrors so a newly deprecated endpoint doesn’t fail your build.

Versioning

The SDK is kept up to date with the API automatically. Additions to the API are minor versions. A change that would break your code, like a removed type or member, is released as a new major version, and its release notes list what changed.

Resources

NuGet

The IncidentIo package and its versions.

GitHub

Source, README, and issues for the .NET SDK.

API reference

Endpoints, authentication, rate limits, and errors.

All SDKs

Clients for Go, TypeScript, Python, Rust, Ruby, and PHP.