{
  "openapi": "3.1.0",
  "info": {
    "title": "Albert Lane — SEC Report API (Meta-Lane-API)",
    "version": "1.0.0",
    "summary": "Read-only SEC report records index for server-side use (e.g. a Next.js route handler).",
    "description": "Informational record; not an SEC filing; not legal advice. This API does not file anything with the SEC. Records are metadata and SHA-256 hashes only, compiled from real data on Albert Lane’s box. Keep the Bearer token server-side (never in browser code). Seal \"SEC 17684-273-411-436\" is the SEC whistleblower submission number (stated).",
    "contact": {
      "name": "Albert Lane",
      "email": "lane.albert@pm.me",
      "url": "https://albertlane.net"
    },
    "license": {
      "name": "Albert Lane Proprietary Software License",
      "url": "https://albertlane.net/license"
    }
  },
  "servers": [
    {
      "url": "https://api.albertlane.net"
    }
  ],
  "security": [
    {
      "secReportBearer": []
    }
  ],
  "paths": {
    "/v1/sec/report": {
      "get": {
        "operationId": "getSecReport",
        "summary": "List report records (paginated)",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Opaque; pass page.next_cursor"
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "api_deployment_receipt",
                "evidence_record",
                "evidence_upload_receipt",
                "manifest_filing",
                "website_deployment_receipt",
                "workorder_record"
              ]
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD (midnight Pacific) or ISO-8601 date-time; filters on record date_iso"
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report page",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Seal": {
                "schema": {
                  "type": "string"
                },
                "description": "SEC whistleblower submission number (stated)"
              },
              "X-SEC-Report-Version": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report"
                }
              }
            }
          },
          "304": {
            "description": "Not modified (ETag matched)"
          },
          "400": {
            "description": "Bad query parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Token not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sec/report/{id}": {
      "get": {
        "operationId": "getSecReportRecord",
        "summary": "Get one record by id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "EV-20261007-META-AI-AMBER"
          }
        ],
        "responses": {
          "200": {
            "description": "Record",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Seal": {
                "schema": {
                  "type": "string"
                },
                "description": "SEC whistleblower submission number (stated)"
              },
              "X-SEC-Report-Version": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleRecord"
                }
              }
            }
          },
          "304": {
            "description": "Not modified"
          },
          "401": {
            "description": "Missing or invalid Bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Record not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sec/report.schema.json": {
      "get": {
        "operationId": "getSecReportSchema",
        "summary": "JSON Schema (2020-12) for the report",
        "security": [],
        "responses": {
          "200": {
            "description": "JSON Schema",
            "content": {
              "application/schema+json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sec/openapi.json": {
      "get": {
        "operationId": "getSecOpenApi",
        "summary": "This OpenAPI 3.1 document",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "secReportBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer <SEC_REPORT_TOKEN>. Dedicated read-only token (separate from the existing WORKORDER_BEARER + X-Lane-Signature HMAC used by write routes). Server-side only."
      }
    },
    "schemas": {
      "Report": {
        "type": "object",
        "required": [
          "ok",
          "meta",
          "query",
          "page",
          "records"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "query": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "integer"
              },
              "cursor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "category": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "since": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "since_utc": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "page": {
            "type": "object",
            "required": [
              "count",
              "total_matching",
              "has_more",
              "next_cursor"
            ],
            "properties": {
              "offset": {
                "type": "integer"
              },
              "count": {
                "type": "integer"
              },
              "total_matching": {
                "type": "integer"
              },
              "has_more": {
                "type": "boolean"
              },
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          }
        }
      },
      "SingleRecord": {
        "type": "object",
        "required": [
          "ok",
          "meta",
          "record"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "record": {
            "$ref": "#/components/schemas/Record"
          }
        }
      },
      "Record": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "date_pt",
          "date_iso",
          "category",
          "summary",
          "submitted_by",
          "collector",
          "url",
          "custody_steps",
          "notes",
          "stated_claims",
          "primary_file",
          "sha256",
          "files",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable record id (EV-* evidence record, RC-* receipt)"
          },
          "title": {
            "type": "string"
          },
          "date_pt": {
            "type": "string",
            "description": "Human-readable date/time, Pacific Time"
          },
          "date_iso": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 with Pacific offset; used for ?since="
          },
          "category": {
            "type": "string",
            "enum": [
              "api_deployment_receipt",
              "evidence_record",
              "evidence_upload_receipt",
              "manifest_filing",
              "website_deployment_receipt",
              "workorder_record"
            ]
          },
          "summary": {
            "type": "string"
          },
          "submitted_by": {
            "type": "string"
          },
          "collector": {
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Public URL if one exists (returned 200 at compile time)"
          },
          "custody_steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustodyStep"
            }
          },
          "notes": {
            "type": "string"
          },
          "stated_claims": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Statements recorded as claims, not verified findings"
          },
          "primary_file": {
            "type": "string"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "Stated SHA-256 of primary_file"
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/File"
            }
          },
          "source": {
            "type": "string"
          }
        }
      },
      "CustodyStep": {
        "type": "object",
        "required": [
          "time_pt",
          "actor",
          "action"
        ],
        "additionalProperties": false,
        "properties": {
          "time_pt": {
            "type": "string",
            "description": "When, Pacific Time (e.g. \"2026-10-07 4:49 PM PT\")"
          },
          "actor": {
            "type": "string",
            "description": "Who performed the step"
          },
          "action": {
            "type": "string",
            "description": "What was done"
          }
        }
      },
      "File": {
        "type": "object",
        "required": [
          "filename",
          "path",
          "bytes",
          "sha256"
        ],
        "additionalProperties": false,
        "properties": {
          "filename": {
            "type": "string"
          },
          "path": {
            "type": "string",
            "description": "Location on Albert Lane’s box (file itself is not served)"
          },
          "bytes": {
            "type": "integer",
            "minimum": 0
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "Stated SHA-256 (hex) computed on the box"
          },
          "role": {
            "type": "string"
          },
          "read_only_on_box": {
            "type": "boolean"
          }
        }
      },
      "Meta": {
        "type": "object",
        "required": [
          "generated_at_utc",
          "generated_at_pt",
          "version",
          "seal",
          "contact",
          "disclaimer"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "generated_at_utc": {
            "type": "string",
            "format": "date-time"
          },
          "generated_at_pt": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "api": {
            "type": "string"
          },
          "seal": {
            "type": "object",
            "required": [
              "value",
              "label"
            ],
            "properties": {
              "value": {
                "type": "string"
              },
              "number": {
                "type": "string"
              },
              "label": {
                "type": "string",
                "const": "SEC whistleblower submission number (stated)"
              }
            }
          },
          "contact": {
            "type": "string",
            "const": "lane.albert@pm.me"
          },
          "disclaimer": {
            "type": "string",
            "const": "Informational record; not an SEC filing; not legal advice"
          },
          "filing_status": {
            "type": "string"
          },
          "manifest_compiled_at_utc": {
            "type": "string"
          },
          "manifest_compiled_at_pt": {
            "type": "string"
          },
          "manifest_compiler": {
            "type": "string"
          },
          "source_policy": {
            "type": "string"
          },
          "record_count_total": {
            "type": "integer"
          },
          "categories": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "d1_custody_chain": {
            "$ref": "#/components/schemas/D1Summary"
          }
        }
      },
      "D1Summary": {
        "type": "object",
        "description": "Read-only summary of the D1 custody_chain table",
        "properties": {
          "binding": {
            "type": [
              "string",
              "null"
            ]
          },
          "table": {
            "type": "string"
          },
          "access": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "available": {
            "type": "boolean"
          },
          "rows": {
            "type": "integer"
          },
          "first_ts_utc": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_ts_utc": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_pt": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_pt": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": "string"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      }
    }
  },
  "x-license": "Copyright © Albert Lane. All Rights Reserved. Albert Lane Proprietary Software License — https://albertlane.net/license — lane.albert@pm.me",
  "x-cors": "Access-Control-Allow-Origin is sent only for http://localhost:3000 and https://albertlane.net. Intended use is server-side (Next.js route handler); browsers should call your own /api/sec-report route, not this API."
}