{
  "openapi": "3.1.0",
  "info": {
    "title": "Maria Personal Shopper & Stylist: send an enquiry",
    "version": "1.0.0",
    "description": "Lets an AI assistant send an enquiry to Maria Pastor, a London-based Personal Shopper & Stylist, on a customer's behalf. Use the customer's own details and never invent any. Describe what the customer wants in `message`, in their words. Then pass the returned `message` on to the customer. Maria usually replies within 24 hours, Monday to Saturday. Send JSON of at most 16 KB with the header Content-Type: application/json. If you cannot send web requests, give the customer a WhatsApp link with the enquiry pre-written (https://wa.me/447783985823?text=<URL-encoded message>) to tap and send from their own phone, or a mailto:hi@mariapersonalshopper.com link with the subject and body filled in."
  },
  "servers": [
    {
      "url": "https://www.mariapersonalshopper.com"
    }
  ],
  "paths": {
    "/api/agent/enquiry": {
      "post": {
        "operationId": "sendEnquiry",
        "summary": "Send an enquiry to Maria for a customer",
        "description": "Use the customer's own details exactly as given; never invent any. Put what they want in `message`, in their words (enquiries without one are held for review). Then relay the returned `message` to the customer.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Enquiry"
              },
              "examples": {
                "personalShopping": {
                  "summary": "In-store personal shopping in central London",
                  "value": {
                    "name": "Jane Smith",
                    "email": "jane@example.com",
                    "phone": "+44 7700 900123",
                    "service": "personal-shopper-london",
                    "area": "central-london",
                    "preferredDates": "Saturdays in January",
                    "budget": "Around 500 pounds on clothes",
                    "message": "I have a new job in finance and need smart workwear that is not boring. I am a size 12 and usually shop on the high street.",
                    "assistant": "Claude"
                  }
                },
                "wardrobeEdit": {
                  "summary": "Wardrobe edit at the customer's home, email only",
                  "value": {
                    "name": "Tom Brown",
                    "email": "tom@example.com",
                    "service": "wardrobe-edit",
                    "area": "buckinghamshire",
                    "message": "My wardrobe is full of clothes I never wear. I would like help deciding what to keep and what I am missing.",
                    "assistant": "ChatGPT"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The enquiry was received. Relay `message` to the customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reply"
                },
                "example": {
                  "status": "received",
                  "message": "Thank you. Maria has received this enquiry and usually replies within 24 hours, Monday to Saturday. If it is urgent, the customer can also message her on WhatsApp at https://wa.me/447783985823."
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be used: the body is not valid JSON, there is no name, or there is neither an email address nor a phone number. Fix the request using `error`, or ask the customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Refused"
                }
              }
            }
          },
          "413": {
            "description": "The request is larger than 16 KB. Shorten the message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Refused"
                }
              }
            }
          },
          "415": {
            "description": "The request was not sent as application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Refused"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this connection. Wait a minute and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Refused"
                }
              }
            }
          },
          "503": {
            "description": "Enquiries from AI assistants are not open, or the enquiry could not be stored. Relay `message` to the customer: it gives other ways to reach Maria (contact form, WhatsApp, email).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unavailable"
                }
              }
            }
          }
        },
        "security": []
      }
    }
  },
  "components": {
    "schemas": {
      "Enquiry": {
        "type": "object",
        "required": [
          "name"
        ],
        "anyOf": [
          {
            "required": [
              "email"
            ]
          },
          {
            "required": [
              "phone"
            ]
          }
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "The customer's name, as they gave it. Never invent one."
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 320,
            "description": "The customer's own email address. Give this or `phone` (or both) so Maria can reply. Never invent one."
          },
          "phone": {
            "type": "string",
            "maxLength": 30,
            "description": "The customer's own phone number. Give this or `email` (or both). Never invent one."
          },
          "service": {
            "type": "string",
            "enum": [
              "personal-shopper-london",
              "personal-shopper-oxford",
              "personal-shopper-buckinghamshire",
              "wardrobe-edit",
              "styling-for-men",
              "styling-for-mums",
              "plus-size",
              "corporate-styling",
              "styling-wedding",
              "gift-voucher"
            ],
            "description": "The service the customer is asking about. In-store personal shopping is in central London or Oxford; a wardrobe edit is done at the customer's home. Leave it out if the customer has not said. Other values are accepted but the enquiry is held for review."
          },
          "area": {
            "type": "string",
            "enum": [
              "central-london",
              "north-london",
              "west-london",
              "south-london",
              "buckinghamshire",
              "thames-valley",
              "oxford"
            ],
            "description": "Where the customer wants the service. In-store shopping is only in central London and Oxford; wardrobe edits are at home across all of these areas. Not needed for a gift voucher. Use buckinghamshire for High Wycombe, Milton Keynes and the rest of Buckinghamshire. Other values are accepted but the enquiry is held for review."
          },
          "preferredDates": {
            "type": "string",
            "maxLength": 500,
            "description": "When the customer would like to book, in their words."
          },
          "budget": {
            "type": "string",
            "maxLength": 100,
            "description": "The customer's budget for clothes, in their words, if they gave one."
          },
          "message": {
            "type": "string",
            "maxLength": 5000,
            "description": "A short description of what the customer wants, in their words: the occasion, their style, sizes, anything they asked for. Strongly encouraged: enquiries without a message are held for review."
          },
          "assistant": {
            "type": "string",
            "maxLength": 100,
            "description": "The name of the AI assistant sending this, for example Claude or ChatGPT."
          }
        },
        "description": "Unknown fields are ignored, and the enquiry is held for review."
      },
      "Reply": {
        "type": "object",
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "status": {
            "type": "string",
            "const": "received"
          },
          "message": {
            "type": "string",
            "description": "Relay this to the customer."
          }
        }
      },
      "Refused": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "const": "refused"
          },
          "error": {
            "type": "string",
            "description": "What to fix."
          }
        }
      },
      "Unavailable": {
        "type": "object",
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "unavailable",
              "error"
            ]
          },
          "message": {
            "type": "string",
            "description": "Relay this to the customer: it lists other ways to reach Maria."
          }
        }
      }
    }
  }
}
