{
  "openapi": "3.1.0",
  "info": {
    "title": "Interview Records API",
    "version": "1.0.0",
    "description": "Static API for Interview Records generated from canonical archive source data."
  },
  "servers": [
    {
      "url": "https://interviewrecords.org"
    }
  ],
  "paths": {
    "/api/v1/people": {
      "get": {
        "summary": "List people",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/people/{idOrSlug}": {
      "get": {
        "summary": "Get person by public ID or slug",
        "parameters": [
          {
            "in": "path",
            "name": "idOrSlug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/people/{idOrSlug}/interviews": {
      "get": {
        "summary": "List interviews for a person",
        "parameters": [
          {
            "in": "path",
            "name": "idOrSlug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/interviews": {
      "get": {
        "summary": "List interviews",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/interviews/{idOrSlug}": {
      "get": {
        "summary": "Get interview by public ID, slug, or ID",
        "parameters": [
          {
            "in": "path",
            "name": "idOrSlug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/interviews/{idOrSlug}/quotes": {
      "get": {
        "summary": "List quotes for an interview",
        "parameters": [
          {
            "in": "path",
            "name": "idOrSlug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/quotes/{quoteId}": {
      "get": {
        "summary": "Get quote by public ID",
        "parameters": [
          {
            "in": "path",
            "name": "quoteId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/search": {
      "get": {
        "summary": "Search index payload",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/coverage": {
      "get": {
        "summary": "Coverage rows",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/manifest": {
      "get": {
        "summary": "Latest API manifest",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/openapi": {
      "get": {
        "summary": "OpenAPI contract for /api/v1",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiEnvelope": {
        "type": "object",
        "required": [
          "schema_version",
          "generated_at",
          "data",
          "links",
          "meta"
        ],
        "properties": {
          "schema_version": {
            "type": "string",
            "example": "1.0"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-04-08T00:00:00Z"
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          },
          "links": {
            "type": "object",
            "additionalProperties": true
          },
          "meta": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    }
  }
}
