{
  "openapi": "3.1.0",
  "info": {
    "title": "Job monitors",
    "version": "2026-10-06",
    "description": "Get alerts when a scheduled job misses its check-in, runs too long, or fails. Authenticate management requests with a secret API key in `Authorization: Bearer ...`. Ping endpoints authenticate with the secret in their URL."
  },
  "servers": [
    {
      "url": "https://api.motor.dev/job_monitors"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "Ping endpoints"
    },
    {
      "name": "Monitors"
    },
    {
      "name": "Runs and pings"
    },
    {
      "name": "Incidents"
    },
    {
      "name": "Alert channels"
    },
    {
      "name": "Ping keys"
    }
  ],
  "paths": {
    "/ping/{token}": {
      "post": {
        "operationId": "pingSuccess",
        "tags": [
          "Ping endpoints"
        ],
        "summary": "Report a successful run",
        "description": "Records a `success` ping. Use GET, HEAD, or POST. A POST body (the first 100,000 bytes) becomes the ping's log. Use the same `?rid=<uuid>` on start and completion pings to link them to one run.",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The monitor's ping token, a UUID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rid",
            "in": "query",
            "required": false,
            "description": "A run ID: a UUID that you choose for each execution of the job.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Motor recorded the ping.",
            "content": {
              "text/plain": {
                "example": "OK"
              }
            }
          },
          "400": {
            "description": "The path or a parameter is incorrect.",
            "content": {
              "text/plain": {
                "example": "invalid url format"
              }
            }
          },
          "404": {
            "description": "The token doesn't exist.",
            "content": {
              "text/plain": {
                "example": "not found"
              }
            }
          },
          "429": {
            "description": "The monitor exceeded its ping limit: 4 pings per minute, with bursts of up to 20.",
            "content": {
              "text/plain": {
                "example": "rate limited"
              }
            }
          }
        },
        "security": []
      }
    },
    "/ping/{token}/start": {
      "post": {
        "operationId": "pingStart",
        "tags": [
          "Ping endpoints"
        ],
        "summary": "Report the start of a run",
        "description": "Records a `start` ping. Use GET, HEAD, or POST. A POST body (the first 100,000 bytes) becomes the ping's log. Use the same `?rid=<uuid>` on start and completion pings to link them to one run. A start opens a run. A run that doesn't complete before its maximum runtime times out.",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The monitor's ping token, a UUID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rid",
            "in": "query",
            "required": false,
            "description": "A run ID: a UUID that you choose for each execution of the job.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Motor recorded the ping.",
            "content": {
              "text/plain": {
                "example": "OK"
              }
            }
          },
          "400": {
            "description": "The path or a parameter is incorrect.",
            "content": {
              "text/plain": {
                "example": "invalid url format"
              }
            }
          },
          "404": {
            "description": "The token doesn't exist.",
            "content": {
              "text/plain": {
                "example": "not found"
              }
            }
          },
          "429": {
            "description": "The monitor exceeded its ping limit: 4 pings per minute, with bursts of up to 20.",
            "content": {
              "text/plain": {
                "example": "rate limited"
              }
            }
          }
        },
        "security": []
      }
    },
    "/ping/{token}/fail": {
      "post": {
        "operationId": "pingFail",
        "tags": [
          "Ping endpoints"
        ],
        "summary": "Report a failed run",
        "description": "Records a `fail` ping. Use GET, HEAD, or POST. A POST body (the first 100,000 bytes) becomes the ping's log. Use the same `?rid=<uuid>` on start and completion pings to link them to one run.",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The monitor's ping token, a UUID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rid",
            "in": "query",
            "required": false,
            "description": "A run ID: a UUID that you choose for each execution of the job.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Motor recorded the ping.",
            "content": {
              "text/plain": {
                "example": "OK"
              }
            }
          },
          "400": {
            "description": "The path or a parameter is incorrect.",
            "content": {
              "text/plain": {
                "example": "invalid url format"
              }
            }
          },
          "404": {
            "description": "The token doesn't exist.",
            "content": {
              "text/plain": {
                "example": "not found"
              }
            }
          },
          "429": {
            "description": "The monitor exceeded its ping limit: 4 pings per minute, with bursts of up to 20.",
            "content": {
              "text/plain": {
                "example": "rate limited"
              }
            }
          }
        },
        "security": []
      }
    },
    "/ping/{token}/log": {
      "post": {
        "operationId": "pingLog",
        "tags": [
          "Ping endpoints"
        ],
        "summary": "Send a log message",
        "description": "Records a `log` ping. It doesn't change the monitor's state.",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The monitor's ping token, a UUID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rid",
            "in": "query",
            "required": false,
            "description": "A run ID: a UUID that you choose for each execution of the job.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Motor recorded the ping.",
            "content": {
              "text/plain": {
                "example": "OK"
              }
            }
          },
          "400": {
            "description": "The path or a parameter is incorrect.",
            "content": {
              "text/plain": {
                "example": "invalid url format"
              }
            }
          },
          "404": {
            "description": "The token doesn't exist.",
            "content": {
              "text/plain": {
                "example": "not found"
              }
            }
          },
          "429": {
            "description": "The monitor exceeded its ping limit: 4 pings per minute, with bursts of up to 20.",
            "content": {
              "text/plain": {
                "example": "rate limited"
              }
            }
          }
        },
        "security": []
      }
    },
    "/ping/{token}/{exit_code}": {
      "post": {
        "operationId": "pingExitCode",
        "tags": [
          "Ping endpoints"
        ],
        "summary": "Report an exit code",
        "description": "Records the exit code of a run, from 0 to 255. 0 is a success. Other codes are failures.",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The monitor's ping token, a UUID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "exit_code",
            "in": "path",
            "required": true,
            "description": "From 0 to 255.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rid",
            "in": "query",
            "required": false,
            "description": "A run ID: a UUID that you choose for each execution of the job.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Motor recorded the ping.",
            "content": {
              "text/plain": {
                "example": "OK"
              }
            }
          },
          "400": {
            "description": "The path or a parameter is incorrect.",
            "content": {
              "text/plain": {
                "example": "invalid url format"
              }
            }
          },
          "404": {
            "description": "The token doesn't exist.",
            "content": {
              "text/plain": {
                "example": "not found"
              }
            }
          },
          "429": {
            "description": "The monitor exceeded its ping limit: 4 pings per minute, with bursts of up to 20.",
            "content": {
              "text/plain": {
                "example": "rate limited"
              }
            }
          }
        },
        "security": []
      }
    },
    "/ping/{ping_key}/{slug}": {
      "post": {
        "operationId": "pingBySlug",
        "tags": [
          "Ping endpoints"
        ],
        "summary": "Send a ping by monitor slug",
        "description": "Send pings using a ping key and a monitor slug. Add `/start`, `/fail`, `/log`, or an exit code to report the result. With `create=1`, Motor creates the monitor if the slug doesn't exist and the ping key has `can_create` enabled. Use `schedule`, `interval`, `tz`, and `grace` to configure the new monitor.",
        "parameters": [
          {
            "name": "ping_key",
            "in": "path",
            "required": true,
            "description": "A ping key belonging to your team.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The slug of the monitor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rid",
            "in": "query",
            "required": false,
            "description": "A run ID: a UUID that you choose for each execution of the job.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "create",
            "in": "query",
            "required": false,
            "description": "Set to `1` to create the monitor if it doesn't exist.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "schedule",
            "in": "query",
            "required": false,
            "description": "A cron expression for a new monitor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "description": "An interval in seconds for a new monitor.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tz",
            "in": "query",
            "required": false,
            "description": "The time zone of a new monitor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "grace",
            "in": "query",
            "required": false,
            "description": "The grace period for a new monitor, in seconds.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Motor recorded the ping.",
            "content": {
              "text/plain": {
                "example": "OK"
              }
            }
          },
          "201": {
            "description": "Motor created the monitor and recorded the ping.",
            "content": {
              "text/plain": {
                "example": "Created"
              }
            }
          },
          "403": {
            "description": "The monitor couldn't be created. The response body explains why.",
            "content": {
              "text/plain": {
                "example": "forbidden: this ping key can't create monitors"
              }
            }
          },
          "400": {
            "description": "The path or a parameter is incorrect.",
            "content": {
              "text/plain": {
                "example": "invalid url format"
              }
            }
          },
          "404": {
            "description": "The token doesn't exist.",
            "content": {
              "text/plain": {
                "example": "not found"
              }
            }
          },
          "429": {
            "description": "The monitor exceeded its ping limit: 4 pings per minute, with bursts of up to 20.",
            "content": {
              "text/plain": {
                "example": "rate limited"
              }
            }
          }
        },
        "security": []
      }
    },
    "/monitors": {
      "post": {
        "operationId": "createMonitor",
        "tags": [
          "Monitors"
        ],
        "summary": "Create a monitor",
        "description": "Creates a monitor and starts checking its schedule immediately. Motor can alert you to a missed run even if the job has never sent a ping.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "1 to 100 characters. Required when you create a monitor."
                  },
                  "slug": {
                    "type": "string",
                    "description": "1 to 64 characters from a-z, 0-9, -, and _. Must be unique within your team. Defaults to a slug derived from `name`."
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "At most 10 tags of 1 to 32 characters from a-z, 0-9, -, _, and :."
                  },
                  "schedule": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "A five-field cron expression or a macro such as `@daily`. Set either `schedule` or `interval_seconds`."
                  },
                  "interval_seconds": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "From 60 to 2,678,400 (31 days)."
                  },
                  "time_zone": {
                    "type": "string",
                    "description": "The IANA time zone of a cron schedule. `UTC` by default."
                  },
                  "grace_seconds": {
                    "type": "integer",
                    "description": "Extra time after a scheduled check-in before Motor marks the run as missed, in seconds. From 60 to 2,678,400; defaults to 300 (5 minutes)."
                  },
                  "max_runtime_seconds": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Maximum run duration after a `start` ping, in seconds. From 60 to 604,800. Set to `null` to use `grace_seconds`."
                  },
                  "failure_tolerance": {
                    "type": "integer",
                    "description": "Consecutive unsuccessful results to allow before opening an incident. From 0 to 100; defaults to 0, so the first unsuccessful result opens an incident."
                  },
                  "recovery_threshold": {
                    "type": "integer",
                    "description": "Consecutive successful results needed to resolve an incident. From 1 to 100; defaults to 1."
                  },
                  "realert_seconds": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Seconds between reminders while an incident is open. From 300 to 604,800, or `null` to disable reminders."
                  },
                  "alert_channel_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "At most 20 channels. Without this field, a new monitor uses the team's default channels."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Nightly backup",
                "schedule": "0 3 * * *",
                "time_zone": "America/New_York",
                "grace_seconds": 600,
                "max_runtime_seconds": 3600,
                "tags": [
                  "db",
                  "prod"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The monitor.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmm_4ZpQ7bLxN2c",
                  "name": "Nightly backup",
                  "slug": "nightly-backup",
                  "tags": [
                    "db",
                    "prod"
                  ],
                  "schedule": "0 3 * * *",
                  "interval_seconds": null,
                  "time_zone": "America/New_York",
                  "grace_seconds": 600,
                  "max_runtime_seconds": 3600,
                  "failure_tolerance": 0,
                  "recovery_threshold": 1,
                  "realert_seconds": 86400,
                  "alert_channel_ids": [
                    "jmc_9kTe2WvRmQa"
                  ],
                  "status": "up",
                  "down_reason": null,
                  "running": false,
                  "ping_url": "https://api.motor.dev/job_monitors/ping/0b1f8c2e-6d1a-4f6b-9c3e-2a7d5e8f1b40",
                  "last_ping_at": "2026-10-05T07:05:14Z",
                  "last_duration_seconds": 312,
                  "next_due_at": "2026-10-06T07:00:00Z",
                  "paused_until": null,
                  "created_at": "2026-10-01T18:22:05Z"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The key has reached its monthly spending limit.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "limit_reached",
                    "message": "This key reached its monthly spending limit, so it can't create monitors. Existing monitors keep running. Raise the limit on the API keys page."
                  }
                }
              }
            }
          },
          "409": {
            "description": "A monitor in your team already uses this slug.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "slug_taken",
                    "message": "Another monitor of the team has the slug `nightly-backup`."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is invalid.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`grace_seconds` must be from 60 to 2678400."
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listMonitors",
        "tags": [
          "Monitors"
        ],
        "summary": "List monitors",
        "description": "Lists the team's monitors, oldest first.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of items, from 1 to 200. 50 by default.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `next_cursor` returned by the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only monitors with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "paused",
                "down",
                "late",
                "new",
                "up"
              ]
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Only monitors with this tag.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Only the monitor with this slug.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of monitors.",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "jmm_4ZpQ7bLxN2c",
                      "name": "Nightly backup",
                      "slug": "nightly-backup",
                      "tags": [
                        "db",
                        "prod"
                      ],
                      "schedule": "0 3 * * *",
                      "interval_seconds": null,
                      "time_zone": "America/New_York",
                      "grace_seconds": 600,
                      "max_runtime_seconds": 3600,
                      "failure_tolerance": 0,
                      "recovery_threshold": 1,
                      "realert_seconds": 86400,
                      "alert_channel_ids": [
                        "jmc_9kTe2WvRmQa"
                      ],
                      "status": "up",
                      "down_reason": null,
                      "running": false,
                      "ping_url": "https://api.motor.dev/job_monitors/ping/0b1f8c2e-6d1a-4f6b-9c3e-2a7d5e8f1b40",
                      "last_ping_at": "2026-10-05T07:05:14Z",
                      "last_duration_seconds": 312,
                      "next_due_at": "2026-10-06T07:00:00Z",
                      "paused_until": null,
                      "created_at": "2026-10-01T18:22:05Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/monitors/{id}": {
      "get": {
        "operationId": "getMonitor",
        "tags": [
          "Monitors"
        ],
        "summary": "Read a monitor",
        "description": "Returns a monitor with its status: `paused`, `down`, `late`, `new`, or `up`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the monitor, such as `jmm_4ZpQ7bLxN2c`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The monitor.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmm_4ZpQ7bLxN2c",
                  "name": "Nightly backup",
                  "slug": "nightly-backup",
                  "tags": [
                    "db",
                    "prod"
                  ],
                  "schedule": "0 3 * * *",
                  "interval_seconds": null,
                  "time_zone": "America/New_York",
                  "grace_seconds": 600,
                  "max_runtime_seconds": 3600,
                  "failure_tolerance": 0,
                  "recovery_threshold": 1,
                  "realert_seconds": 86400,
                  "alert_channel_ids": [
                    "jmc_9kTe2WvRmQa"
                  ],
                  "status": "up",
                  "down_reason": null,
                  "running": false,
                  "ping_url": "https://api.motor.dev/job_monitors/ping/0b1f8c2e-6d1a-4f6b-9c3e-2a7d5e8f1b40",
                  "last_ping_at": "2026-10-05T07:05:14Z",
                  "last_duration_seconds": 312,
                  "next_due_at": "2026-10-06T07:00:00Z",
                  "paused_until": null,
                  "created_at": "2026-10-01T18:22:05Z"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateMonitor",
        "tags": [
          "Monitors"
        ],
        "summary": "Update a monitor",
        "description": "Updates only the fields included in the request. Changing the schedule recalculates the next check-in from the current time. To switch between a cron schedule and an interval, set the previous schedule field to `null`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the monitor, such as `jmm_4ZpQ7bLxN2c`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "1 to 100 characters. Required when you create a monitor."
                  },
                  "slug": {
                    "type": "string",
                    "description": "1 to 64 characters from a-z, 0-9, -, and _. Must be unique within your team. Defaults to a slug derived from `name`."
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "At most 10 tags of 1 to 32 characters from a-z, 0-9, -, _, and :."
                  },
                  "schedule": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "A five-field cron expression or a macro such as `@daily`. Set either `schedule` or `interval_seconds`."
                  },
                  "interval_seconds": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "From 60 to 2,678,400 (31 days)."
                  },
                  "time_zone": {
                    "type": "string",
                    "description": "The IANA time zone of a cron schedule. `UTC` by default."
                  },
                  "grace_seconds": {
                    "type": "integer",
                    "description": "Extra time after a scheduled check-in before Motor marks the run as missed, in seconds. From 60 to 2,678,400; defaults to 300 (5 minutes)."
                  },
                  "max_runtime_seconds": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Maximum run duration after a `start` ping, in seconds. From 60 to 604,800. Set to `null` to use `grace_seconds`."
                  },
                  "failure_tolerance": {
                    "type": "integer",
                    "description": "Consecutive unsuccessful results to allow before opening an incident. From 0 to 100; defaults to 0, so the first unsuccessful result opens an incident."
                  },
                  "recovery_threshold": {
                    "type": "integer",
                    "description": "Consecutive successful results needed to resolve an incident. From 1 to 100; defaults to 1."
                  },
                  "realert_seconds": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Seconds between reminders while an incident is open. From 300 to 604,800, or `null` to disable reminders."
                  },
                  "alert_channel_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "At most 20 channels. Without this field, a new monitor uses the team's default channels."
                  }
                }
              },
              "example": {
                "grace_seconds": 900,
                "schedule": "0 4 * * *"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The monitor.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmm_4ZpQ7bLxN2c",
                  "name": "Nightly backup",
                  "slug": "nightly-backup",
                  "tags": [
                    "db",
                    "prod"
                  ],
                  "schedule": "0 3 * * *",
                  "interval_seconds": null,
                  "time_zone": "America/New_York",
                  "grace_seconds": 600,
                  "max_runtime_seconds": 3600,
                  "failure_tolerance": 0,
                  "recovery_threshold": 1,
                  "realert_seconds": 86400,
                  "alert_channel_ids": [
                    "jmc_9kTe2WvRmQa"
                  ],
                  "status": "up",
                  "down_reason": null,
                  "running": false,
                  "ping_url": "https://api.motor.dev/job_monitors/ping/0b1f8c2e-6d1a-4f6b-9c3e-2a7d5e8f1b40",
                  "last_ping_at": "2026-10-05T07:05:14Z",
                  "last_duration_seconds": 312,
                  "next_due_at": "2026-10-06T07:00:00Z",
                  "paused_until": null,
                  "created_at": "2026-10-01T18:22:05Z"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is invalid.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`grace_seconds` must be from 60 to 2678400."
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteMonitor",
        "tags": [
          "Monitors"
        ],
        "summary": "Delete a monitor",
        "description": "Deletes the monitor and its pings, runs, and incidents. Billing records are retained.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the monitor, such as `jmm_4ZpQ7bLxN2c`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The monitor is deleted.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmm_4ZpQ7bLxN2c",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/monitors/{id}/pause": {
      "post": {
        "operationId": "pauseMonitor",
        "tags": [
          "Monitors"
        ],
        "summary": "Pause a monitor",
        "description": "Pauses monitoring until the `until` timestamp, the next ping, or an explicit resume request. Motor abandons active runs and resolves any open incident. Monitors paused for an entire day are free for that day.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the monitor, such as `jmm_4ZpQ7bLxN2c`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "until": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Optional timestamp at which monitoring resumes."
                  }
                }
              },
              "example": {
                "until": "2026-10-06T12:00:00Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The monitor.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmm_4ZpQ7bLxN2c",
                  "name": "Nightly backup",
                  "slug": "nightly-backup",
                  "tags": [
                    "db",
                    "prod"
                  ],
                  "schedule": "0 3 * * *",
                  "interval_seconds": null,
                  "time_zone": "America/New_York",
                  "grace_seconds": 600,
                  "max_runtime_seconds": 3600,
                  "failure_tolerance": 0,
                  "recovery_threshold": 1,
                  "realert_seconds": 86400,
                  "alert_channel_ids": [
                    "jmc_9kTe2WvRmQa"
                  ],
                  "status": "paused",
                  "down_reason": null,
                  "running": false,
                  "ping_url": "https://api.motor.dev/job_monitors/ping/0b1f8c2e-6d1a-4f6b-9c3e-2a7d5e8f1b40",
                  "last_ping_at": "2026-10-05T07:05:14Z",
                  "last_duration_seconds": 312,
                  "next_due_at": null,
                  "paused_until": "2026-10-06T12:00:00Z",
                  "created_at": "2026-10-01T18:22:05Z"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is invalid.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`grace_seconds` must be from 60 to 2678400."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/monitors/{id}/resume": {
      "post": {
        "operationId": "resumeMonitor",
        "tags": [
          "Monitors"
        ],
        "summary": "Resume a monitor",
        "description": "Resumes a paused monitor and calculates its next check-in from the current time.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the monitor, such as `jmm_4ZpQ7bLxN2c`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The monitor.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmm_4ZpQ7bLxN2c",
                  "name": "Nightly backup",
                  "slug": "nightly-backup",
                  "tags": [
                    "db",
                    "prod"
                  ],
                  "schedule": "0 3 * * *",
                  "interval_seconds": null,
                  "time_zone": "America/New_York",
                  "grace_seconds": 600,
                  "max_runtime_seconds": 3600,
                  "failure_tolerance": 0,
                  "recovery_threshold": 1,
                  "realert_seconds": 86400,
                  "alert_channel_ids": [
                    "jmc_9kTe2WvRmQa"
                  ],
                  "status": "up",
                  "down_reason": null,
                  "running": false,
                  "ping_url": "https://api.motor.dev/job_monitors/ping/0b1f8c2e-6d1a-4f6b-9c3e-2a7d5e8f1b40",
                  "last_ping_at": "2026-10-05T07:05:14Z",
                  "last_duration_seconds": 312,
                  "next_due_at": "2026-10-06T07:00:00Z",
                  "paused_until": null,
                  "created_at": "2026-10-01T18:22:05Z"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/monitors/{id}/rotate_token": {
      "post": {
        "operationId": "rotateToken",
        "tags": [
          "Monitors"
        ],
        "summary": "Rotate the ping token",
        "description": "Creates a new ping URL for the monitor. The previous URL remains valid for `overlap_seconds`. Set this to 0 to immediately invalidate all previous ping URLs.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the monitor, such as `jmm_4ZpQ7bLxN2c`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "overlap_seconds": {
                    "type": "integer",
                    "description": "From 0 to 86,400. 86,400 by default."
                  }
                }
              },
              "example": {
                "overlap_seconds": 86400
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The monitor with its new `ping_url`.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmm_4ZpQ7bLxN2c",
                  "name": "Nightly backup",
                  "slug": "nightly-backup",
                  "tags": [
                    "db",
                    "prod"
                  ],
                  "schedule": "0 3 * * *",
                  "interval_seconds": null,
                  "time_zone": "America/New_York",
                  "grace_seconds": 600,
                  "max_runtime_seconds": 3600,
                  "failure_tolerance": 0,
                  "recovery_threshold": 1,
                  "realert_seconds": 86400,
                  "alert_channel_ids": [
                    "jmc_9kTe2WvRmQa"
                  ],
                  "status": "up",
                  "down_reason": null,
                  "running": false,
                  "ping_url": "https://api.motor.dev/job_monitors/ping/0b1f8c2e-6d1a-4f6b-9c3e-2a7d5e8f1b40",
                  "last_ping_at": "2026-10-05T07:05:14Z",
                  "last_duration_seconds": 312,
                  "next_due_at": "2026-10-06T07:00:00Z",
                  "paused_until": null,
                  "created_at": "2026-10-01T18:22:05Z"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is invalid.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`grace_seconds` must be from 60 to 2678400."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/monitors/sync": {
      "post": {
        "operationId": "syncMonitors",
        "tags": [
          "Monitors"
        ],
        "summary": "Sync monitors",
        "description": "Creates and updates monitors by slug for deployment scripts and agents. Set `prune_tag` to delete monitors with that tag whose slugs are missing from the request. Motor validates the entire request before making changes. Set `dry_run` to true to preview the changes.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "monitors": {
                    "type": "array",
                    "description": "At most 1,000 monitors. Each needs a `slug`."
                  },
                  "prune_tag": {
                    "type": "string"
                  },
                  "dry_run": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "monitors"
                ]
              },
              "example": {
                "monitors": [
                  {
                    "slug": "nightly-backup",
                    "name": "Nightly backup",
                    "schedule": "0 3 * * *",
                    "tags": [
                      "deploy:api"
                    ]
                  }
                ],
                "prune_tag": "deploy:api",
                "dry_run": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The monitors created, updated, and deleted, or the proposed changes for a dry run.",
            "content": {
              "application/json": {
                "example": {
                  "created": [
                    "nightly-backup"
                  ],
                  "updated": [],
                  "unchanged": [],
                  "deleted": [
                    "old-report"
                  ],
                  "dry_run": false
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is invalid.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`grace_seconds` must be from 60 to 2678400."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/monitors/{monitor_id}/runs": {
      "get": {
        "operationId": "listRuns",
        "tags": [
          "Runs and pings"
        ],
        "summary": "List runs",
        "description": "Lists the runs of a monitor, newest first. `result` is `running`, `succeeded`, `failed`, `timed_out`, or `abandoned`.",
        "parameters": [
          {
            "name": "monitor_id",
            "in": "path",
            "required": true,
            "description": "The ID of the monitor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of items, from 1 to 200. 50 by default.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `next_cursor` returned by the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "result",
            "in": "query",
            "required": false,
            "description": "Only runs with this result.",
            "schema": {
              "type": "string",
              "enum": [
                "running",
                "succeeded",
                "failed",
                "timed_out",
                "abandoned"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of runs.",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "jmr_7GhLs3NqPzE",
                      "rid": "6f1c2b8e-1d2a-4c4e-9a63-1f0f9b3c2d10",
                      "occurrence_at": "2026-10-05T07:00:00Z",
                      "started_at": "2026-10-05T07:00:02Z",
                      "finished_at": "2026-10-05T07:05:14Z",
                      "result": "succeeded",
                      "exit_code": 0,
                      "duration_seconds": 312
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/monitors/{monitor_id}/pings": {
      "get": {
        "operationId": "listPings",
        "tags": [
          "Runs and pings"
        ],
        "summary": "List pings",
        "description": "Lists the pings of a monitor, newest first.",
        "parameters": [
          {
            "name": "monitor_id",
            "in": "path",
            "required": true,
            "description": "The ID of the monitor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of items, from 1 to 200. 50 by default.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `next_cursor` returned by the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Only pings of this kind.",
            "schema": {
              "type": "string",
              "enum": [
                "start",
                "success",
                "fail",
                "log"
              ]
            }
          },
          {
            "name": "rid",
            "in": "query",
            "required": false,
            "description": "Only pings with this run ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of pings.",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "jmp_2YcVbN8xKfM",
                      "kind": "success",
                      "received_at": "2026-10-05T07:05:14Z",
                      "rid": "6f1c2b8e-1d2a-4c4e-9a63-1f0f9b3c2d10",
                      "run_id": "jmr_7GhLs3NqPzE",
                      "exit_code": 0,
                      "method": "POST",
                      "user_agent": "runitor/v1.3.0",
                      "body_bytes": 18213,
                      "body_truncated": false,
                      "body_stored": true
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/monitors/{monitor_id}/pings/{id}/body": {
      "get": {
        "operationId": "getPingBody",
        "tags": [
          "Runs and pings"
        ],
        "summary": "Download a ping body",
        "description": "Returns the stored body of a ping as plain text. Motor keeps the bodies of the newest 100 pings of each monitor.",
        "parameters": [
          {
            "name": "monitor_id",
            "in": "path",
            "required": true,
            "description": "The ID of the monitor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the ping.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The body.",
            "content": {
              "text/plain": {
                "example": "Backup finished: 1,204 files, 3.2 GB."
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The ping or its body doesn't exist.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The ping body doesn't exist."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/monitors/{monitor_id}/incidents": {
      "get": {
        "operationId": "listMonitorIncidents",
        "tags": [
          "Incidents"
        ],
        "summary": "List a monitor's incidents",
        "description": "Lists the incidents of a monitor, newest first.",
        "parameters": [
          {
            "name": "monitor_id",
            "in": "path",
            "required": true,
            "description": "The ID of the monitor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of items, from 1 to 200. 50 by default.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `next_cursor` returned by the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of incidents.",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "jmi_5RmWq1JtBnD",
                      "monitor_id": "jmm_4ZpQ7bLxN2c",
                      "reason": "missed",
                      "opened_at": "2026-10-05T07:10:00Z",
                      "resolved_at": null
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/incidents": {
      "get": {
        "operationId": "listIncidents",
        "tags": [
          "Incidents"
        ],
        "summary": "List incidents",
        "description": "Lists the team's incidents, newest first.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of items, from 1 to 200. 50 by default.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `next_cursor` returned by the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "open",
            "in": "query",
            "required": false,
            "description": "`true` for open incidents, `false` for resolved incidents.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "monitor_id",
            "in": "query",
            "required": false,
            "description": "Only the incidents of this monitor.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of incidents.",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "jmi_5RmWq1JtBnD",
                      "monitor_id": "jmm_4ZpQ7bLxN2c",
                      "reason": "missed",
                      "opened_at": "2026-10-05T07:10:00Z",
                      "resolved_at": null
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/incidents/{id}": {
      "get": {
        "operationId": "getIncident",
        "tags": [
          "Incidents"
        ],
        "summary": "Read an incident",
        "description": "Returns an incident and the delivery status of each alert. Alert `status` is `pending`, `sending`, `delivered`, `failed`, or `superseded`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the incident.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The incident.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmi_5RmWq1JtBnD",
                  "monitor_id": "jmm_4ZpQ7bLxN2c",
                  "reason": "missed",
                  "opened_at": "2026-10-05T07:10:00Z",
                  "resolved_at": null,
                  "alerts": [
                    {
                      "id": "jma_3XzPd6LcVhT",
                      "channel_id": "jmc_9kTe2WvRmQa",
                      "kind": "opened",
                      "status": "delivered",
                      "attempts": 1,
                      "sent_at": "2026-10-05T07:10:04Z",
                      "error": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alert_channels": {
      "post": {
        "operationId": "createChannel",
        "tags": [
          "Alert channels"
        ],
        "summary": "Create an alert channel",
        "description": "Creates a destination for alerts. For webhooks, save the `signing_secret` from the response; it is shown only once.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "email",
                      "webhook",
                      "slack",
                      "discord",
                      "pagerduty"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string",
                    "description": "For `email` channels. Recipients outside your team must confirm their address before receiving alerts."
                  },
                  "url": {
                    "type": "string",
                    "description": "For `webhook` (https), `slack` (https://hooks.slack.com/services/...) and `discord` (https://discord.com/api/webhooks/...)."
                  },
                  "routing_key": {
                    "type": "string",
                    "description": "For `pagerduty`: an Events API v2 routing key."
                  },
                  "default": {
                    "type": "boolean",
                    "description": "New monitors without `alert_channel_ids` use default channels."
                  },
                  "include_logs": {
                    "type": "boolean",
                    "description": "Failure alerts include the last 2,000 bytes of the failed ping's body."
                  }
                },
                "required": [
                  "kind"
                ]
              },
              "example": {
                "kind": "webhook",
                "url": "https://hooks.example.com/motor",
                "default": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The channel.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmc_9kTe2WvRmQa",
                  "kind": "webhook",
                  "name": "Ops webhook",
                  "url": "https://hooks.example.com/motor",
                  "default": true,
                  "include_logs": false,
                  "confirmed": true,
                  "created_at": "2026-10-01T18:20:00Z",
                  "signing_secret": "whsec_Q2hhbmdlIHRoaXMgc2VjcmV0IGJlZm9yZSB1c2luZyBpdA"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is invalid.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`grace_seconds` must be from 60 to 2678400."
                  }
                }
              }
            }
          },
          "429": {
            "description": "The team sent 10 confirmation emails in the last 24 hours.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "The team sent 10 confirmation emails in the last 24 hours. Try again later, or use the address of a team member."
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listChannels",
        "tags": [
          "Alert channels"
        ],
        "summary": "List alert channels",
        "description": "Lists the team's channels. Credentials are hidden.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of items, from 1 to 200. 50 by default.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `next_cursor` returned by the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of channels.",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "jmc_9kTe2WvRmQa",
                      "kind": "webhook",
                      "name": "Ops webhook",
                      "url": "https://hooks.example.com/motor",
                      "default": true,
                      "include_logs": false,
                      "confirmed": true,
                      "created_at": "2026-10-01T18:20:00Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alert_channels/{id}": {
      "get": {
        "operationId": "getChannel",
        "tags": [
          "Alert channels"
        ],
        "summary": "Read an alert channel",
        "description": "Returns a channel.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the channel.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The channel.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmc_9kTe2WvRmQa",
                  "kind": "webhook",
                  "name": "Ops webhook",
                  "url": "https://hooks.example.com/motor",
                  "default": true,
                  "include_logs": false,
                  "confirmed": true,
                  "created_at": "2026-10-01T18:20:00Z"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateChannel",
        "tags": [
          "Alert channels"
        ],
        "summary": "Update an alert channel",
        "description": "Changes `name`, `default`, and `include_logs`. To change the destination, delete the channel and add a new one.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the channel.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "default": {
                    "type": "boolean",
                    "description": "New monitors without `alert_channel_ids` use default channels."
                  },
                  "include_logs": {
                    "type": "boolean",
                    "description": "Failure alerts include the last 2,000 bytes of the failed ping's body."
                  }
                }
              },
              "example": {
                "include_logs": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The channel.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmc_9kTe2WvRmQa",
                  "kind": "webhook",
                  "name": "Ops webhook",
                  "url": "https://hooks.example.com/motor",
                  "default": true,
                  "include_logs": true,
                  "confirmed": true,
                  "created_at": "2026-10-01T18:20:00Z"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is invalid.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`grace_seconds` must be from 60 to 2678400."
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteChannel",
        "tags": [
          "Alert channels"
        ],
        "summary": "Delete an alert channel",
        "description": "Removes the channel from all monitors and cancels pending alerts for that channel.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the channel.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The channel is deleted.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmc_9kTe2WvRmQa",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alert_channels/{id}/test": {
      "post": {
        "operationId": "testChannel",
        "tags": [
          "Alert channels"
        ],
        "summary": "Send a test alert",
        "description": "Sends a test alert to the channel. At most 10 per channel per hour.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the channel.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "The test alert, queued for delivery.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jma_3XzPd6LcVhT",
                  "channel_id": "jmc_9kTe2WvRmQa",
                  "kind": "test",
                  "status": "pending",
                  "attempts": 0,
                  "sent_at": null,
                  "error": null
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          },
          "429": {
            "description": "The channel sent 10 test alerts in the last hour.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "The channel sent 10 test alerts in the last hour. Try again later."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alert_channels/{id}/rotate_secret": {
      "post": {
        "operationId": "rotateSecret",
        "tags": [
          "Alert channels"
        ],
        "summary": "Rotate a signing secret",
        "description": "Creates a new webhook signing secret. For the next 24 hours, deliveries include signatures from both the old and new secrets so you can update your integration.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the channel.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The channel with its new `signing_secret`.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmc_9kTe2WvRmQa",
                  "kind": "webhook",
                  "name": "Ops webhook",
                  "url": "https://hooks.example.com/motor",
                  "default": true,
                  "include_logs": false,
                  "confirmed": true,
                  "created_at": "2026-10-01T18:20:00Z",
                  "signing_secret": "whsec_TmV3IHNlY3JldCBhZnRlciBhIHJvdGF0aW9uIGFiYw"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ping_keys": {
      "post": {
        "operationId": "createPingKey",
        "tags": [
          "Ping keys"
        ],
        "summary": "Create a ping key",
        "description": "Creates a ping key for sending pings by monitor slug. Save the key from the response; it is shown only once. Enable `can_create` to allow pings with `create=1` to create monitors.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "can_create": {
                    "type": "boolean",
                    "description": "false by default."
                  }
                }
              },
              "example": {
                "can_create": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The ping key.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmk_6TnBv2QwLsJ",
                  "prefix": "pk3X",
                  "can_create": true,
                  "created_at": "2026-10-01T18:25:00Z",
                  "key": "pk3Xz8QvL2mN5rT7wY9aBc"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listPingKeys",
        "tags": [
          "Ping keys"
        ],
        "summary": "List ping keys",
        "description": "Lists your team's ping keys. Secret values are omitted.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of items, from 1 to 200. 50 by default.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `next_cursor` returned by the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of ping keys.",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "jmk_6TnBv2QwLsJ",
                      "prefix": "pk3X",
                      "can_create": true,
                      "created_at": "2026-10-01T18:25:00Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ping_keys/{id}": {
      "delete": {
        "operationId": "deletePingKey",
        "tags": [
          "Ping keys"
        ],
        "summary": "Delete a ping key",
        "description": "Deletes a ping key. Any slug-based ping URLs using this key stop working immediately.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the ping key.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ping key is deleted.",
            "content": {
              "application/json": {
                "example": {
                  "id": "jmk_6TnBv2QwLsJ",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "description": "The key is missing or incorrect.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The key can't use job monitors.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This key cannot access this API. Update its permissions on the API keys page."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The resource wasn't found in your team.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The monitor doesn't exist."
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "A secret API key from the API keys page, such as `motor_sk_...`."
      }
    }
  }
}
