{
  "openapi": "3.1.0",
  "info": {
    "title": "Pixavio Studio API",
    "version": "1.0.0",
    "summary": "Send a project request (lead) to the Pixavio Studio team.",
    "description": "Public API for Pixavio Studio, a digital studio in Ecuador (branding, websites, e-commerce, apps, social media, SEO/SEM). It exposes one action: sending a contact request to the team, who reply by email. No authentication is required. Only submit a lead with the user's consent and real contact details. The API is versioned in the URL path (/api/v1); breaking changes will ship under a new path and /api/v1 will keep working until announced otherwise in https://pixavio.com/llms.txt.",
    "contact": {
      "name": "Pixavio Studio",
      "email": "hello@pixavio.com",
      "url": "https://pixavio.com/"
    }
  },
  "externalDocs": {
    "description": "Agent instructions",
    "url": "https://pixavio.com/agents.md"
  },
  "servers": [
    {
      "url": "https://pixavio.com/api/v1",
      "description": "Production"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "leads",
      "description": "Project requests sent to the Pixavio team."
    }
  ],
  "paths": {
    "/leads": {
      "post": {
        "operationId": "createLead",
        "summary": "Send a project request to Pixavio",
        "description": "Creates a lead with the user's name, email and an optional project description. The Pixavio team is notified and replies by email. Returns 200 with {\"ok\": true} on success. Do not retry a request that succeeded.",
        "tags": ["leads"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadInput"
              },
              "example": {
                "name": "Ana Pérez",
                "email": "ana@example.com",
                "message": "We need a new website and brand identity for our coffee shop in Quito."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lead received.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadCreated"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON or failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Invalid submission",
                  "code": "email_required_or_invalid",
                  "reason": "email_required_or_invalid",
                  "message": "A valid email address is required.",
                  "hint": "Send the user's real email in the 'email' field."
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed. Only POST (and OPTIONS preflight) are accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The lead could not be saved. Safe to retry later, or email hello@pixavio.com.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "LeadInput": {
        "type": "object",
        "required": ["name", "email"],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "description": "Full name of the person requesting the project."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Email where the Pixavio team will reply."
          },
          "message": {
            "type": "string",
            "minLength": 10,
            "description": "Optional project description: what is needed, timeline, budget. If present it must be at least 10 characters and contain spaces. Spanish or English."
          }
        },
        "additionalProperties": false
      },
      "LeadCreated": {
        "type": "object",
        "required": ["ok"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "Error": {
        "type": "object",
        "required": ["error", "code", "message"],
        "properties": {
          "error": {
            "type": "string",
            "description": "Short error title."
          },
          "code": {
            "type": "string",
            "description": "Machine-readable error code.",
            "enum": [
              "invalid_json",
              "name_required",
              "email_required_or_invalid",
              "message_too_short",
              "message_looks_like_spam",
              "method_not_allowed",
              "not_found",
              "internal_error"
            ]
          },
          "reason": {
            "type": "string",
            "description": "Deprecated alias of code for validation errors."
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation."
          },
          "hint": {
            "type": "string",
            "description": "How to fix the request."
          }
        }
      }
    }
  }
}
