{
  "openapi": "3.1.0",
  "info": {
    "title": "mtr.tools API",
    "version": "1.0.0",
    "description": "Run MTR, ping, traceroute, DNS and BGP lookups from probes around the world, and read saved results.\n\nErrors are returned as a plain-text message with the HTTP status code, not as JSON. A 401 has an empty body.\n\nDuring maintenance every endpoint answers 503 with a `Retry-After` header.",
    "contact": {
      "name": "mtr.tools",
      "url": "https://mtr.tools"
    }
  },
  "servers": [
    {
      "url": "https://api.mtr.tools",
      "description": "This deployment"
    }
  ],
  "tags": [
    {
      "name": "Tests",
      "description": "Run a measurement from a probe."
    },
    {
      "name": "Probes",
      "description": "The probes you can test from."
    },
    {
      "name": "Results",
      "description": "Saved results and shared links."
    },
    {
      "name": "Account",
      "description": "Your API tokens and daily credits."
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/api/test": {
      "post": {
        "operationId": "runTest",
        "summary": "Run a test from a probe",
        "description": "Runs one measurement and waits for it to finish, then returns the tool's output lines. The result is also saved, and `id` can be opened at `/r/{id}` on the website or fetched from `/results/{id}`.\n\nA test on a probe that is not yours uses one daily credit. Tests on your own probes, ones you submitted or on an AS number you operate, are free.",
        "tags": [
          "Tests"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunTestRequest"
              },
              "example": {
                "type": "ping",
                "target": "1.1.1.1",
                "probe": "14bcf6d"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The test finished.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Your daily test credit allowance.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Credits left today.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time when the allowance resets (midnight UTC).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunTestResponse"
                },
                "example": {
                  "id": "Zq3v0n1mXk8Yb2Lr5tHw9A",
                  "type": "ping",
                  "target": "1.1.1.1",
                  "probe": "14bcf6d",
                  "lines": [
                    "PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.",
                    "64 bytes from 1.1.1.1: icmp_seq=1 ttl=58 time=1.12 ms"
                  ],
                  "expires_at": "2026-12-15T03:10:00+00:00",
                  "credits": {
                    "limit": 50,
                    "used": 1,
                    "remaining": 49,
                    "free": false,
                    "resets_at": "2026-11-16T00:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The target is not a valid hostname or IP, or the test type is unknown.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "unknown test type"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "There is no probe with that id.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "no such probe"
              }
            }
          },
          "409": {
            "description": "The probe exists but is not live.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "probe is not live"
              }
            }
          },
          "429": {
            "description": "Your daily credits are used up. Tests on your own probes still work.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Your daily test credit allowance.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Credits left today.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time when the allowance resets (midnight UTC).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "daily API credit limit reached (50); tests on your own probes are free"
              }
            }
          },
          "502": {
            "description": "The probe could not be reached.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "SSH connect failed"
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/probes.json": {
      "get": {
        "operationId": "listProbes",
        "summary": "List live probes",
        "description": "Every probe that can currently run tests, grouped by region. Use a probe's `id` as `probe` in `/api/test`.",
        "tags": [
          "Probes"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Probes grouped by region, largest group first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProbeGroup"
                  }
                },
                "example": [
                  {
                    "name": "Europe",
                    "servers": [
                      {
                        "id": "14bcf6d",
                        "country": "United Kingdom",
                        "country_code": "GB",
                        "city": "London",
                        "provider": "Mythic Beasts",
                        "asnumber": 44684,
                        "residential": false,
                        "caps": {
                          "ping": true,
                          "mtr": true,
                          "trace": true,
                          "dnst": true,
                          "bgp": false,
                          "ipv4": true,
                          "ipv6": true
                        },
                        "status": true,
                        "providerurl": "https://www.mythic-beasts.com",
                        "latitude": 51.5,
                        "longitude": -0.12
                      }
                    ]
                  }
                ]
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/probes/mine": {
      "get": {
        "operationId": "listMyProbes",
        "summary": "List your probes",
        "description": "Probes you submitted, plus every probe on an AS number you operate according to PeeringDB. Includes ones that are pending or rejected.",
        "tags": [
          "Probes"
        ],
        "responses": {
          "200": {
            "description": "Your probes, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OwnedProbe"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/probes/{id}/history": {
      "get": {
        "operationId": "getProbeHistory",
        "summary": "Get a probe's history",
        "description": "What has happened to one of your probes, newest first: when it was submitted, approved, edited or removed, and by whom. For probes you submitted and probes on an AS number you operate. At most 100 entries.",
        "tags": [
          "Probes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The probe id, from `/probes/mine`.",
            "schema": {
              "type": "string",
              "example": "14bcf6d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The probe's history.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProbeEvent"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/results/{id}": {
      "get": {
        "operationId": "getResult",
        "summary": "Get a saved result",
        "description": "One saved test result, by its share id. Results expire; an expired or unknown id is a 404.",
        "tags": [
          "Results"
        ],
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The share id from the link, 22 characters.",
            "schema": {
              "type": "string",
              "example": "Zq3v0n1mXk8Yb2Lr5tHw9A"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The saved result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                },
                "example": {
                  "id": "Zq3v0n1mXk8Yb2Lr5tHw9A",
                  "test_type": "ping",
                  "target": "1.1.1.1",
                  "probe_id": "14bcf6d",
                  "probe_meta": {
                    "country": "DE",
                    "city": "Frankfurt",
                    "provider": "Example Networks",
                    "asnumber": 64500
                  },
                  "raw_lines": [
                    "PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.",
                    "64 bytes from 1.1.1.1: icmp_seq=1 ttl=58 time=1.12 ms"
                  ],
                  "created_at": "2026-11-15T03:10:00Z",
                  "expires_at": "2026-12-15T03:10:00Z"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/results/mine": {
      "get": {
        "operationId": "listMyResults",
        "summary": "List your saved results",
        "description": "Results from tests you ran while signed in or with your token, newest first. Summaries only: fetch `/results/{id}` for the output.",
        "tags": [
          "Results"
        ],
        "responses": {
          "200": {
            "description": "Your unexpired results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ResultSummary"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/bundles/{id}": {
      "get": {
        "operationId": "getBundle",
        "summary": "Get a bundle of results",
        "description": "Several results shared as one link (`/b/{id}` on the website).",
        "tags": [
          "Results"
        ],
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The share id from the link, 22 characters.",
            "schema": {
              "type": "string",
              "example": "Zq3v0n1mXk8Yb2Lr5tHw9A"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The bundle and its results.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bundle"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/account/credits": {
      "get": {
        "operationId": "getCredits",
        "summary": "Get your daily credits",
        "description": "How many test credits you have used today, when they reset, and how many API tokens your account may hold. Your daily limit is `base` plus `per_probe` for each sponsored probe you have online right now, so it can change during the day.",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "Your allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credits"
                },
                "example": {
                  "limit": 100,
                  "used": 1,
                  "remaining": 99,
                  "base": 50,
                  "per_probe": 25,
                  "online_probes": 2,
                  "resets_at": "2026-11-16T00:00:00Z",
                  "max_tokens": 10,
                  "unlimited_tokens": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/account/api-usage": {
      "get": {
        "operationId": "listApiUsage",
        "summary": "List your recent API calls",
        "description": "The last 100 requests made with your tokens, newest first: what was called, with which token, and how it went. Entries are kept for 90 days. This request is itself logged.",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "Your recent calls.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiCall"
                  }
                },
                "example": [
                  {
                    "id": 9041,
                    "user_id": 7,
                    "user_name": "Ada",
                    "token_id": 42,
                    "token_name": "ci-server",
                    "method": "POST",
                    "path": "/api/test",
                    "status": 200,
                    "duration_ms": 2310,
                    "test_type": "ping",
                    "target": "1.1.1.1",
                    "probe_id": "14bcf6d",
                    "created_at": "2026-11-15T10:00:00Z"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/account/tokens": {
      "get": {
        "operationId": "listTokens",
        "summary": "List your API tokens",
        "description": "Your tokens, newest first. The token itself is never returned after creation, only its first 12 characters. Tokens are created and revoked on the website only, under Account, API tokens: there are no endpoints for either.",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "Your tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiToken"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "A personal API token, created on the website under Account, API tokens. Send it as `Authorization: Bearer mtr_...`."
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "The token is missing, wrong or revoked. The body is empty."
      },
      "Forbidden": {
        "description": "The account is banned or has had API access switched off. The body is empty."
      },
      "NotFound": {
        "description": "Nothing with that id, or it has expired.",
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            },
            "example": "Not found"
          }
        }
      },
      "TooManyRequests": {
        "description": "Too many requests from your address in a short time. Wait a moment and retry.",
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            },
            "example": "Too many requests"
          }
        }
      },
      "ServiceUnavailable": {
        "description": "mtr.tools is down for maintenance, or this feature is switched off for now. Nothing is wrong with your request: wait and retry.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before trying again.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            },
            "example": "mtr.tools is down for maintenance. Please try again shortly."
          }
        }
      }
    },
    "schemas": {
      "RunTestRequest": {
        "type": "object",
        "required": [
          "type",
          "target",
          "probe"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "mtr",
              "ping",
              "trace",
              "dnst",
              "dnsr",
              "bgp"
            ],
            "description": "Which test to run. `dnst` traces DNS delegation, `dnsr` resolves a name, `bgp` looks up the route. Not every probe supports every type: see `caps` in `/probes.json`. Anything else is refused."
          },
          "target": {
            "type": "string",
            "description": "A hostname, IPv4 address or IPv6 address.",
            "example": "1.1.1.1"
          },
          "probe": {
            "type": "string",
            "description": "A probe id from `/probes.json` or `/probes/mine`.",
            "example": "14bcf6d"
          }
        }
      },
      "RunTestResponse": {
        "type": "object",
        "required": [
          "id",
          "type",
          "target",
          "probe",
          "lines",
          "expires_at",
          "credits"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Share id of the saved result."
          },
          "type": {
            "type": "string",
            "enum": [
              "mtr",
              "ping",
              "trace",
              "dnst",
              "dnsr",
              "bgp"
            ],
            "description": "The test that ran."
          },
          "target": {
            "type": "string",
            "description": "The target as it was used, with spaces removed."
          },
          "probe": {
            "type": "string",
            "description": "The probe that ran it."
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The tool's output, one line per entry."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the saved result is deleted."
          },
          "credits": {
            "$ref": "#/components/schemas/TestCredits"
          }
        }
      },
      "TestCredits": {
        "type": "object",
        "description": "Your daily allowance after this test.",
        "required": [
          "limit",
          "used",
          "remaining",
          "free",
          "resets_at"
        ],
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Your credits for today. It grows with each sponsored probe you have online."
          },
          "used": {
            "type": "integer",
            "description": "Credits used today."
          },
          "remaining": {
            "type": "integer",
            "description": "Credits left today."
          },
          "free": {
            "type": "boolean",
            "description": "True when this test was on your own probe and used no credit."
          },
          "resets_at": {
            "type": "string",
            "format": "date-time",
            "description": "When `used` goes back to zero: the next midnight UTC."
          }
        }
      },
      "ProbeGroup": {
        "type": "object",
        "required": [
          "name",
          "servers"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Region name, for example Europe."
          },
          "servers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Probe"
            },
            "description": "The probes in that region."
          }
        }
      },
      "Probe": {
        "type": "object",
        "required": [
          "id",
          "country",
          "country_code",
          "city",
          "provider",
          "asnumber",
          "residential",
          "caps",
          "status",
          "providerurl"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Probe id. Pass it as `probe` to `/api/test`."
          },
          "country": {
            "type": "string",
            "description": "Country as its sponsor wrote it: a name or a two-letter code."
          },
          "country_code": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, for example `GB`. Empty if not known.",
            "example": "GB"
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "provider": {
            "type": "string",
            "description": "The network that sponsors the probe."
          },
          "asnumber": {
            "type": "integer",
            "description": "AS number the probe sits on."
          },
          "residential": {
            "type": "boolean",
            "description": "True for a probe on a home connection."
          },
          "sponsored": {
            "type": "boolean",
            "description": "False for a probe mtr.tools runs itself rather than one a sponsor provides."
          },
          "caps": {
            "$ref": "#/components/schemas/ProbeCaps"
          },
          "status": {
            "type": "boolean",
            "description": "True when the probe is reachable."
          },
          "providerurl": {
            "type": "string",
            "description": "The sponsor's website."
          },
          "latitude": {
            "type": [
              "number",
              "null"
            ],
            "description": "Approximate latitude."
          },
          "longitude": {
            "type": [
              "number",
              "null"
            ],
            "description": "Approximate longitude."
          }
        }
      },
      "ProbeCaps": {
        "type": "object",
        "description": "What the probe can do. A flag that is missing or false means not supported.",
        "properties": {
          "mtr": {
            "type": "boolean",
            "description": "Can run `mtr`."
          },
          "ping": {
            "type": "boolean",
            "description": "Can run `ping`."
          },
          "trace": {
            "type": "boolean",
            "description": "Can run `trace`."
          },
          "dnst": {
            "type": "boolean",
            "description": "Can run `dnst`."
          },
          "dnsr": {
            "type": "boolean",
            "description": "Can run `dnsr`."
          },
          "bgp": {
            "type": "boolean",
            "description": "Can run `bgp`."
          },
          "ipv4": {
            "type": "boolean",
            "description": "Has working IPv4."
          },
          "ipv6": {
            "type": "boolean",
            "description": "Has working IPv6."
          }
        }
      },
      "OwnedProbe": {
        "type": "object",
        "description": "A probe as its owner sees it, including where it is in review.",
        "required": [
          "id",
          "country",
          "country_code",
          "city",
          "provider",
          "asnumber",
          "providerurl",
          "status",
          "transport"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Probe id."
          },
          "country": {
            "type": "string",
            "description": "Country as its sponsor wrote it: a name or a two-letter code."
          },
          "country_code": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, for example `GB`. Empty if not known.",
            "example": "GB"
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "provider": {
            "type": "string",
            "description": "Sponsor name."
          },
          "asnumber": {
            "type": "integer",
            "description": "AS number."
          },
          "providerurl": {
            "type": "string",
            "description": "Sponsor website."
          },
          "latitude": {
            "type": [
              "number",
              "null"
            ],
            "description": "Approximate latitude."
          },
          "longitude": {
            "type": [
              "number",
              "null"
            ],
            "description": "Approximate longitude."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "live",
              "rejected"
            ],
            "description": "Where the probe is in review."
          },
          "submitted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was submitted."
          },
          "reviewed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When an admin reviewed it."
          },
          "reject_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it was rejected, if it was."
          },
          "transport": {
            "type": "string",
            "enum": [
              "ssh",
              "agent"
            ],
            "description": "How we reach the probe."
          },
          "connected": {
            "type": "boolean",
            "description": "For an agent probe, whether the agent is connected right now."
          },
          "last_connected_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When an agent last connected, or null if it never has."
          },
          "sponsored": {
            "type": "boolean",
            "description": "False for a probe mtr.tools runs itself rather than one a sponsor provides."
          },
          "uptime_30d": {
            "type": [
              "number",
              "null"
            ],
            "description": "Percent of the last 30 days the probe was reachable, to one decimal. Null until there is some history."
          }
        }
      },
      "ProbeEvent": {
        "type": "object",
        "description": "One thing that happened to a probe.",
        "required": [
          "id",
          "probe_id",
          "probe_label",
          "actor_name",
          "action",
          "detail",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "Entry id."
          },
          "probe_id": {
            "type": "string",
            "description": "The probe."
          },
          "probe_label": {
            "type": "string",
            "description": "The probe as it was named at the time: place, then sponsor."
          },
          "actor_user_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The account that did it, or null when mtr.tools did it automatically."
          },
          "actor_name": {
            "type": "string",
            "description": "That account's name at the time. Empty for an automatic action."
          },
          "action": {
            "type": "string",
            "description": "What happened: `submitted`, `approved`, `went_live`, `rejected`, `edited`, `edit_requested`, `removal_requested`, `request_dismissed`, `removed`, `key_issued` or `key_revoked`. New kinds may be added."
          },
          "detail": {
            "type": "object",
            "additionalProperties": true,
            "description": "Extra facts about the action, such as the fields an edit changed or the reason given. Its keys depend on the action."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it happened."
          }
        }
      },
      "ProbeMeta": {
        "type": [
          "object",
          "null"
        ],
        "description": "The probe's details as they were when the test ran.",
        "properties": {
          "country": {
            "type": "string",
            "description": "Country."
          },
          "country_code": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, for example `GB`. Missing on results saved before this field existed.",
            "example": "GB"
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "provider": {
            "type": "string",
            "description": "Sponsor name."
          },
          "asnumber": {
            "type": "integer",
            "description": "AS number."
          }
        }
      },
      "ResultSummary": {
        "type": "object",
        "required": [
          "id",
          "test_type",
          "target",
          "probe_id",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Share id."
          },
          "test_type": {
            "type": "string",
            "description": "The test that ran, for example ping."
          },
          "target": {
            "type": "string",
            "description": "What was tested."
          },
          "probe_id": {
            "type": "string",
            "description": "The probe that ran it."
          },
          "probe_meta": {
            "$ref": "#/components/schemas/ProbeMeta"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it ran."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it is deleted."
          }
        }
      },
      "Result": {
        "type": "object",
        "required": [
          "id",
          "test_type",
          "target",
          "probe_id",
          "raw_lines",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Share id."
          },
          "test_type": {
            "type": "string",
            "description": "The test that ran."
          },
          "target": {
            "type": "string",
            "description": "What was tested."
          },
          "probe_id": {
            "type": "string",
            "description": "The probe that ran it."
          },
          "probe_meta": {
            "$ref": "#/components/schemas/ProbeMeta"
          },
          "raw_lines": {
            "type": [
              "array",
              "object"
            ],
            "items": {
              "type": "string"
            },
            "description": "The output. Usually an array of text lines. For tests the server could parse, an object instead: `format` names the layout (`structured-v1`) and `result` holds the parsed measurement."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it ran."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it is deleted."
          }
        }
      },
      "Bundle": {
        "type": "object",
        "required": [
          "id",
          "created_at",
          "expires_at",
          "results"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Share id of the bundle."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it is deleted."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Result"
            },
            "description": "The results in the bundle."
          }
        }
      },
      "Credits": {
        "type": "object",
        "required": [
          "limit",
          "used",
          "remaining",
          "base",
          "per_probe",
          "online_probes",
          "resets_at",
          "max_tokens",
          "unlimited_tokens"
        ],
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Test credits per day."
          },
          "used": {
            "type": "integer",
            "description": "Credits used today."
          },
          "remaining": {
            "type": "integer",
            "description": "Credits left today."
          },
          "base": {
            "type": "integer",
            "description": "The daily credits every account gets."
          },
          "per_probe": {
            "type": "integer",
            "description": "Extra daily credits for each sponsored probe you have online."
          },
          "online_probes": {
            "type": "integer",
            "description": "How many of your sponsored probes are online right now: live probes you own or that sit on a network you run."
          },
          "resets_at": {
            "type": "string",
            "format": "date-time",
            "description": "When `used` goes back to zero: the next midnight UTC."
          },
          "max_tokens": {
            "type": "integer",
            "description": "Most API tokens an account may hold at once."
          },
          "unlimited_tokens": {
            "type": "boolean",
            "description": "True when the limits have been lifted for this account: it may hold any number of tokens and its tests use no credits."
          }
        }
      },
      "ApiCall": {
        "type": "object",
        "description": "One request made with an API token.",
        "required": [
          "id",
          "user_id",
          "user_name",
          "token_name",
          "method",
          "path",
          "status",
          "duration_ms",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "Entry id."
          },
          "user_id": {
            "type": "integer",
            "description": "Your account id."
          },
          "user_name": {
            "type": "string",
            "description": "Your account name."
          },
          "token_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The token used. Still set after that token is revoked."
          },
          "token_name": {
            "type": "string",
            "description": "The token's label when the call was made."
          },
          "method": {
            "type": "string",
            "description": "HTTP method."
          },
          "path": {
            "type": "string",
            "description": "The path that was called, without its query string."
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status we answered with."
          },
          "duration_ms": {
            "type": "integer",
            "description": "How long the request took, in milliseconds."
          },
          "test_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "For `/api/test`, the test that was asked for."
          },
          "target": {
            "type": [
              "string",
              "null"
            ],
            "description": "For `/api/test`, the target."
          },
          "probe_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "For `/api/test`, the probe."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the call was made."
          }
        }
      },
      "ApiToken": {
        "type": "object",
        "required": [
          "id",
          "name",
          "prefix",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "Token id, used to revoke it."
          },
          "name": {
            "type": "string",
            "description": "The label you gave it."
          },
          "prefix": {
            "type": "string",
            "description": "The first 12 characters of the token, to tell them apart."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created."
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was last used, or null if never."
          }
        }
      }
    }
  }
}