{
  "openapi": "3.1.0",
  "info": {
    "title": "eqxinst.com API — Equinox Corporate Partnerships",
    "version": "1.0.0",
    "summary": "Public REST surface of eqxinst.com (Equinox Corporate Partnerships).",
    "description": "Machine-readable surface of eqxinst.com. Site index for agents: https://www.eqxinst.com/llms.txt. Every public HTML page also serves a markdown rendition via `Accept: text/markdown` content negotiation. Unknown /api/* paths return a JSON 404 with an error code and hint (schema: ErrorEnvelope). Versioning: this surface is v1 — every response carries an X-API-Version: 1 header; endpoints here are stable, and any breaking change ships under /api/v2 with this document updated in the same release. Deprecation policy: a retiring endpoint answers with Deprecation and Sunset headers at least 90 days before removal.",
    "contact": {
      "name": "Equinox Corporate Partnerships",
      "email": "john.butler@equinox.com",
      "url": "https://www.eqxinst.com"
    }
  },
  "servers": [
    {
      "url": "https://www.eqxinst.com"
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Liveness, deploy metadata, and env-var presence booleans.",
        "description": "Always public. Returns booleans only for env vars — never values.",
        "responses": {
          "200": {
            "description": "Service is up.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "ready": {
                      "type": "boolean",
                      "description": "True when every required env var is present."
                    },
                    "deployedAt": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "commit": {
                      "type": "string"
                    },
                    "env": {
                      "type": "object",
                      "properties": {
                        "required": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "boolean"
                          }
                        },
                        "optional": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "ready"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/corporate-inquiry": {
      "post": {
        "operationId": "submitInquiry",
        "summary": "Submit a partnership inquiry (the lead-capture endpoint).",
        "description": "Single submission endpoint for every inquiry surface on the site. The JSON body is a discriminated union on `source`; the full union lives in app/api/corporate-inquiry/route.ts. The simplest agent-usable source is `general-inquiry` (shown below). Work email addresses are expected for organization inquiries. Unrecognized sources are accepted for backward compatibility but are not persisted — use a typed source.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Discriminated union on `source`. Example: a general partnership inquiry.",
                "properties": {
                  "source": {
                    "type": "string",
                    "description": "Inquiry source discriminator, e.g. 'general-inquiry'."
                  },
                  "contactName": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "company": {
                    "type": "string"
                  },
                  "intent": {
                    "type": "string"
                  }
                },
                "required": [
                  "source"
                ],
                "additionalProperties": true
              },
              "example": {
                "source": "general-inquiry",
                "contactName": "Jane Doe",
                "email": "jane.doe@example-company.com",
                "company": "Example Company",
                "intent": "Corporate partnership for a 200-person team"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inquiry accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "id": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing required fields for the given source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryError"
                }
              }
            }
          },
          "500": {
            "description": "Submission pipeline failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryError"
                }
              }
            }
          }
        }
      }
    },
    "/api/leads": {
      "get": {
        "operationId": "getLeads",
        "summary": "Authenticated lead feed (CURRENTLY DISABLED — returns 503).",
        "description": "Pull-based lead export for a CRM-side consumer, upserting on `external_id`. DORMANT BY DECISION: the bearer token env is unset, so every request returns `503 {\"ok\":false,\"reason\":\"not-configured\"}` until the operator enables it. Documented so agents can discover the contract without probing.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Cursor — only leads created at or after this instant."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 500,
              "maximum": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lead batch (also available as NDJSON via `Accept: application/x-ndjson`).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "count": {
                      "type": "integer"
                    },
                    "cursor": {
                      "type": "string",
                      "description": "Max created_at in the batch — pass back as ?since."
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "leads": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CanonicalLead"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or wrong bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            }
          },
          "502": {
            "description": "Upstream export failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            }
          },
          "503": {
            "description": "Feed not configured (the current, deliberate state): {\"ok\":false,\"reason\":\"not-configured\"}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "CanonicalLead": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string",
            "description": "sha256(email|source|created_at) — stable dedupe key."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "company": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "team_size": {
            "type": "string"
          },
          "primary_goal": {
            "type": "string"
          },
          "analysis_url": {
            "type": "string"
          },
          "roi_net_annual_benefit": {
            "type": [
              "number",
              "null"
            ]
          },
          "roi_multiple": {
            "type": [
              "number",
              "null"
            ]
          },
          "details": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw_notes": {
            "type": "string"
          }
        },
        "required": [
          "external_id",
          "created_at",
          "source",
          "email"
        ]
      },
      "ErrorEnvelope": {
        "type": "object",
        "description": "Standard error envelope returned by unknown /api/* paths and structured failures.",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "examples": [
                  "not_found"
                ]
              },
              "message": {
                "type": "string"
              },
              "hint": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "ok",
          "error"
        ]
      },
      "InquiryError": {
        "type": "object",
        "description": "Error shape returned by POST /api/corporate-inquiry.",
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "error"
        ]
      },
      "LeadsError": {
        "type": "object",
        "description": "Error shape returned by GET /api/leads.",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "reason"
        ]
      }
    }
  }
}