{
 "openapi": "3.1.0",
 "info": {
  "title": "Kitaab open data and tools",
  "version": "1.0.0",
  "summary": "Free, sourced guides to real-life processes in India, legal deadlines, letters, the Reply Decoder, the second ask, OpenTimestamps stamping and an MCP server.",
  "license": {
   "name": "CC BY 4.0",
   "url": "https://creativecommons.org/licenses/by/4.0/"
  },
  "contact": {
   "name": "Kitaab",
   "email": "hello@kitaab.live",
   "url": "https://kitaab.live/agents"
  }
 },
 "servers": [
  {
   "url": "https://kitaab.live"
  }
 ],
 "paths": {
  "/data/guides/index.json": {
   "get": {
    "summary": "Every guide, with its area and counts",
    "responses": {
     "200": {
      "description": "Guide index",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/data/guides/{slug}.json": {
   "get": {
    "summary": "One guide: steps, documents, fees, legal clocks, messages, letters, escalation, sources",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The guide",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "404": {
      "description": "No such guide"
     }
    }
   }
  },
  "/data/clocks.json": {
   "get": {
    "summary": "Every legal clock in the guides, with its basis and source",
    "responses": {
     "200": {
      "description": "Clocks",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/data/letters.json": {
   "get": {
    "summary": "Every letter and handoff message in the guides, with fields to fill",
    "responses": {
     "200": {
      "description": "Letters and messages",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/data/reply-decoder.json": {
   "get": {
    "summary": "Short replies across languages and emoji: readings, risk if misread, and the question that settles each",
    "responses": {
     "200": {
      "description": "Reply library",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/data/second-ask.json": {
   "get": {
    "summary": "Polite follow-ups for six situations in 34 languages",
    "responses": {
     "200": {
      "description": "Follow-up templates",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/data/reply-corpus/corpus.json": {
   "get": {
    "summary": "The reply corpus, seed edition: replies across languages and emoji with families, readings and the question that settles each",
    "responses": {
     "200": {
      "description": "Corpus",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/data/atlas/index.json": {
   "get": {
    "summary": "The Atlas open data: the list of tables, each also as CSV",
    "responses": {
     "200": {
      "description": "Atlas index",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/ots": {
   "post": {
    "summary": "Relay a 32-byte commitment to the public OpenTimestamps calendars",
    "parameters": [
     {
      "name": "op",
      "in": "query",
      "required": true,
      "schema": {
       "const": "stamp"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "digest": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
         }
        },
        "required": [
         "digest"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Each calendar's answer, base64",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   },
   "get": {
    "summary": "Ask a calendar for an upgraded proof",
    "parameters": [
     {
      "name": "op",
      "in": "query",
      "required": true,
      "schema": {
       "const": "upgrade"
      }
     },
     {
      "name": "calendar",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uri"
      }
     },
     {
      "name": "commitment",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^([0-9a-f]{2})+$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "found, pending or error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/mcp": {
   "post": {
    "summary": "Model Context Protocol (Streamable HTTP, stateless): JSON-RPC in, JSON out",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "JSON-RPC response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "202": {
      "description": "Notification accepted"
     }
    }
   }
  }
 }
}
