{
  "openapi": "3.0.3",
  "info": {
    "title": "Developer Perú Public API",
    "description": "Read-only catalog and lead submission API for Developer Perú, a B2B technology consultancy in Peru and LATAM. Custom software, integrations, Zoho, applied AI, and mobile apps. Not a SaaS product API — use for discovery and consultation requests.",
    "version": "1.0.0",
    "contact": {
      "name": "Developer Perú",
      "url": "https://developerperu.com/home/contactanos",
      "email": "chuaman@developerperu.com"
    }
  },
  "servers": [
    {
      "url": "https://developerperu.com/api/v1",
      "description": "Production"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "API health check",
        "tags": ["System"],
        "responses": {
          "200": {
            "description": "API is reachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/services": {
      "get": {
        "operationId": "listServices",
        "summary": "List active services",
        "tags": ["Catalog"],
        "responses": {
          "200": {
            "description": "Service catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/projects": {
      "get": {
        "operationId": "listProjects",
        "summary": "List portfolio projects",
        "tags": ["Catalog"],
        "responses": {
          "200": {
            "description": "Portfolio projects",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/company": {
      "get": {
        "operationId": "getCompany",
        "summary": "Company profile and contact",
        "tags": ["Catalog"],
        "responses": {
          "200": {
            "description": "Company information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyResponse"
                }
              }
            }
          }
        }
      }
    },
    "/sandbox/examples": {
      "get": {
        "operationId": "getSandboxExamples",
        "summary": "Sandbox response examples",
        "tags": ["Sandbox"],
        "responses": {
          "200": {
            "description": "Static example payloads",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/leads": {
      "post": {
        "operationId": "createLead",
        "summary": "Submit a business consultation request",
        "description": "Public tier: no API key required. Rate limited to 10 requests per minute per IP.",
        "tags": ["Leads"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lead accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadSuccessResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HealthResponse": {
        "type": "object",
        "properties": {
          "status": { "type": "string", "example": "ok" },
          "service": { "type": "string" },
          "version": { "type": "string" }
        }
      },
      "Service": {
        "type": "object",
        "properties": {
          "id": { "type": "integer" },
          "name": { "type": "string" },
          "description": { "type": "string" },
          "url": { "type": "string", "format": "uri" }
        }
      },
      "ServiceListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Service" }
          }
        }
      },
      "Project": {
        "type": "object",
        "properties": {
          "id": { "type": "integer" },
          "name": { "type": "string" },
          "summary": { "type": "string" },
          "tags": { "type": "array", "items": { "type": "string" } },
          "url": { "type": "string", "format": "uri", "nullable": true }
        }
      },
      "ProjectListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Project" }
          }
        }
      },
      "Company": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "legal_name": { "type": "string" },
          "ruc": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "email": { "type": "string", "format": "email" },
          "telephone": { "type": "string" },
          "address": { "type": "string" },
          "country": { "type": "string" },
          "area_served": { "type": "array", "items": { "type": "string" } },
          "founder": { "type": "string" },
          "description": { "type": "string" },
          "same_as": { "type": "array", "items": { "type": "string", "format": "uri" } }
        }
      },
      "CompanyResponse": {
        "type": "object",
        "properties": {
          "data": { "$ref": "#/components/schemas/Company" }
        }
      },
      "LeadCreate": {
        "type": "object",
        "required": ["first_name", "email", "message"],
        "properties": {
          "first_name": { "type": "string", "maxLength": 120 },
          "email": { "type": "string", "format": "email", "maxLength": 180 },
          "message": { "type": "string", "maxLength": 5000 },
          "service": { "type": "integer", "nullable": true },
          "source": { "type": "string", "maxLength": 80 }
        }
      },
      "LeadSuccessResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": true }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "message": { "type": "string" }
        }
      },
      "ValidationError": {
        "type": "object",
        "properties": {
          "message": { "type": "string" },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": { "type": "string" }
            }
          }
        }
      }
    }
  },
  "tags": [
    { "name": "System", "description": "Health and metadata" },
    { "name": "Catalog", "description": "Public read-only company data" },
    { "name": "Leads", "description": "Consultation requests" },
    { "name": "Sandbox", "description": "Example payloads" }
  ],
  "externalDocs": {
    "description": "Developer portal",
    "url": "https://developerperu.com/developers"
  }
}
