{
  "openapi": "3.1.0",
  "info": {
    "title": "Threadwork Therapy booking API",
    "version": "1.0.0",
    "summary": "Check open times, book a free 15-minute consultation, or send a message to Christina Beebe, LMFT.",
    "description": "Free consultations are by video or phone, in Mountain Time. Only book or send a message when the person has clearly asked you to, and use their own name and email address (they receive a confirmation email). Keep health details out of bookings and messages. Christina covers those privately once you're working together. If the person may be in crisis or at risk of harm, do not book. Tell them to call or text 988 (Suicide & Crisis Lifeline) or call 911. Each email address can hold one upcoming consultation. To change a booking, the person replies to their confirmation email. If no time works, send a message instead; Christina replies within one business day.",
    "contact": {
      "name": "Threadwork Therapy",
      "email": "christina@threadworktherapy.com",
      "url": "https://www.threadworktherapy.com/contact"
    }
  },
  "servers": [
    {
      "url": "/",
      "description": "The site serving this spec (live: https://www.threadworktherapy.com)"
    }
  ],
  "security": [],
  "externalDocs": {
    "description": "Practice summary for AI assistants",
    "url": "https://www.threadworktherapy.com/llms.txt"
  },
  "paths": {
    "/api/availability": {
      "get": {
        "operationId": "listAvailability",
        "summary": "List open consultation times",
        "description": "Open 15-minute times for the next three weeks, grouped by local date (America/Denver). Days and slots are in ascending time order. Pass a slot's `start` (UTC) to bookConsultation; `label` is for display only.",
        "responses": {
          "200": {
            "description": "Open times",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "timezone": {
                      "type": "string",
                      "example": "America/Denver"
                    },
                    "minutes": {
                      "type": "integer",
                      "example": 15
                    },
                    "days": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string",
                            "format": "date"
                          },
                          "slots": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "start": {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                "end": {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                "label": {
                                  "type": "string",
                                  "example": "Wednesday, November 18 at 12:30 PM MST"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "what": {
                      "type": "string",
                      "description": "What is being booked."
                    },
                    "book_with": {
                      "type": "string",
                      "description": "One-line reminder of how to book."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Rules for assistants."
                    },
                    "mock": {
                      "type": "boolean",
                      "description": "Present and true only on a local test copy (fake calendar)."
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "Only GET is allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable message to relay to the person."
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Calendar unavailable; send a message instead.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable message to relay to the person."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/book": {
      "post": {
        "operationId": "bookConsultation",
        "summary": "Book a free 15-minute consultation",
        "description": "Books an open time immediately and emails a confirmation (with a calendar file) to the person. Only book or send a message when the person has clearly asked you to, and use their own name and email address (they receive a confirmation email). Keep health details out of bookings and messages. Christina covers those privately once you're working together. If the person may be in crisis or at risk of harm, do not book. Tell them to call or text 988 (Suicide & Crisis Lifeline) or call 911. Each email address can hold one upcoming consultation. To change a booking, the person replies to their confirmation email. If no time works, send a message instead; Christina replies within one business day.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "start",
                  "name",
                  "email",
                  "format"
                ],
                "properties": {
                  "start": {
                    "type": "string",
                    "format": "date-time",
                    "description": "A slot `start` from listAvailability."
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "The person's name."
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 200,
                    "description": "The person's own email; the confirmation goes here."
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "Video",
                      "Phone"
                    ]
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 40,
                    "description": "Required when format is Phone."
                  },
                  "service": {
                    "type": "string",
                    "enum": [
                      "Individual",
                      "Couples",
                      "Family",
                      "Group",
                      "Not sure yet"
                    ]
                  },
                  "booked_by": {
                    "type": "string",
                    "enum": [
                      "website",
                      "assistant"
                    ],
                    "default": "website",
                    "description": "Set to \"assistant\" when an AI agent is acting on the person's behalf."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Booked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "when": {
                      "type": "string"
                    },
                    "start": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "end": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "format": {
                      "type": "string"
                    },
                    "confirmation_sent_to": {
                      "type": "string"
                    },
                    "mock": {
                      "type": "boolean",
                      "description": "True only on a local test copy."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid fields",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable message to relay to the person."
                    },
                    "fields": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Per-field validation messages, keyed by field name."
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "slot_taken",
                        "already_booked"
                      ],
                      "description": "slot_taken: pick another time. already_booked: this email has an upcoming consultation."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Time no longer open (slot_taken), or this email already has an upcoming consultation (already_booked).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable message to relay to the person."
                    },
                    "fields": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Per-field validation messages, keyed by field name."
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "slot_taken",
                        "already_booked"
                      ],
                      "description": "slot_taken: pick another time. already_booked: this email has an upcoming consultation."
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Booking failed; try again or send a message.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable message to relay to the person."
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Online booking unavailable; send a message instead.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable message to relay to the person."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/contact": {
      "post": {
        "operationId": "sendMessage",
        "summary": "Send a message to the practice",
        "description": "Emails Christina, who replies within one business day. Use when no time works or for questions. Keep health details out.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 200
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 40,
                    "description": "Required when contact_pref is Phone call or Text."
                  },
                  "service": {
                    "type": "string",
                    "enum": [
                      "Individual",
                      "Couples",
                      "Family",
                      "Group",
                      "Not sure yet"
                    ]
                  },
                  "contact_pref": {
                    "type": "string",
                    "enum": [
                      "Email",
                      "Phone call",
                      "Text"
                    ]
                  },
                  "times": {
                    "type": "string",
                    "maxLength": 300,
                    "description": "Good times for a call, e.g. \"weekday mornings\"."
                  },
                  "message": {
                    "type": "string",
                    "maxLength": 1500
                  },
                  "booked_by": {
                    "type": "string",
                    "enum": [
                      "website",
                      "assistant"
                    ],
                    "default": "website",
                    "description": "Set to \"assistant\" when an AI agent is acting on the person's behalf."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid fields",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable message to relay to the person."
                    },
                    "fields": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Per-field validation messages, keyed by field name."
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Sending failed; email christina@threadworktherapy.com instead.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable message to relay to the person."
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
