{
  "openapi": "3.1.0",
  "info": {
    "title": "Encode Wiki static content API",
    "version": "1.0.0",
    "description": "Read-only, build-generated access to the public Encode Wiki corpus. All responses are static and allow cross-origin GET requests.",
    "license": {
      "name": "CC BY-SA 4.0",
      "url": "https://creativecommons.org/licenses/by-sa/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://encode.wiki"
    }
  ],
  "paths": {
    "/api/v1/authors.json": {
      "get": {
        "operationId": "listAuthors",
        "summary": "Resolve typed article author IDs",
        "responses": {
          "200": {
            "description": "Public author profiles",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/index.json": {
      "get": {
        "operationId": "listDocuments",
        "summary": "Enumerate public corpus documents",
        "responses": {
          "200": {
            "description": "Corpus index",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Index"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{id}.json": {
      "get": {
        "operationId": "getDocument",
        "summary": "Retrieve metadata and cleaned Markdown for one document",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "description": "Slash-delimited ID from the index, such as docs/guides/quality-controls.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Corpus document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://encode.wiki/api/v1/schema.json"
                }
              }
            }
          },
          "404": {
            "description": "No public document has this ID"
          }
        }
      }
    },
    "/api/v1/markdown/{id}.md": {
      "get": {
        "operationId": "getDocumentMarkdown",
        "summary": "Retrieve cleaned Markdown with attribution headers",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Clean Markdown",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/release.json": {
      "get": {
        "operationId": "getRelease",
        "summary": "Retrieve corpus version and artifact checksums",
        "responses": {
          "200": {
            "description": "Release metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/knowledge.ndjson.gz": {
      "get": {
        "operationId": "downloadKnowledgeBundle",
        "summary": "Download every public corpus document as gzip-compressed NDJSON",
        "responses": {
          "200": {
            "description": "Gzip-compressed corpus bundle",
            "content": {
              "application/gzip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Index": {
        "type": "object",
        "required": [
          "schemaVersion",
          "contentVersion",
          "contentChecksum",
          "documents"
        ],
        "properties": {
          "schemaVersion": {
            "type": "integer"
          },
          "contentVersion": {
            "type": "string"
          },
          "contentChecksum": {
            "type": "string"
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}
