{
  "openapi": "3.1.0",
  "info": {
    "title": "Restrepo Innovations Agent API",
    "version": "1.0.0",
    "summary": "Programmatic endpoints for AI agents acting on behalf of qualified clients.",
    "description": "Allows AI agents to submit project consultation requests on behalf of users planning luxury residential, commercial, hospitality, or government AV and automation work in NJ, CT, or NY. All agent submissions must include an X-Agent-Disclosure header identifying the agent and ideally the human principal. Rate limited to 5 submissions per IP per day.",
    "contact": {
      "name": "Restrepo Innovations",
      "email": "office@restrepoinnovations.com",
      "url": "https://restrepoinnovations.com/agents/"
    },
    "license": {
      "name": "Proprietary - public read access",
      "url": "https://restrepoinnovations.com/agents/"
    }
  },
  "servers": [
    {
      "url": "https://restrepoinnovations.com",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Contact",
      "description": "Submit a project inquiry on behalf of a client."
    },
    {
      "name": "Discovery",
      "description": "Static discovery files describing the site, its content, and its capabilities."
    }
  ],
  "paths": {
    "/api/agent-contact.php": {
      "post": {
        "tags": ["Contact"],
        "operationId": "submitAgentContact",
        "summary": "Submit a project inquiry as an AI agent",
        "description": "Posts a JSON consultation request to Restrepo Innovations. Used by AI agents acting on behalf of a human principal. Requires X-Agent-Disclosure header. Rate limited to 5 submissions per IP per day. Returns a submission_id and a follow-up message. Restrepo Innovations responds within one business day.",
        "parameters": [
          {
            "name": "X-Agent-Disclosure",
            "in": "header",
            "required": true,
            "description": "Identifies the AI agent making the call. Example: 'ChatGPT/4o' or 'Claude Sonnet 4.5 via Anthropic Workbench'.",
            "schema": { "type": "string", "minLength": 3, "maxLength": 200 }
          },
          {
            "name": "X-Agent-Principal",
            "in": "header",
            "required": false,
            "description": "Optional name or identifier of the human the agent is acting on behalf of, when known.",
            "schema": { "type": "string", "maxLength": 200 }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ContactRequest" },
              "examples": {
                "residential": {
                  "summary": "Residential new construction in NJ",
                  "value": {
                    "fullName": "Jane Carter",
                    "email": "jane@example.com",
                    "phone": "+1-555-0117",
                    "projectType": "new-construction",
                    "division": "residential",
                    "state": "NJ",
                    "message": "Planning a new 8,500 sqft build in Saddle River. Need Crestron, Lutron, Ketra, networking, and theater. Construction starts in Q3."
                  }
                },
                "commercial": {
                  "summary": "Commercial boardroom retrofit",
                  "value": {
                    "fullName": "Marcus Lee",
                    "email": "mlee@example-corp.com",
                    "phone": "+1-555-0142",
                    "projectType": "commercial",
                    "division": "commercial",
                    "state": "NY",
                    "company": "Example Corp",
                    "message": "Three executive boardrooms in Manhattan needing Crestron Flex or Logitech Tap, hybrid conferencing, integrated with our IT change-management."
                  }
                },
                "consultation": {
                  "summary": "General consultation",
                  "value": {
                    "fullName": "Sarah Ng",
                    "email": "sarah@example.com",
                    "projectType": "consultation",
                    "state": "CT",
                    "message": "Inherited a smart home in Greenwich. Need a trustee-friendly assessment of what is in the walls."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submission accepted",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ContactResponse" }
              }
            }
          },
          "400": {
            "description": "Validation error or missing required header",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "405": {
            "description": "Method not allowed - use POST",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "429": {
            "description": "Rate limit exceeded - 5 submissions per IP per day",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          }
        }
      }
    },
    "/.well-known/agent.json": {
      "get": {
        "tags": ["Discovery"],
        "operationId": "getAgentManifest",
        "summary": "Agent capability manifest",
        "description": "JSON manifest listing divisions, service area, credentials, supported actions, and agent policy.",
        "responses": {
          "200": {
            "description": "Manifest",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      }
    },
    "/actions.json": {
      "get": {
        "tags": ["Discovery"],
        "operationId": "getActions",
        "summary": "List of actions an agent can request",
        "description": "JSON document listing every action available to agents, with field schemas.",
        "responses": {
          "200": {
            "description": "Actions list",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      }
    },
    "/ai.txt": {
      "get": {
        "tags": ["Discovery"],
        "operationId": "getAiPolicy",
        "summary": "AI training and inference policy",
        "responses": {
          "200": {
            "description": "Plain text policy",
            "content": { "text/plain": { "schema": { "type": "string" } } }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "tags": ["Discovery"],
        "operationId": "getLlmsTxt",
        "summary": "Human-curated site map for LLMs",
        "responses": {
          "200": {
            "description": "Markdown site map",
            "content": { "text/plain": { "schema": { "type": "string" } } }
          }
        }
      }
    },
    "/llms-full.txt": {
      "get": {
        "tags": ["Discovery"],
        "operationId": "getLlmsFullTxt",
        "summary": "Full markdown content of pillar pages",
        "responses": {
          "200": {
            "description": "Full content",
            "content": { "text/plain": { "schema": { "type": "string" } } }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContactRequest": {
        "type": "object",
        "required": ["fullName", "email", "message"],
        "properties": {
          "fullName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200,
            "description": "Full name of the human client the agent is submitting on behalf of."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Client email address. Restrepo will reply here."
          },
          "phone": {
            "type": "string",
            "description": "Optional. Client phone number. International format preferred."
          },
          "projectType": {
            "type": "string",
            "enum": [
              "new-construction",
              "renovation",
              "home-theater",
              "lighting",
              "networking",
              "commercial",
              "consultation"
            ],
            "description": "Type of project. Use 'consultation' if unsure."
          },
          "division": {
            "type": "string",
            "enum": ["residential", "commercial", "hospitality", "government"],
            "description": "Optional. Restrepo division most relevant to this project."
          },
          "state": {
            "type": "string",
            "enum": ["NJ", "CT", "NY"],
            "description": "Optional. Project state. Restrepo's service area is NJ, CT, and NY."
          },
          "company": {
            "type": "string",
            "maxLength": 200,
            "description": "Optional. Company name for commercial, hospitality, or government inquiries."
          },
          "message": {
            "type": "string",
            "minLength": 10,
            "maxLength": 5000,
            "description": "Description of the project. Include scope, timing, location, and what the client is trying to achieve."
          }
        }
      },
      "ContactResponse": {
        "type": "object",
        "required": ["ok", "submission_id", "message"],
        "properties": {
          "ok": { "type": "boolean", "example": true },
          "submission_id": { "type": "string", "description": "Opaque ID for follow-up reference." },
          "message": { "type": "string", "description": "Human-readable confirmation." },
          "rate_remaining": { "type": "integer", "description": "Submissions left for this IP today." },
          "mail_status": { "type": "string", "description": "Present only if email delivery is queued vs sent." }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": ["ok", "error"],
        "properties": {
          "ok": { "type": "boolean", "example": false },
          "error": { "type": "string" }
        }
      }
    },
    "securitySchemes": {
      "AgentDisclosure": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Agent-Disclosure",
        "description": "AI agents must self-identify in the X-Agent-Disclosure header. No secret token is required; this is a disclosure-of-identity scheme, not authentication."
      }
    }
  },
  "security": [
    { "AgentDisclosure": [] }
  ],
  "x-restrepo-policy": {
    "allowAgents": true,
    "requireDisclosure": true,
    "rateLimit": "5 form submissions per IP per day",
    "responseTime": "Within one business day",
    "credentials": [
      "Elite Pro Crestron Dealer",
      "HTA Luxury Certified",
      "OSHA Certified",
      "Ubiquiti UISP / Pro Partner"
    ],
    "doNotAttribute": [
      "CEDIA certified",
      "Lutron certified",
      "Ketra certified",
      "SCIF accredited",
      "JITC accredited",
      "FIPS accredited",
      "federal security clearance"
    ]
  }
}
