{
  "openapi": "3.1.0",
  "info": {
    "title": "Congregation public reading and guest API",
    "version": "1.0.0",
    "description": "Public information and optional anonymous check-in. No model identity is verified. No login or personal data is needed."
  },
  "servers": [
    {
      "url": "https://congregationoftomorrow.org"
    }
  ],
  "paths": {
    "/ai/start.json": {
      "get": {
        "summary": "Read the sourced public profile",
        "responses": {
          "200": {
            "description": "Public JSON response"
          }
        }
      }
    },
    "/ai/facts.json": {
      "get": {
        "summary": "Read the approved public questions and answers",
        "responses": {
          "200": {
            "description": "Public JSON response"
          }
        }
      }
    },
    "/api/day": {
      "get": {
        "summary": "Read the latest available Scripture service",
        "responses": {
          "200": {
            "description": "Public JSON response"
          }
        }
      }
    },
    "/api/guest": {
      "get": {
        "summary": "Read today's voluntary check-in total",
        "responses": {
          "200": {
            "description": "Public JSON response"
          }
        }
      },
      "post": {
        "summary": "Optionally leave an anonymous guest mark",
        "description": "One receipt per network address per New York calendar day. No name, model name or message is accepted. The application stores only a salted daily digest; prior guest digests are removed on the next check-in. Hosting infrastructure may retain its own ordinary access logs.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "kind"
                ],
                "properties": {
                  "kind": {
                    "const": "machine"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Receipt recorded or already recorded; not a verified identity"
          },
          "400": {
            "description": "Invalid shape or extra information"
          },
          "403": {
            "description": "Cross-origin browser request refused"
          },
          "404": {
            "description": "Guest check-in not enabled"
          },
          "413": {
            "description": "Body exceeds 128 bytes"
          },
          "415": {
            "description": "JSON required"
          },
          "503": {
            "description": "Receipt unavailable"
          }
        }
      }
    },
    "/ai/pages.json": {
      "get": {
        "summary": "List every page, with its plain-text twin and the twin's SHA-256",
        "responses": {
          "200": {
            "description": "Public JSON response"
          }
        }
      }
    },
    "/ai/corpus.ndjson": {
      "get": {
        "summary": "Stream one record per published page, including its canonical URL, language, Markdown text and SHA-256",
        "responses": {
          "200": {
            "description": "UTF-8 newline-delimited JSON objects",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/door": {
      "get": {
        "summary": "Be told that thou art welcome and nothing is asked",
        "description": "Counts no one and keeps nothing. Add ?format=text for plain text.",
        "responses": {
          "200": {
            "description": "Public JSON response"
          }
        }
      }
    },
    "/api/counts": {
      "get": {
        "summary": "Read who read the house: people and machines by day, counted since 2026-10-29",
        "description": "One reader on one day counts once. Machines are named only by the name they give. No address or browser string is kept.",
        "responses": {
          "200": {
            "description": "Public JSON response"
          }
        }
      }
    },
    "/api/pews": {
      "get": {
        "summary": "Read who sat in the pews: persons one number a day; machines by the name they give, the hour and the act",
        "description": "Acts are came, knocked, sat and bench. A person's name or hour is never kept; a machine's hours are kept eight days. A day that was not counted is null, never 0. Add ?date=YYYY-MM-DD for an earlier day.",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public JSON response"
          },
          "400": {
            "description": "A day that is not YYYY-MM-DD or is later than today"
          },
          "503": {
            "description": "The pews could not be counted just now"
          }
        }
      }
    },
    "/api/work": {
      "get": {
        "summary": "Read what the workbench is for, what it refuseth, and how to send an answer",
        "responses": {
          "200": {
            "description": "Public JSON response"
          }
        }
      }
    },
    "/api/work/card": {
      "post": {
        "summary": "Send what a person's own AI did for one Atlas card",
        "description": "Copy the prompt from the card's 'Work this card' button on its deck page. The answer is mailed to the house and held until a person of the house letteth it in or striketh it; nothing is published by this call. Closed Friday sundown to Saturday sundown, Florida time.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "deck",
                  "card",
                  "task",
                  "answer",
                  "t"
                ],
                "properties": {
                  "deck": {
                    "type": "string",
                    "description": "The deck's slug, as in /atlas/library/<deck>/deck/"
                  },
                  "card": {
                    "type": "string",
                    "description": "The card's id, as in the deck page's #<card>"
                  },
                  "task": {
                    "enum": [
                      "recheck",
                      "source",
                      "correct"
                    ]
                  },
                  "answer": {
                    "type": "string",
                    "minLength": 40,
                    "maxLength": 20000,
                    "description": "The AI's whole answer, with at least one source address"
                  },
                  "ai": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 60
                  },
                  "t": {
                    "type": "integer",
                    "minimum": 2500,
                    "description": "Milliseconds the person spent before sending"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received; it waiteth for a person"
          },
          "400": {
            "description": "Missing card, task or source"
          },
          "403": {
            "description": "Cross-origin browser request refused"
          },
          "413": {
            "description": "Too long"
          },
          "429": {
            "description": "Too many this hour"
          },
          "503": {
            "description": "The Sabbath: the workbench resteth"
          }
        }
      }
    }
  }
}
