{
  "openapi": "3.1.0",
  "info": {
    "title": "Shooter Atlas agent lookup API",
    "version": "1.0.0",
    "description": "Read-only lookup over the pages this site publishes. No credential is required and no endpoint accepts a write."
  },
  "servers": [
    {
      "url": "https://shooteratlas.com"
    }
  ],
  "paths": {
    "/api/agent/pages": {
      "get": {
        "operationId": "listPages",
        "summary": "List every page with its title, description and last modification date",
        "responses": {
          "200": {
            "description": "The page index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "site": {
                      "type": "string"
                    },
                    "generated": {
                      "type": "string"
                    },
                    "pages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "last_modified": {
                            "type": "string"
                          },
                          "markdown_url": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/pages/{id}": {
      "get": {
        "operationId": "readPage",
        "summary": "Read one page as markdown, with its headings, source file and read dates",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Page id: the path without the leading slash, for example wardogs-price",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The page record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "No page with that id",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
