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

Getting Started with the AlertOps Java SDK

Add com.alertops:alertops-sdk to your build, set ALERTOPS_API_KEY and build an AlertOps client; every AlertOps endpoint is then a method such as ao.groups().list().

Overview

Relevant for Java developers automating AlertOps

The AlertOps Java SDK (com.alertops:alertops-sdk) brings the whole AlertOps API to the JVM in one thread-safe client. Each endpoint is a method on a resource, such as ao.groups().list() or ao.escalationPolicies().create(...), and results are Jackson JsonNode objects. Teams use it to onboard responders automatically, send alerts from their own services and publish status updates straight from their deployment pipelines.

Key benefits:

  • Complete — every AlertOps endpoint is available as a method.
  • Thread-safe — share one client across your application.
  • Familiar stack — built on java.net.http and Jackson; requires Java 17 or later.
  • 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

Add the dependency to your Maven pom.xml:

<dependency>
<groupId>com.alertops</groupId>
<artifactId>alertops-sdk</artifactId>
<version>0.1.0</version>
</dependency>

For Gradle, use implementation("com.alertops:alertops-sdk:0.1.0").

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 fileAlertOps.builder().dotenv(Path.of(".env")).build() reads ALERTOPS_API_KEY from the file
Client optionAlertOps.builder().apiKey(key).build()

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

Make your first calls

Relevant for Developers checking that the connection works

import com.alertops.sdk.*;
import com.alertops.sdk.helpers.Shared;
import java.util.List;

AlertOps ao = AlertOps.builder().build();
System.out.println(ao.account().timeZone()); // your account's time zone
Shared.Ensured g = ao.groups().ensure("Network Ops"); // find or create a group
ao.groups().members().addUsers(g.record().get("group_id"), List.of(7, 8));

Paginated endpoints also have …All() to collect every page and …Iter() for a lazy Iterable, for example ao.groups().listAll().

Common tasks

Relevant for Developers looking for the right method

TaskMethod
Find or create a groupao.groups().ensure
Create an on-call shiftao.schedules().createShift
Create an API integrationao.inbound().createApi
Send an alertao.ingest().postToIntegration
List recent alertsao.alerts().listRecent
Post a status page incidentao.statusHub().incidents().create

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 Java alongside the other SDKs.
  • The full developer documentation, with every method, ships with the library: github.com/alertops/alertops-java.

Related Articles

Need help?

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