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:
| Option | How |
| Environment variable | ALERTOPS_API_KEY=<your key> |
| .env file | AlertOps.builder().dotenv(Path.of(".env")).build() reads ALERTOPS_API_KEY from the file |
| Client option | AlertOps.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
| Task | Method |
| Find or create a group | ao.groups().ensure |
| Create an on-call shift | ao.schedules().createShift |
| Create an API integration | ao.inbound().createApi |
| Send an alert | ao.ingest().postToIntegration |
| List recent alerts | ao.alerts().listRecent |
| Post a status page incident | ao.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
| Goal | Where to start |
| Keep on-call teams in sync with your HR or identity system | Users, groups and schedules |
| Send alerts from your own services | Inbound integrations and alert ingestion |
| Roll out a complete on-call setup from a short description | The semantic layer |
| Publish incidents to customers | Status 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
- AlertOps SDKs for Python, TypeScript, Go, Java and .NET
- Users, Groups and On-Call Schedules with the AlertOps SDKs
- Inbound Integrations, Alert Ingestion and Heartbeats with the AlertOps SDKs
- Planning On-Call Setups with the AlertOps Semantic Layer
Need help?
Email support@alertops.com or contact your AlertOps representative.