Getting started
Create a key, check it, send a first event and read your data back.
Four steps, about ten minutes. You need somebody in your organisation who can sign in to the NexGuard console with the api_keys:manage permission; an administrator can grant it.
1. Create a key
- Sign in to the console and open Settings → Developers & API.
- Create a key. Give it a name that says which system will hold it.
- Tick send events if this key will send events. It is off unless you ask for it.
- Choose read scopes if it will read:
incidents:read,alerts:read,security_score:read,security_events:read. A key with no scopes can read nothing. - Copy the key. It is shown once; only a hash is stored, so a lost key is rotated, never recovered.
The hosted service's base URL is https://securiteagi.com, and the samples below already use it. If your organisation has its own hostname, Settings → Developers & API shows it; use that instead.
Put the key in your backend's secret store as NEXGUARD_API_KEY. Never in browser or mobile code: anything a browser can read, anybody who opens the page can read.
2. Check the key
GET /api/v1/public/identity needs no scope and describes the key you are holding: its organisation, scopes, expiry and read rate limit. It confirms the key works before anything depends on it.
curl -sS "https://securiteagi.com/api/v1/public/identity" \
-H "X-API-Key: $NEXGUARD_API_KEY"{
"api_key_id": "5b0e9a52-…",
"tenant_id": "c41f07d8-…",
"scopes": ["alerts:read", "incidents:read"],
"expires_at": null,
"rate_limit_per_minute": 120
}3. Send a first event
POST /api/v1/events takes one event. The key must have been created with send events. occurred_at must carry a timezone offset and be within the last 48 hours.
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
curl -sS -X POST "https://securiteagi.com/api/v1/events" \
-H "X-API-Key: $NEXGUARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"schema_version": "1.0",
"event_id": "login-first-test-8f21",
"event_type": "LOGIN_SUCCESS",
"occurred_at": "'"$NOW"'",
"source": "portal-web",
"subject": { "type": "user", "id": "user-42" },
"payload": { "ip": "203.0.113.7", "device_id": "d-1" }
}'The answer is 202 Accepted: the event is stored and queued for detection, not analysed while you wait.
{
"accepted": 1,
"duplicates": 0,
"rejected": 0,
"events": [
{ "event_id": "login-first-test-8f21", "duplicate": false, "stored_id": "9e3b…" }
]
}Send the same request again and it answers "duplicate": true with "stored_id": null: nothing is stored or raised twice.
4. Read your data back
There is no public endpoint that returns raw events. What you read back is what detection made of them — alerts, and the incidents they were grouped into:
curl -sS "https://securiteagi.com/api/v1/public/incidents?limit=10" \
-H "X-API-Key: $NEXGUARD_API_KEY"One successful sign-in will not raise anything, and an empty list is a real answer. To see that the event itself arrived, open Live activity in the console, or run the Python SDK's doctor.