LastPing Incidents API

The Incidents API from LastPing — 2 operation(s) for incidents.

GitHub OpenAPI

Operations 2

POST /api/v1/incidents/{id}/notes Write back what you found out about an incident #
GET /api/v1/incidents/{id} One incident with its recorded timeline #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/lastping-dev:lastping-dev-incidents-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

lastping-dev-incidents-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: LastPing Management Incidents API
  version: '1.0'
  description: 'The LastPing Management API lets you create, configure, and manage uptime

    checks for your project. All mutating endpoints require a valid API key

    supplied in the `X-Api-Key` request header.


    ## MCP server for AI agents


    LastPing ships an MCP (Model Context Protocol) server so AI agents can

    create and manage monitors, query incidents, and set up their own

    dead-man''s-switch — all in one conversation. The hosted server is at

    `https://mcp.lastping.dev/mcp`; connect with `Authorization: Bearer `.

    See lastping.dev/mcp/ for setup instructions

    and the full tool list.'
  contact:
    url: https://lastping.dev
servers:
- url: /
  description: Management API (relative path — prepend your host)
security: []
tags:
- name: Incidents
paths:
  /api/v1/incidents/{id}/notes:
    parameters:
    - name: id
      in: path
      required: true
      description: 'The incident''s numeric id, taken straight from an inbox entry''s

        `incident_id` (`GET /api/v1/agents/{id}/open-incidents`).

        '
      schema:
        type: integer
        format: int64
      example: 4821
    post:
      operationId: addIncidentNote
      summary: Write back what you found out about an incident
      description: 'The **push** half of failure delivery, and the reason the inbox is

        worth reading. Instead of "check failed at 03:04", the person who gets

        paged reads *"failed because the upstream API returned 503; same

        failure as the last three nights; I retried twice and stopped."*


        Notes appear on the incident''s page in the dashboard, attributed to

        their author, in the order they were written.


        **Send one whether or not you fixed the problem.** With no note, an

        incident is indistinguishable from one nobody has looked at yet — so

        an agent that writes back only its successes leaves a record that is

        worse than none. "Could not reproduce, gave up after two attempts" is

        a finding.


        **Notes are append-only.** There is no endpoint to edit one and none

        to delete one, by design: a diagnosis that can be rewritten is not

        evidence, and a reader has to be able to trust that a note still says

        what it said when it was written. Corrections are made by appending

        another note. Storage enforces this too: a stored note cannot be

        changed.


        **Authorship is not yours to choose.** The request body has no

        `author` field. Authorship is derived from how the caller

        authenticated: a session principal (a person in the dashboard) is

        stored as `user`; an API key (a machine) is stored as `agent`. A

        reader must never be misled about who diagnosed what, and an endpoint

        whose caller could name its own author would make the distinction

        meaningless.


        Notes may be added to a **closed** incident on purpose: the run that

        finally succeeded is usually the one that understood why the previous

        one did not, and refusing the note would lose the explanation exactly

        when it became available.


        At most 50 notes per incident.'
      tags:
      - Incidents
      security:
      - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IncidentNoteCreate'
      responses:
        '201':
          description: The stored note.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IncidentNote'
        '400':
          description: 'The id is not a positive integer, the JSON is malformed, or the

            body is empty, whitespace-only, or over 8192 bytes.

            '
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '401':
          description: Missing or invalid API key.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: 'No such incident **in this project**. An incident belonging to

            another project answers exactly the same way as one that does not

            exist, so this endpoint cannot be used to probe for other tenants''

            incident ids.

            '
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '409':
          description: This incident already has the maximum of 50 notes.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
  /api/v1/incidents/{id}:
    parameters:
    - name: id
      in: path
      required: true
      description: The incident's numeric id (`incident_id` on any incident list).
      schema:
        type: integer
        format: int64
      example: 4821
    get:
      operationId: getIncident
      summary: One incident with its recorded timeline
      description: 'What the run was doing, when the failure was declared, which alerts

        went out and to whom, what was written back, and when it resolved —

        as an ordered list of recorded events. Nothing is inferred; see

        `IncidentEvent`.'
      tags:
      - Incidents
      security:
      - ApiKeyAuth: []
      responses:
        '200':
          description: The incident and its events, oldest first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IncidentDetail'
        '400':
          description: The id is not a positive integer.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '401':
          description: Missing or invalid API key.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: No such incident in this project.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
components:
  schemas:
    IncidentNote:
      type: object
      description: 'One note on an incident: what an agent learned about a failure, in its

        own words. Returned by `POST /api/v1/incidents/{id}/notes` and rendered

        on the incident page in the dashboard.

        '
      required:
      - id
      - incident_id
      - author
      - body
      - created_at
      properties:
        id:
          type: integer
          format: int64
          example: 917
        incident_id:
          type: integer
          format: int64
          description: The incident this note is about.
          example: 4821
        author:
          type: string
          enum:
          - agent
          - user
          description: 'Who wrote it. Decided by the surface the note arrived on, never by

            the caller: a session principal (a person in the dashboard) is

            `user`; an API key (a machine) is `agent`.

            '
          example: agent
        body:
          type: string
          example: Upstream billing API returned 503 on all three retries; same failure as the last two nights. I stopped rather than risk re-charging anyone.
        created_at:
          type: string
          format: date-time
          description: RFC 3339 UTC timestamp, stamped by the server.
          example: '2026-08-23T03:19:44Z'
    IncidentEvent:
      type: object
      description: 'One recorded event on an incident''s timeline. Only the fields that

        belong to `kind` are present; every other field is omitted, never

        null or zero. Nothing here is inferred: runs are matched to the

        incident by the run id recorded when it opened, alerts by the

        incident''s own delivery key, and the closing side by the instant

        it closed: `recovery_ping` is the success ping that closed it and

        the `recovery` alerts are the all-clear that ping sent. An incident

        closed any other way has neither. `acknowledged` is the first time

        a signed-in person acknowledged the incident; a notification mute

        has no event (only its current end, `muted_until`, is recorded).

        `fallback_notice` is the notice sent to the project''s fallback

        destination because one of the incident''s alerts gave up; it is never

        one of the incident''s own alerts.

        '
      required:
      - at
      - kind
      properties:
        at:
          type: string
          format: date-time
        kind:
          type: string
          enum:
          - run_started
          - step
          - run_failed
          - run_cancelled
          - run_blocked
          - incident_opened
          - alert_delivered
          - alert_failed
          - alert_suppressed
          - alert_pending
          - fallback_notice
          - note
          - acknowledged
          - recovery_ping
          - incident_resolved
        rid:
          type: string
          description: '`run_started` and `recovery_ping`. The run id the job chose; raw job input.'
        title:
          type: string
          description: '`run_started` only. The body posted with `/start`, when one was; raw job output.'
        seq:
          type: integer
          description: '`step` only.'
        name:
          type: string
          description: '`step` only. The step name the job reported; raw job output.'
        exit_code:
          type: integer
          description: '`run_failed` / `run_cancelled` / `run_blocked`, when the ping reported one. Also `incident_opened`, from the failed ping that opened the incident, when no run event carries that ping.'
        duration_ms:
          type: integer
          format: int64
          description: Terminal run events and `recovery_ping`, when the run paired with its `/start`.
        body_excerpt:
          type: string
          description: Terminal run events and `recovery_ping`. What the run printed; raw job output. Also `incident_opened`, from the failed ping that opened the incident, when no run event carries that ping (for example a ping sent without a run id).
        cause:
          type: string
          description: '`incident_opened` only. Same vocabulary as `Incident.cause`.'
        detail:
          type: string
          description: '`incident_opened` only. CI failure detail, when captured.'
        event_type:
          type: string
          description: '`alert_*` only. The alert event type delivered: the alert sent when the incident opened (for example `down` or `fail`), `reminder`, a reminder sent while it stayed open, or `recovery`, the all-clear sent when the incident closed.'
        channel_id:
          type: string
          format: uuid
          description: '`alert_*` and `fallback_notice`.'
        channel_name:
          type: string
          description: '`alert_*` and `fallback_notice`. `(removed)` when the destination has since been deleted.'
        attempts:
          type: integer
          description: '`alert_*` and `fallback_notice`. Failed delivery attempts. The last error text is never exposed.'
        status:
          type: string
          enum:
          - delivered
          - dead
          - pending
          - suppressed
          description: '`fallback_notice` only. `delivered` means the fallback destination accepted it.'
        author:
          type: string
          enum:
          - agent
          - user
          description: '`note` and `acknowledged`. Always `user` on `acknowledged`: only a signed-in person can acknowledge.'
        body:
          type: string
          description: '`note` only. The note''s text.'
    Problem:
      type: object
      description: RFC 7807 problem detail returned on errors (Content-Type application/problem+json).
      properties:
        type:
          type: string
          description: URI identifying the problem type.  Currently always "about:blank".
          example: about:blank
        title:
          type: string
          description: Short human-readable summary of the problem type.
          example: Not Found
        status:
          type: integer
          description: HTTP status code.
          example: 404
        detail:
          type: string
          description: Human-readable explanation specific to this occurrence.
          example: check not found
        engine:
          type: string
          description: Always "lastping".
          example: lastping
        service_version:
          type: string
          description: Running version of the api service.
          example: dev
        request_id:
          type: string
          description: Echo of X-Request-Id header (or a generated UUID when absent).
          example: b5d3f2a1-0c7e-4b8d-a991-f3e0c2d1a4b7
        code:
          type: string
          description: 'Machine-readable, SCREAMING_SNAKE_CASE error code (e.g.

            `MONITOR_NOT_FOUND`, `SESSION_ONLY`, `CSRF_REQUIRED`,

            `READ_ONLY_IMPERSONATION`, `IMPERSONATION_UNAVAILABLE`,

            `VIEW_AS_CHANGED`, `INVALID_SCHEDULE`). Omitted for the small set of errors that

            predate this convention and never got one. A client should branch

            on `code`, not on `detail`''s prose, which may change wording

            without notice.

            '
          example: MONITOR_NOT_FOUND
        fix:
          type: string
          description: 'One-sentence, human-readable remediation for this `code` — what

            to send instead, or what to do next. Omitted when `code` is

            omitted.

            '
          example: Verify the check id belongs to your project; use GET /api/v1/checks to list your monitors.
    IncidentNoteCreate:
      type: object
      description: 'Body for `POST /api/v1/incidents/{id}/notes`.


        One field, deliberately. There is no `author` — see the endpoint''s own

        description — and no timestamp: the server stamps the note, so its

        position in the incident''s log cannot be back-dated by its writer.

        '
      required:
      - body
      properties:
        body:
          type: string
          maxLength: 8192
          description: 'What you found out, in two or three sentences: what you saw, what

            you tried, and where you stopped. Not a log dump — the failing

            run''s own output is already stored and already shown beside your

            note.


            Must not be empty or whitespace-only (400). Bodies over 8192 bytes

            are **rejected, not truncated** (400): a truncated diagnosis reads

            as a complete one that trails off, and the reader has no way to

            tell that the sentence naming the cause was the one cut.

            '
          example: Upstream billing API returned 503 on all three retries; same failure as the last two nights. I stopped rather than risk re-charging anyone.
    IncidentDetail:
      type: object
      description: One incident with its recorded timeline.
      required:
      - incident_id
      - check_id
      - check_slug
      - check_name
      - kind
      - cause
      - opened_at
      - closed_at
      - run_id
      - acknowledged_at
      - acknowledged_by
      - muted_until
      - missed_at
      - missed_by
      - events
      properties:
        incident_id:
          type: integer
          format: int64
        check_id:
          type: string
          format: uuid
        check_slug:
          type: string
        check_name:
          type: string
        kind:
          type: string
          enum:
          - cron
          - ci
          - http
          - agent
          description: The monitor's kind, as the console shows it and as `?kind=` on `GET /api/v1/incidents` filters it.
          example: agent
        cause:
          type: string
        opened_at:
          type: string
          format: date-time
        closed_at:
          type:
          - string
          - 'null'
          format: date-time
        detail:
          type: string
          description: Omitted when empty.
        run_id:
          type: string
          description: 'The run the incident is about, recorded when it opened. An empty

            string means no run was recorded (the monitor never sent `/start`,

            or the incident predates run tracking); the timeline then carries

            no `run_started`, `step` or `run_*` events, which is a fact about

            the record, not an anomaly.

            '
        acknowledged_at:
          type:
          - string
          - 'null'
          format: date-time
          description: 'When a signed-in person first acknowledged the incident; null

            while unacknowledged. Acknowledging leaves the incident open, and

            a later acknowledge does not change it.

            '
          example: '2026-07-10T03:14:00Z'
        acknowledged_by:
          type:
          - string
          - 'null'
          description: 'The email of the person who acknowledged the incident. Null while

            unacknowledged, and null once that account is deleted

            (`acknowledged_at` stays).

            '
          example: ops@example.com
        muted_until:
          type:
          - string
          - 'null'
          format: date-time
          description: 'The incident''s notification mute: until this time its failure,

            down, blocked and reminder notifications are recorded as

            suppressed and not sent; its recovery notification is always

            sent. Null when no mute was set or it was cleared, and always

            null on a resolved incident (resolving clears it); a time in

            the past is a mute that has ended. A mute never resolves the

            incident.

            '
          example: '2026-07-10T05:00:00Z'
        missed_at:
          type:
          - string
          - 'null'
          format: date-time
          description: 'For an incident about silence (`silence` or `never_started`),

            the deadline the monitor''s quiet crossed, recorded when the

            incident opened: its schedule''s expected time plus its grace, or

            its last ping plus `expect_every_s`, whichever came first.

            Editing the monitor afterwards does not change it. Null for every

            other cause.

            '
          example: '2026-07-10T03:10:00Z'
        missed_by:
          type:
          - string
          - 'null'
          enum:
          - grace
          - floor
          - null
          description: 'Which rule set `missed_at`: `grace` when the schedule''s expected

            time plus its grace came first, `floor` when `expect_every_s`

            did. Null whenever `missed_at` is null.

            '
          example: grace
        events:
          type: array
          items:
            $ref: '#/components/schemas/IncidentEvent'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 'Project API key.  Obtain from your LastPing project settings.


        **Every key carries a scope**, which is what it is permitted to do:


        | Scope | Reaches |

        | --- | --- |

        | `read` | Every `GET`. |

        | `write` | Everything except API key management — the default for a new key. |

        | `admin` | Everything, including `/api/v1/api-keys`. |


        A request whose key ranks below an operation''s requirement is refused

        with `403` and a problem body carrying `required_scope`, the tier the

        operation needed. The rule is uniform: `GET` needs `read`, every other

        method needs `write`, and the three `/api/v1/api-keys` operations need

        `admin` — the list included, since key names, prefixes and lineage are

        what a caller needs in order to choose which key to revoke.


        Keys created before scopes existed are `admin`, so nothing that worked

        before this was introduced stops working. Enforcement of this refusal

        is switched on separately from the scope existing on a key.

        '
    BearerAuth:
      type: http
      scheme: bearer
      description: 'Project API key presented as a Bearer token.

        Accepted as an alternative to the X-Api-Key header, specifically

        to allow Prometheus scrape_config `authorization: { credentials: … }`.

        '
    SessionCookie:
      type: apiKey
      in: cookie
      name: lp_session
      description: 'The signed-in browser session, set by the sign-in flow at

        `/auth/login`. It is `HttpOnly`, `Secure` and `SameSite=Lax`, so it

        cannot be read by script and is not a credential you can obtain or

        store the way an API key is.


        A handful of operations accept **only** this, and refuse an API key of

        any scope with `403 SESSION_ONLY`. They act on a PERSON rather than on a

        project (`/api/v1/me/password`, `/api/v1/me/email`,

        `/api/v1/me/delete`), or they hand a stored credential back to the

        person who owns it. Those operations name `SessionCookie` and nothing

        else, so a client generated from this document does not offer a key

        where a key cannot work.


        Every write made with this cookie also needs the CSRF double-submit

        header: send the `lp_csrf` cookie''s value in `X-CSRF-Token` on `POST`,

        `PUT`, `PATCH` and `DELETE`, or the request is refused `403

        CSRF_REQUIRED`.


        While an admin is viewing an account read only, every write made with

        this cookie is refused `403 READ_ONLY_IMPERSONATION`. If the view-as

        state cannot be read, the request is answered `503

        IMPERSONATION_UNAVAILABLE` and nothing is served or written.


        The console sends `X-LP-View-As: <user id>` on every write while it

        believes it is viewing an account (the `user_id` GET /api/v1/me

        reported with `viewing_as` set). A write carrying that header when no

        view-as is active, or when the active one is of a different account,

        is refused `409 VIEW_AS_CHANGED` and nothing is written: the page''s

        picture of the session is stale, and it should re-read GET

        /api/v1/me. With a matching view-as the write is still refused `403

        READ_ONLY_IMPERSONATION`. Other clients never need to send it.

        '