API and AI agents
Open and work on mlab.sh incidents from the REST API, an MCP client such as Claude, and webhooks: endpoints, permissions, the deadline keys and events.
REST API
Base URL https://mlab.sh/api/v1, with an API key: Authorization: token mlab_… (see API keys). Every incident route is a POST with a JSON body and needs the key permission cases.write (reading an incident with /cases/detail needs cases.read). Work done by a key shows as "API key" in the timeline.
| Route | What it does |
|---|---|
/cases/incident/create | Opens an incident: title (required), summary, type, severity (1 to 4), detected_at, is_test. Returns its uuid. |
/cases/incident/promote | Makes an open case an incident (uuid, optional severity, type). Team and Enterprise. |
/cases/incident/update | Changes any field: phase, severity, type, owner_uuid, the dates, the scope (personal_data, nis2, financial), the post-mortem (root_cause, impact, lessons), tags, external_ref, tlp, mitre, the impact figures, and to close: resolution and closing_note. Returns the incident. |
/cases/incident/event | Writes a timeline entry: body, optional occurred_at. |
/cases/incident/notify | Records a notice: deadline and notified_at, reference; or decision: "not_required" with a reason; or undo: true. |
/cases/incident/qualify | Records a NIS2 or DORA qualification: framework, answers, rationale. |
/cases/incident/communication | Records whether the people concerned were told. |
/cases/incident/notice | Adds, marks sent, unmarks or deletes an extra notice (action). |
/cases/incident/task | Adds, completes, updates or deletes a task (action). |
/cases/incident/asset | Adds an affected asset, changes its status, deletes it (action). |
/cases/incident/merge | Merges a duplicate (uuid) into another incident (into). |
/cases/incident/file/delete | Removes an attached file. |
/cases/detail | Reads an incident: the case, plus kind, incident, deadlines and timeline. On every plan. |
Reading the incident list (GET /cases) is part of the Team and Enterprise plans. API keys cannot change the incident settings or first tasks, ask Capri, follow an incident, or upload and download files: those stay with a member signed in to the app. Bodies, fields and errors: the API reference.
Deadline keys: gdpr, nis2_early, nis2_notification, nis2_final, dora_initial, dora_intermediate, dora_final. Dates are YYYY-MM-DD HH:MM, UTC.
Open an incident from your SIEM
curl -s -X POST https://mlab.sh/api/v1/cases/incident/create \
-H "Authorization: token $MLAB_API_KEY" -H "Content-Type: application/json" \
-d '{"title":"Impossible travel on j.doe","type":"account_compromise","severity":2}'Then add indicators with /cases/indicator/add, as on any case.
AI agents (MCP)
The MCP server has five incident tools, on every plan. They act as you, with your role.
| Tool | What it does | Group |
|---|---|---|
get_incident | Reads an incident: deadlines, timeline, indicators. | Read incidents |
open_incident | Opens one, with title, summary, type, severity, detected_at, and indicators (one per line). | Work on incidents |
update_incident | Changes the phase, severity, type, dates, scope and post-mortem. | Work on incidents |
add_incident_entry | Writes a timeline entry. | Work on incidents |
mark_incident_notice | Records a notice as sent, with its date and reference. | Work on incidents |
An agent cannot close an incident, record a notice as not required, or work on tasks, assets and files: those stay with you.
Webhooks and alerts
| Event | When |
|---|---|
incident.opened | An incident was opened, from any page, the API, a flow or an agent. |
incident.severity | Its severity changed. |
incident.phase | It moved to another phase. |
incident.closed | It was closed. |
incident.attention | An S1 or S2 without an owner an hour after opening, no activity for a week, an overdue task or extra notice. |
incident.deadline | A GDPR, NIS2 or DORA notice not marked as sent: halfway, 6 hours and 1 hour before it is due, once overdue. |
incident.update | Emailed to the members following an incident, never to webhooks. |
Test incidents send no opened, severity, phase or closed event. Email rules can pick incident.opened, incident.closed, incident.attention and incident.deadline. Payloads: Webhooks › Incidents.
Reporting duties
GDPR art. 33, NIS2 art. 23 and DORA deadlines computed for each incident, reminders before they pass, NIS2 significant and DORA major qualification, notice drafts, the GDPR breach register, and telling the people concerned.
Workspaces
Investigate data that stays on your hosts: on-site agents run the analysis where the data is, and mlab.sh only sees the answers.