{
  "openapi": "3.1.0",
  "info": {
    "title": "puna.one Gen X YouTube guide contract",
    "version": "1.0.0",
    "description": "GET /insights/gen-x-youtube/ has no inputs. Reading the guide is the primary action. A free consult, when a person asks to book, uses the published booking POSTs, which match https://puna.one/agents/openapi.json, with service_type free_ai_consultation. 2016 study figures are not a current measurement."
  },
  "externalDocs": {
    "description": "Distinct shared booking contract. The POST operations in this file match it.",
    "url": "https://puna.one/agents/openapi.json"
  },
  "servers": [
    {
      "url": "https://puna.one"
    }
  ],
  "paths": {
    "/functions/v1/check-consultation-availability": {
      "post": {
        "operationId": "checkAvailability",
        "summary": "Check whether a time is open",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "preferred_date",
                  "preferred_time"
                ],
                "properties": {
                  "preferred_date": {
                    "$ref": "#/components/schemas/Date"
                  },
                  "preferred_time": {
                    "$ref": "#/components/schemas/Time"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Whether the time is open",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "available": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The date or time can never be booked: past, weekend, more than 90 days out, or outside 07:00 to 17:00 Hawaii time",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "available": {
                      "type": "boolean",
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "problems": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests"
          }
        },
        "security": [],
        "description": "Check whether a date and time can be booked. runtime_verified:false."
      }
    },
    "/functions/v1/agent-booking": {
      "post": {
        "operationId": "requestMeeting",
        "summary": "Request a meeting for a person",
        "description": "Emails the person a confirmation link that works for 24 hours. The request reaches the puna.one team only after they confirm. Each email address can receive three confirmation emails a day. runtime_verified:false.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "full_name",
                  "email",
                  "service_type",
                  "preferred_date",
                  "preferred_time"
                ],
                "properties": {
                  "full_name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "description": "Name of the agent's owner or human contact, the person the meeting is for."
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 320,
                    "description": "That person's email address. The confirmation link is sent here."
                  },
                  "service_type": {
                    "type": "string",
                    "enum": [
                      "free_ai_consultation",
                      "ai_strategy_session",
                      "managed_services_intro"
                    ]
                  },
                  "preferred_date": {
                    "$ref": "#/components/schemas/Date"
                  },
                  "preferred_time": {
                    "$ref": "#/components/schemas/Time"
                  },
                  "location": {
                    "type": "string",
                    "enum": [
                      "zoom",
                      "google_meet"
                    ],
                    "default": "zoom"
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "company": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "agent_name": {
                    "type": "string",
                    "maxLength": 200
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Confirmation email sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "awaiting_confirmation"
                    },
                    "message": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A field is missing or out of range",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "problems": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "That time is taken"
          },
          "429": {
            "description": "Too many requests"
          },
          "503": {
            "description": "Booking by agent is paused"
          }
        },
        "security": []
      }
    },
    "/insights/gen-x-youtube/": {
      "get": {
        "operationId": "readGenXYoutubeGuide",
        "summary": "Read the Gen X YouTube guide",
        "responses": {
          "200": {
            "description": "HTML guide. 2016 citations are not current.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [],
        "description": "The static file server in this repository does not require a credential for this HTML path. This does not describe function calls."
      }
    }
  },
  "components": {
    "schemas": {
      "Date": {
        "type": "string",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
        "description": "A weekday from today to 90 days out, YYYY-MM-DD."
      },
      "Time": {
        "type": "string",
        "pattern": "^\\d{2}:(00|30)$",
        "description": "Hawaii time (UTC-10), 24-hour HH:MM from 07:00 to 17:00 on the hour or half hour."
      }
    }
  }
}
