Skip to content
  • There are no suggestions because the search field is empty.

Getting Started with the AlertOps .NET SDK

Add the AlertOps.Sdk NuGet package, set ALERTOPS_API_KEY and create a new AlertOpsClient(); every AlertOps endpoint is then an async method such as ao.Groups.ListAsync().

Overview

Relevant for .NET developers automating AlertOps

The AlertOps .NET SDK (AlertOps.Sdk) brings the whole AlertOps API to C# and .NET in one client. Each endpoint is an async method on a resource, such as ao.Groups.ListAsync() or ao.EscalationPolicies.CreateAsync(...), and results are System.Text.Json nodes. Teams use it to onboard responders automatically, send alerts from their own services and publish status updates straight from their deployment pipelines. It fits naturally into ASP.NET apps, worker services and console tools alike.

Key benefits:

  • Complete — every AlertOps endpoint is available as a method.
  • Idiomatic .NET — async/await with a CancellationToken on every call, and an injectable HttpClient.
  • Modern runtime — targets .NET 8.
  • Helpers included — find-or-create, alert ingestion and the semantic layer for planning on-call setups.

Install the SDK

Relevant for Developers setting up a project

dotnet add package AlertOps.Sdk
using AlertOps;

Set your API key

Relevant for Developers connecting to an AlertOps account

Create an API key in AlertOps, then make it available to the SDK in one of three ways:

OptionHow
Environment variableALERTOPS_API_KEY=<your key>
.env filenew AlertOpsClient(new AlertOpsOptions { Dotenv = ".env" }) reads ALERTOPS_API_KEY from the file
Client optionnew AlertOpsClient(new AlertOpsOptions { ApiKey = key })

Keep the key on servers, in scripts and in CI secrets.

Make your first calls

Relevant for Developers checking that the connection works

using AlertOps;

using var ao = new AlertOpsClient();
Console.WriteLine(await ao.Account.TimeZoneAsync()); // your account's time zone
var (group, _) = await ao.Groups.EnsureAsync("Network Ops"); // find or create a group
await ao.Groups.Members.AddUsersAsync(group!["group_id"]!, new object?[] { 7, 8 });

Paginated endpoints also have …AllAsync() to collect every page and …IterAsync() for an IAsyncEnumerable, for example ao.Groups.ListAllAsync().

Common tasks

Relevant for Developers looking for the right method

TaskMethod
Find or create a groupao.Groups.EnsureAsync
Create an on-call shiftao.Schedules.CreateShiftAsync
Create an API integrationao.Inbound.CreateApiAsync
Send an alertao.Ingest.PostToIntegrationAsync
List recent alertsao.Alerts.ListRecentAsync
Post a status page incidentao.StatusHub.Incidents.CreateAsync

Every other AlertOps feature follows the same pattern, one resource per area of the app.

What you can build

Relevant for Teams planning their first automation

GoalWhere to start
Keep on-call teams in sync with your HR or identity systemUsers, groups and schedules
Send alerts from your own servicesInbound integrations and alert ingestion
Roll out a complete on-call setup from a short descriptionThe semantic layer
Publish incidents to customersStatus Hub pages and incidents

Next steps

Relevant for Developers building their first automation

  • Follow the guides for each area: people and schedules, escalation, alert sources, alerts, workflows, status pages and administration. Each guide shows C# alongside the other SDKs.
  • The full developer documentation, with every method, ships with the library: github.com/alertops/alertops-dotnet.

Related Articles

Need help?

Email support@alertops.com or contact your AlertOps representative.