Skip to content

Services

GET /v1/services

List all services that have sent at least one ContextEvent.

curl https://api.noctuary.io/v1/services \
  -H "Authorization: Bearer noc_ro_your_key"

Response: 200 OK

[
  {
    "id": "a8d4e91c-...",
    "tenant_id": "5f0bfa6c-...",
    "agent_id": "b569e0bd-...",
    "name": "payments-api",
    "last_event_at": "2026-05-31T02:14:41Z"
  },
  {
    "id": "c7f3b82d-...",
    "tenant_id": "5f0bfa6c-...",
    "agent_id": "b569e0bd-...",
    "name": "auth-service",
    "last_event_at": "2026-05-31T02:12:03Z"
  }
]

Services are created automatically when an event is ingested with a new service_name. There is no explicit create endpoint.


GET /v1/services/{id}/context

Get the current state window for a service — the rolling buffer of recent ContextEvents used for incident correlation.

curl https://api.noctuary.io/v1/services/{id}/context \
  -H "Authorization: Bearer noc_ro_your_key"

Response: 200 OK

{
  "service": "payments-api",
  "deploy_events": [
    {
      "event_type": "deploy",
      "vendor": "argocd",
      "entity": "payments-api",
      "old_value": null,
      "new_value": "syncing:a4f2c1",
      "actor": null,
      "timestamp": "2026-05-31T02:10:41Z"
    }
  ],
  "restart_events": [],
  "saturation_events": [
    {
      "event_type": "saturation",
      "vendor": "postgres",
      "entity": "payments.public.payments",
      "old_value": null,
      "new_value": "deadlock",
      "timestamp": "2026-05-31T02:14:33Z"
    }
  ],
  "updated_at": "2026-05-31T02:14:33Z"
}

Events in the state window have already been filtered by TTL — expired events are not returned.