Skip to content

API guide

Everything the web app does goes through a JSON API, and you can use the same API from scripts. This page explains how to authenticate, how errors and paging work, and shows the most common calls.

Base URL

All routes start with /api/v1 on your server. The examples use:

https://argavon.com.com/api/v1

Requests and responses are JSON. Send Content-Type: application/json with a body.

Authentication

There are three kinds of credential. Use the one that fits the caller.

Credential For Sent as
Session token A person using a script or CLI Authorization: Bearer <token>
API key A long-running integration Authorization: Bearer nok_…
Source token A monitoring tool sending alerts X-Source-Token: <token>

Session token

Sign in with your email and password:

curl -X POST https://argavon.com.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "password": "your-password"}'

The response holds the token, your user and when the session ends (Unix seconds):

{
  "token": "<session token>",
  "user": {
    "id": "usr-...",
    "tenant_id": "acme-1f3a9c0e",
    "email": "you@example.com",
    "role": "operator",
    "created_at": "2026-11-01T09:00:00Z",
    "updated_at": "2026-11-01T09:00:00Z"
  },
  "expires_at": 1762333200
}

Send the token on later requests:

export NEUROOPS_TOKEN="eyJhbGciOi..."
curl https://argavon.com.com/api/v1/auth/me \
  -H "Authorization: Bearer $NEUROOPS_TOKEN"

A session lasts 24 hours. It ends early if you sign out everywhere, change your password, or an admin changes your role or disables you.

If your email belongs to more than one workspace, sign-in answers 409 with the code WORKSPACE_REQUIRED and the list of workspace ids. Repeat the request with "workspace": "<workspace id>".

Wrong credentials answer 401 with {"error": "invalid credentials"}. Too many failed attempts for one email answer 429 with a Retry-After header. The lock does not apply on a network the account signed in from before, unless the failed attempts came from there.

API keys

Admins create API keys on Admin → API keys. A key has its own role and an optional expiry, and is shown once. Send it in the Authorization header only. See API keys.

curl https://argavon.com.com/api/v1/incidents \
  -H "Authorization: Bearer $NEUROOPS_API_KEY"

Source tokens

Ingest endpoints (/api/v1/ingest/prometheus, /api/v1/ingest/grafana, /api/v1/ingest/zabbix, /api/v1/otel/...) do not take session tokens or API keys. Each alert source has its own token, returned once when the source is created. Send it as X-Source-Token: <token> (or Authorization: Bearer <token>). See Send alerts.

The web app signs in with the header X-Session-Mode: cookie. The server then sets an httpOnly, SameSite=Strict cookie named neuroops_session and leaves token out of the response.

Requests authenticated by that cookie that change something (anything but GET, HEAD and OPTIONS) must also send:

X-Requested-With: neuroops

Without it they are refused with 403 and "missing X-Requested-With header". Scripts using a bearer token or an API key do not need this header.

POST /api/v1/auth/logout clears the cookie. POST /api/v1/auth/logout-all ends every session of the caller.

Roles

Each route needs at least one of the roles viewer, operator or admin. In short: viewers read, operators work incidents and on-call, admins manage people and workspace settings. See Roles.

Errors

Errors are JSON with a human-readable error and a machine-readable code:

{
  "error": "role 'viewer' does not have permission; requires 'operator' or higher",
  "code": "ROLE_INSUFFICIENT",
  "request_id": "..."
}

request_id is included when the server assigned one; quote it when you report a problem. Read code in your programs, not the text of error.

Every API error carries a code, including sign-in, sign-up and the rate limits (RATE_LIMIT_EXCEEDED).

Common status codes

Status Code Meaning
400 BAD_REQUEST The request is malformed or a value is invalid. The error says which.
401 AUTH_TOKEN_MISSING No credential was sent.
401 AUTH_TOKEN_INVALID The token or key is wrong, revoked, or its session has ended.
401 AUTH_TOKEN_EXPIRED The session token has expired. Sign in again.
402 PLAN_LIMIT, SEAT_LIMIT An invite would go over the plan's user limit or the license's seats.
403 ROLE_INSUFFICIENT Your role is too low for this action.
403 ROLE_DENIES A custom role takes this action away from you (Enterprise).
403 ENTERPRISE_FEATURE The workspace's license does not include this feature. The response also has entitlement.
403 FORBIDDEN Refused for another reason, such as a missing X-Requested-With header, or an API key used to add or change people.
403 WRONG_PASSWORD The current password sent to change a password is wrong. The session is still valid.
403 SIGNUP_DISABLED Self-service sign-up is turned off on this server (SIGNUP_ENABLED=false). Ask an admin to invite you.
403 TENANT_SUSPENDED, TENANT_DISABLED The workspace is suspended or disabled.
404 NOT_FOUND No such resource in your workspace. Resources of other workspaces also answer 404.
405 METHOD_NOT_ALLOWED The route exists but not with this method.
409 CONFLICT The request conflicts with the current state, for example a duplicate.
413 PAYLOAD_TOO_LARGE The body is too large.
429 RATE_LIMIT_EXCEEDED, MUTATION_RATE_LIMIT_EXCEEDED Too many requests. Wait for the time in Retry-After.
500 INTERNAL_ERROR Something went wrong on the server. Details are in its log.
503 SERVICE_UNAVAILABLE A dependency (usually the database) is not available. Retry later.

Pagination

Incidents

GET /api/v1/incidents takes page (from 1) and page_size (default 20, at most 100):

{
  "items": [ { "id": "inc-...", "title": "...", "status": "open", "...": "..." } ],
  "page": 1,
  "page_size": 20,
  "total": 134,
  "has_more": true,
  "next_cursor": "..."
}

For long lists, use the cursor instead: pass next_cursor from one response as cursor in the next request. page is then ignored. Cursors work with the default order and with sort_by=last_event_time or sort_by=first_event_time; with other orders next_cursor is empty and a cursor is refused with 400.

Other filters on the incident list:

Parameter Values
status open, acknowledged, resolved
severity critical, high, medium, low, info, unknown
service A service name (up to 120 characters)
search Free text (up to 200 characters)
from, to RFC 3339 time or YYYY-MM-DD
assignee me, none or a user id
sort_by last_event_time (default), first_event_time, severity, status, service, title, risk_score, confidence, priority_score
sort_order desc (default) or asc

Other lists

Most other list endpoints return all items at once as {"items": [...]}. SCIM uses its own startIndex and count parameters.

Rate limits

What Limit
Sign-in (/auth/login) and password change 10 requests per minute per IP address
Sign-up (/auth/register) 5 requests per minute per IP address
Failed sign-ins for one email After 5 failures in 15 minutes the email is locked for 5 minutes, doubling up to 1 hour
Single sign-on endpoints 60 requests per minute per IP address
Ingest endpoints 600 requests per minute per IP address, and 100 per minute per source
Authenticated API requests Per workspace, from the workspace's plan (below)

Workspace-wide budgets apply only on servers that sell plans (billing configured). There, each workspace has a per-minute budget for authenticated requests (requests that change something count against a second budget of the same size) and one for ingested alerts:

Plan API requests per minute Ingest requests per minute
Free 1,200 600
Pro 30,000 6,000
Enterprise 30,000 6,000

A limit a platform operator set for one workspace replaces the plan's.

A self-hosted server has no workspace-wide budget unless a platform operator sets one for a workspace through the organisation admin API (/api/v1/admin/tenants, which needs the Enterprise tenant.admin entitlement). The per-address and per-source limits above always apply.

A request over a limit answers 429 with Retry-After: 60.

Idempotent ingest

The Prometheus, Grafana and Zabbix ingest endpoints accept an X-Idempotency-Key header. A repeat of a key within 24 hours is not processed again: it returns the first response, with the header X-Idempotent-Replay: true.

Common tasks

The examples use a session token or API key in $NEUROOPS_TOKEN.

List open incidents

curl "https://argavon.com.com/api/v1/incidents?status=open&sort_by=priority_score" \
  -H "Authorization: Bearer $NEUROOPS_TOKEN"

To count incidents per status, use GET /api/v1/incidents/counts.

Get one incident

curl https://argavon.com.com/api/v1/incidents/inc-3f2a9c... \
  -H "Authorization: Bearer $NEUROOPS_TOKEN"

The response has the incident under incident, its alerts under events and its status history under status_audit. GET /api/v1/incidents/activity/{id} returns the timeline, newest first, and GET /api/v1/incidents/explain/{id} returns the root-cause analysis with its tier in provenance (see Root-cause analysis and AI).

Acknowledge, resolve or reopen

These need the operator role and take no body. They return the updated incident.

curl -X POST https://argavon.com.com/api/v1/incidents/inc-3f2a9c.../ack \
  -H "Authorization: Bearer $NEUROOPS_TOKEN"

curl -X POST https://argavon.com.com/api/v1/incidents/inc-3f2a9c.../resolve \
  -H "Authorization: Bearer $NEUROOPS_TOKEN"

curl -X POST https://argavon.com.com/api/v1/incidents/inc-3f2a9c.../reopen \
  -H "Authorization: Bearer $NEUROOPS_TOKEN"

Assign an incident

Operator role. user_id must be an active member of the workspace; an empty string unassigns.

curl -X PUT https://argavon.com.com/api/v1/incidents/inc-3f2a9c.../assignee \
  -H "Authorization: Bearer $NEUROOPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"user_id": "usr-8c1d..."}'

The response has incident_id, assignee_id, assignee_email and assigned_at.

Page someone

Operator role. First find the person's id, and whether they can be reached:

curl https://argavon.com.com/api/v1/directory/users \
  -H "Authorization: Bearer $NEUROOPS_TOKEN"

Each item has id, email, role and reachable (whether they have a notification rule on a verified contact method). Then page them:

curl -X POST https://argavon.com.com/api/v1/incidents/inc-3f2a9c.../page \
  -H "Authorization: Bearer $NEUROOPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"user_id": "usr-8c1d..."}'

The response says how many notifications were queued:

{
  "incident_id": "inc-3f2a9c...",
  "user_id": "usr-8c1d...",
  "queued": 2,
  "deliveries": [ "..." ]
}

When queued is 0, reason says why, for example that the person has no verified contact method. Paging the same person again for the same incident within the same 10-minute window does not page them twice. Sample incidents cannot be paged. If the incident has no owner, the person paged becomes its owner.

Create a source

Operator role. type is one of prometheus, grafana, zabbix, otel or jaeger.

curl -X POST https://argavon.com.com/api/v1/sources \
  -H "Authorization: Bearer $NEUROOPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "prod-alertmanager", "type": "prometheus"}'

The response (201) includes token and the endpoint to send alerts to. The token is shown only here; list responses leave it out. POST /api/v1/sources/{id}/rotate issues a new token, and DELETE /api/v1/sources/{id} removes the source. See Send alerts.

Create a silence

Silences are called mutes in the API. Admin role. A mute lasts 7 days.

curl -X POST https://argavon.com.com/api/v1/mutes \
  -H "Authorization: Bearer $NEUROOPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "alert_names": ["CertExpiry"],
        "devices": ["all"],
        "service": "lb",
        "reason": "Certificate renewal in progress, ticket OPS-412",
        "end_on_resolve": true
      }'
Field Notes
alert_names Required. Alert names, or ["all"].
devices Required. Devices, or ["all"].
service, environment Optional narrowing.
value_min, value_max Optional value range.
reason Required, up to 500 characters.
incident_id Optional: the incident the mute is for.
end_on_resolve End the mute as soon as a matching alert recovers.

A mute that would match every alert (all names, all devices, no service and no environment) is refused. POST /api/v1/mutes/preview with the same body tells you how many alerts from the last 7 days it would have caught. See Silences.