Events API¶
Send one event at a time from a script, a cron job or a tool Argavon has no built-in source for.
POST /api/v1/events takes a small JSON event and runs it through the same
correlation as alerts from the other sources. It does not use a source token:
you authenticate as a user or with an API key.
Before you start¶
You need an API key (or a signed-in user) with the operator or admin role. Viewers can list events but not create them.
Create a key under API keys (in the Admin section; admins only). Keys
start with nok_. See Users, invites and API keys.
Send it as:
Authorization: Bearer nok_…
Fields¶
| Field | Required | Meaning |
|---|---|---|
service |
yes | The service the event is about. Incidents are grouped by service. |
message |
yes | What happened. |
severity |
no | critical, high, medium or low. Common words from other tools are mapped the same way as for every other source: fatal, emergency, p0 become critical; error, major, p1 high; warning, average, p2 medium; info, minor, debug and unknown words low. Nothing at all becomes medium. |
title |
no | Incident title. If empty, the first 120 characters of message are used. |
source |
no | Free text, for example the script name. |
type |
no | Free text, for example alert. |
resource |
no | The host, pod or other thing affected. |
environment |
no | For example prod. |
labels |
no | String-to-string map, kept on the event. |
timestamp |
no | RFC 3339 time. Default: now. |
external_id |
no | Your tool's id for this alert. Needed if you want to close it later (below). |
alert_status |
no | resolved to report that the alert with this external_id has cleared (below). |
id |
no | Your own event ID. Default: event-<16 hex>. Do not reuse IDs: an ID that already exists in your workspace updates the stored event instead of adding a new one. |
tenant_id in the body is ignored: the workspace always comes from your key.
Note
info is not accepted here and becomes medium. The webhook sources do
accept info.
Limits: one JSON object per request, at most 1 MiB. Your workspace's request
limits apply (429 mutation rate limit exceeded — retry after 60 seconds).
Example¶
curl -sS -X POST https://argavon.com.com/api/v1/events \
-H "Authorization: Bearer $NEUROOPS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"service": "nightly-backup",
"severity": "high",
"title": "Nightly backup failed",
"message": "pg_dump exited with code 1: connection refused",
"source": "backup-cron",
"type": "alert",
"resource": "db01",
"environment": "prod",
"labels": {"team": "platform", "job": "pg_dump"}
}'
Response, 201 Created:
{
"event": {
"id": "event-4f1c9a2b7d3e8a60",
"tenant_id": "…",
"source": "backup-cron",
"external_id": "",
"service": "nightly-backup",
"resource": "db01",
"environment": "prod",
"severity": "high",
"type": "alert",
"title": "Nightly backup failed",
"message": "pg_dump exited with code 1: connection refused",
"labels": {"job": "pg_dump", "team": "platform"},
"timestamp": "2026-11-04T02:00:03.123456789Z",
"fingerprint": ""
},
"duplicate": false
}
fingerprint in the response is empty. Argavon computes it during
correlation, after the response is built.
Open Incidents: a high-severity incident Nightly backup failed on
nightly-backup appears, or the event joins an open incident for that service
from the last 5 minutes.
Duplicates¶
If your workspace already has an event with the same service, severity and
message (ignoring case) within 30 seconds of this one's timestamp, nothing
new is stored. The existing event is correlated again and you get
200 OK:
{
"event": { "id": "event-4f1c9a2b7d3e8a60", "…": "…" },
"duplicate": true,
"duplicate_of": "event-4f1c9a2b7d3e8a60"
}
So a script that retries on a network error does not open two incidents.
Closing incidents¶
If your tool knows when a problem clears, send the firing event with an
external_id, and later the same service and message with the same
external_id and "alert_status": "resolved":
curl -s -X POST https://argavon.com.com/api/v1/events \
-H "Authorization: Bearer $NEUROOPS_KEY" -H "Content-Type: application/json" \
-d '{"service":"backup","message":"Nightly backup failed","external_id":"backup-2026-11-05","alert_status":"resolved"}'
The answer is 200 with "resolved": true. The alert is marked recovered and
never opens a new incident. When every alert of the incident has recovered and
stays quiet for the quiet period, the incident closes itself, as described in
auto-close.
Events sent without an external_id cannot be closed this way. Resolve those
incidents by hand on the Incidents page.
If it does not work¶
| You see | Fix |
|---|---|
401 missing or malformed authorization header |
Add Authorization: Bearer <key>. |
401 invalid, revoked or expired API key |
Create a new key. |
403 role 'viewer' does not have permission; requires 'operator' or higher |
Use a key with the operator or admin role. |
400 service is required / message is required |
Add the missing field. Blank strings count as missing. |
400 a resolved message needs the external_id its firing event had |
Add external_id. |
404 no firing event with this external_id |
The firing event was sent without that external_id, or to another workspace. |
400 invalid JSON body |
Check the JSON. Field types matter: labels values must be strings, timestamp must be RFC 3339. |
400 request body must contain a single JSON value |
Send one object per request. |
413 request body too large |
Keep the body under 1 MiB. |
429 |
Slow down; retry after 60 seconds. |
See the API guide for authentication and the full route index.