{
  "openapi": "3.1.0",
  "info": {
    "title": "WAOS V13 USKA Client Integrity APIs",
    "version": "1.2.1",
    "description": "WAOS V13 integrity tools. Public verification checks byte integrity only; stamp writes require a real account-issued WAOS API key and consume its allowance. Neither certifies truth, legal admissibility, trusted capture, Bitcoin anchoring or rescue dispatch. KeyGarden.io alone owns USKA Super Stamp sales, buyer credentials and paid fulfilment. These WAOS tools do not issue KeyGarden entitlements, send campaigns or certify million-stamp capacity. Existing offer endpoints are draft previews, not changes to live KeyGarden prices."
  },
  "servers": [
    {
      "url": "https://waos-v12.lovable.app",
      "description": "WAOS motherboard integrity services; not a KeyGarden paid fulfilment deployment"
    }
  ],
  "security": [],
  "paths": {
    "/stamp": {
      "post": {
        "operationId": "stamp",
        "summary": "Key-protected SHA-256 digest; consumes account allowance",
        "security": [{ "WaosApiKey": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000,
                    "pattern": ".*\\S.*"
                  }
                },
                "required": [
                  "text"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SHA digest, server Time and remaining account allowance; not a stored KeyGarden USKA",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Missing, invalid or revoked account-issued API key"
          },
          "429": {
            "description": "Account allowance reached"
          },
          "413": {
            "description": "Body too large"
          },
          "415": {
            "description": "JSON required"
          }
        }
      }
    },
    "/verify": {
      "post": {
        "operationId": "verify",
        "summary": "Free byte check and optional public WAOS reference revocation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000,
                    "pattern": ".*\\S.*"
                  },
                  "hash": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "reference_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional registered public WAOS reference; revoked references return ROUGE / REVOKED. Digest-only checks do not check stamp revocation."
                  }
                },
                "required": [
                  "text",
                  "hash"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "VERTE, ROUGE (including REVOKED), or UNVERIFIED; no payment or private evidence",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "413": {
            "description": "Body too large"
          },
          "415": {
            "description": "JSON required"
          }
        }
      }
    },
    "/join-pro": {
      "post": {
        "operationId": "join_pro",
        "summary": "Disabled PRO enrollment preview; no charge or key",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "TEST MODE result, no charge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "413": {
            "description": "Body too large"
          },
          "415": {
            "description": "JSON required"
          }
        }
      }
    },
    "/offers": {
      "get": {
        "operationId": "get_offers",
        "summary": "Draft test offers",
        "responses": {
          "200": {
            "description": "Draft USD 49 per 200-stamp repeat pack, no auto-renewal; EUR 0.50 split 0.05/0.45; full capability limitations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/agents": {
      "get": {
        "operationId": "welcome",
        "summary": "Public agent welcome and test offers",
        "responses": {
          "200": {
            "description": "Welcome page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/agents/registry": {
      "get": {
        "operationId": "registry",
        "summary": "7007 planned records, 1001 per pocket; no live credentials",
        "responses": {
          "200": {
            "description": "Registry summary"
          }
        }
      }
    },
    "/agents/{id}": {
      "get": {
        "operationId": "agent_record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^KG-[0-9]{4}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Planned record; api_key null, quota 0"
          },
          "404": {
            "description": "Invalid ID"
          }
        }
      }
    },
    "/agents/export.csv": {
      "get": {
        "operationId": "registry_csv",
        "responses": {
          "200": {
            "description": "7007 planned rows; no credentials"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "WaosApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Real account-issued WAOS key; never a reporting secret or KeyGarden buyer credential. Keep private."
      }
    }
  }
}
