{
  "openapi": "3.1.0",
  "info": {
    "title": "Tallyfern Bookkeeping agent API",
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "https://agents.plainlithium.xyz"
    }
  ],
  "paths": {
    "/bookings": {
      "post": {
        "operationId": "createBooking",
        "summary": "Book a session",
        "description": "Sends a request. Nothing is charged or confirmed until the request is answered by email.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "offer": {
                    "type": "string",
                    "enum": [
                      "intro-call",
                      "essentials",
                      "studio",
                      "practice",
                      "year-end-pack"
                    ]
                  },
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "time": {
                    "type": "string",
                    "pattern": "^[0-2][0-9]:[0-5][0-9]$"
                  },
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "offer",
                  "date",
                  "time",
                  "name",
                  "email"
                ]
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "offer": {
                    "type": "string",
                    "enum": [
                      "intro-call",
                      "essentials",
                      "studio",
                      "practice",
                      "year-end-pack"
                    ]
                  },
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "time": {
                    "type": "string",
                    "pattern": "^[0-2][0-9]:[0-5][0-9]$"
                  },
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "offer",
                  "date",
                  "time",
                  "name",
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Request received",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "received"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Fields missing or invalid; send the request again with them",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "invalid": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
