LastPing Monitors API

The Monitors API from LastPing — 1 operation(s) for monitors.

GitHub OpenAPI

Operations 1

GET /api/v1/checks/{id}/trace-diagnostics Trace ingest diagnostics for one monitor #

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-monitors-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-monitors-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: LastPing Management Monitors 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: Monitors
paths:
  /api/v1/checks/{id}/trace-diagnostics:
    parameters:
    - name: id
      in: path
      required: true
      description: The monitor's id.
      schema:
        type: string
        format: uuid
      example: 550e8400-e29b-41d4-a716-446655440000
    get:
      operationId: getTraceDiagnostics
      summary: Trace ingest diagnostics for one monitor
      description: 'Why traces, metrics or logs sent to this monitor did or did not

        arrive: the newest 20 ingest attempts (refusals and routine drops

        with a reason code, and accepted batches; kept 7 days), the newest

        accepted attempt, and

        a summary of the monitor''s newest traced run.


        Call it after sending a test span, or whenever an exporter is

        configured and nothing shows up. Two failures leave no attempt at

        all, because neither reaches a point where LastPing knows which

        project the request belongs to: an exporter using gRPC against the

        OTLP gRPC port, and a missing or wrong key. An empty `attempts` list

        means check those two first.


        This is what the MCP `get_trace_diagnostics` tool returns. 404 if the

        monitor does not exist in the authenticated project (no existence

        oracle).'
      tags:
      - Monitors
      security:
      - ApiKeyAuth: []
      responses:
        '200':
          description: The diagnostics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceDiagnostics'
        '400':
          description: The id is not a UUID.
          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'
        '403':
          $ref: '#/components/responses/InsufficientScope'
        '404':
          description: Monitor not found in this project.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    IngestAttempt:
      type: object
      description: One entry of a monitor's trace ingest ledger (kept 7 days).
      required:
      - at
      - outcome
      - reason
      - span_count
      - bytes
      - protocol
      - user_agent
      - signal
      properties:
        at:
          type: string
          format: date-time
          example: '2026-09-21T16:40:12Z'
        outcome:
          type: string
          enum:
          - accepted
          - refused
          - dropped
          description: 'accepted: the batch was stored (reason is empty). refused: the

            export was rejected, or some or all of it was not kept for a

            reason worth fixing; see reason. dropped: the request was answered 202 and kept

            nothing, for a routine reason; nothing to fix.

            '
          example: refused
        reason:
          type: string
          description: 'A code, empty when accepted.


            A refused request, answered with a 4xx or 5xx:

            `unsupported_media_type`, `body_too_large`, `too_many_spans`

            (traces), `too_many_records` (more than 1,024 metric data points or

            log records), `unknown_monitor`, `expired_key`, `wrong_scope`,

            `wrong_project`, `monitor_mismatch`, `over_budget` (the shared

            daily budget), `over_log_budget` (the daily log event cap, logs

            only), `rate_limited`, `busy` (every OTLP slot was taken,

            answered 429 `OTLP_BUSY`) or `malformed`.


            A traces request answered 202 that kept nothing, with the outcome

            refused (the sending machine''s clock needs fixing):

            `future_start` (every span started more than an hour after

            ingest received it).


            A metrics or logs request answered 202 that kept nothing, one row

            per reason, with the outcome dropped (routine, nothing to fix):

            `unknown_event` (a log event LastPing does not keep),

            `unknown_metric` (a metric family LastPing does not keep),

            `cumulative_temporality` (a cumulative data point; only delta is

            summed) or `invalid_point` (a data point with no usable value or

            token type, or past the 16 model series one request may add). A

            request that kept anything writes none of these.


            `too_many_series` is different, and its outcome is refused: it is

            written later, when the metrics are stored, after ingest has

            already answered 202. The owner (the agent, or the monitor)

            already had 200 new model series that day, so the data points of

            any further new series were not kept. It is written whenever that

            happens, even when the same request stored its other data points,

            at most once a minute per monitor. A model series the owner

            recorded in the seven days before is not new and is kept.

            '
          example: wrong_scope
        span_count:
          type: integer
          format: int64
          description: 'On an accepted row, how many spans, metric data points or log

            records were stored. On a row for a reason that discards items

            (`unknown_event`, `unknown_metric`, `cumulative_temporality`,

            `invalid_point`, `future_start`, `too_many_series`), how many

            items of the request were discarded for that reason. 0 on every

            other refusal.

            '
          example: 0
        bytes:
          type: integer
          format: int64
          description: 'The request body''s size. On an accepted row, and on a refusal

            made after the body was read, it is the size LastPing read, after

            gzip is undone. On a refusal made before the body was read (a

            key, scope, rate or budget refusal), it is the request''s

            Content-Length header, which is the compressed size when the body

            is gzip; 0 when the header was absent. A large request can be

            recorded as several accepted entries; the first carries the

            request''s bytes, protocol and user agent and the rest carry 0

            and empty strings, so a sum over entries is normally the bytes

            received. A part that stored nothing new (every span or log event

            already stored, every metric point of a new model series past the

            daily limit, or every metric sample dropped for an invalid day,

            value, metric or label) records no accepted entry, and when that

            part is the first, the request''s bytes, protocol and user agent

            go unrecorded.

            '
          example: 20480
        protocol:
          type: string
          description: http/protobuf or http/json, from the request's Content-Type; empty when it was neither.
          example: http/protobuf
        user_agent:
          type: string
          description: The request's User-Agent header, with secrets redacted, cut to 200 bytes.
          example: OTel-OTLP-Exporter-Python/1.27.0
        signal:
          type: string
          enum:
          - traces
          - metrics
          - logs
          example: traces
    TraceDiagnostics:
      type: object
      description: The body of `GET /api/v1/checks/{id}/trace-diagnostics`.
      required:
      - attempts
      - last_accepted_at
      - summary
      properties:
        attempts:
          type: array
          description: The newest 20 attempts, newest first.
          items:
            $ref: '#/components/schemas/IngestAttempt'
        last_accepted_at:
          type:
          - string
          - 'null'
          format: date-time
          description: The newest accepted attempt in the last 7 days, which may be older than every listed attempt; null when none.
          example: '2026-09-21T16:40:12Z'
        summary:
          oneOf:
          - $ref: '#/components/schemas/TraceSummary'
          - type: 'null'
    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.
    TraceSummary:
      type: object
      description: What the monitor's newest traced run contained.
      required:
      - rid
      - span_count
      - model
      - model_calls
      - tool_calls
      - tokens_in
      - tokens_out
      - cost_usd
      - cost_source
      - last_span_at
      - is_test
      properties:
        rid:
          type: string
          example: trace-4bf92f3577b34da6a3ce929d0e0e4736
        span_count:
          type: integer
          format: int64
          example: 6
        model:
          type: string
          description: The model most of its calls used, empty when none named one.
          example: claude-sonnet-4-5
        model_calls:
          type: integer
          format: int64
          example: 2
        tool_calls:
          type: integer
          format: int64
          example: 1
        tokens_in:
          type: integer
          format: int64
          example: 12040
        tokens_out:
          type: integer
          format: int64
          example: 880
        cost_usd:
          type:
          - string
          - 'null'
          example: '0.049320'
        cost_source:
          type: string
          description: 'What `cost_usd` is made of. A plain string, not an enum, so a new

            value never breaks a client: `client` when every priced call''s

            cost was reported by the client (the exporter''s own figure, or

            Claude Code''s per-call cost), `estimated` when LastPing priced

            every call at API list prices, `mixed` when the sum holds both,

            empty when `cost_usd` is null.

            '
          example: estimated
        last_span_at:
          type:
          - string
          - 'null'
          format: date-time
          example: '2026-09-21T16:40:12Z'
        is_test:
          type: boolean
          description: 'True when this run is the set-up''s test span (every span carried

            `lastping.test=true`), as `is_test` on `GET /api/v1/runs`. A set-up

            is working once one arrives; the tool''s own first run follows it.

            '
          example: false
  responses:
    InsufficientScope:
      description: 'The API key authenticated, but its scope does not reach this

        operation. The problem body carries `required_scope`: the tier the

        operation needs. Re-mint the key at that scope (Settings, `POST

        /api/v1/api-keys`, or the `create_api_key` MCP tool) rather than

        retrying — the refusal is deterministic and a retry will be refused

        identically.

        '
      content:
        application/problem+json:
          schema:
            allOf:
            - $ref: '#/components/schemas/Problem'
            - type: object
              properties:
                required_scope:
                  type: string
                  enum:
                  - read
                  - write
                  - admin
                  description: The minimum scope this operation requires.
                  example: admin
    RateLimited:
      description: 'Too many requests.  The per-principal fixed-window rate limit has been

        exceeded. Retry after the number of seconds indicated by the

        `Retry-After` response header.


        The problem body''s `code` is `RATE_LIMITED`. It names this limiter

        specifically, so a client can tell it apart from the application-level

        throttles that also answer 429 with their own codes and their own, much

        longer, `Retry-After` values (`TEST_PING_RATE_LIMITED`,

        `TOO_MANY_ATTEMPTS`). Back off globally on `RATE_LIMITED`; back off on

        the one operation for the others.


        The principal is the API key for a key-authenticated request and the

        USER for a browser session, so every tab one person has open shares one

        budget.

        '
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
            example: 30
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  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.

        '