Skip to Content
mlab docs

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.

RouteWhat it does
/cases/incident/createOpens an incident: title (required), summary, type, severity (1 to 4), detected_at, is_test. Returns its uuid.
/cases/incident/promoteMakes an open case an incident (uuid, optional severity, type). Team and Enterprise.
/cases/incident/updateChanges 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/eventWrites a timeline entry: body, optional occurred_at.
/cases/incident/notifyRecords a notice: deadline and notified_at, reference; or decision: "not_required" with a reason; or undo: true.
/cases/incident/qualifyRecords a NIS2 or DORA qualification: framework, answers, rationale.
/cases/incident/communicationRecords whether the people concerned were told.
/cases/incident/noticeAdds, marks sent, unmarks or deletes an extra notice (action).
/cases/incident/taskAdds, completes, updates or deletes a task (action).
/cases/incident/assetAdds an affected asset, changes its status, deletes it (action).
/cases/incident/mergeMerges a duplicate (uuid) into another incident (into).
/cases/incident/file/deleteRemoves an attached file.
/cases/detailReads 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.

ToolWhat it doesGroup
get_incidentReads an incident: deadlines, timeline, indicators.Read incidents
open_incidentOpens one, with title, summary, type, severity, detected_at, and indicators (one per line).Work on incidents
update_incidentChanges the phase, severity, type, dates, scope and post-mortem.Work on incidents
add_incident_entryWrites a timeline entry.Work on incidents
mark_incident_noticeRecords 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

EventWhen
incident.openedAn incident was opened, from any page, the API, a flow or an agent.
incident.severityIts severity changed.
incident.phaseIt moved to another phase.
incident.closedIt was closed.
incident.attentionAn S1 or S2 without an owner an hour after opening, no activity for a week, an overdue task or extra notice.
incident.deadlineA GDPR, NIS2 or DORA notice not marked as sent: halfway, 6 hours and 1 hour before it is due, once overdue.
incident.updateEmailed 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.

On this page