{
  "openapi": "3.1.0",
  "info": {
    "title": "Clicki Public Content API",
    "version": "1.0.0",
    "summary": "Machine-readable company, pricing, industry, solution, and integration data for joinclicki.com.",
    "description": "Read-only, unauthenticated JSON describing Clicki, Inc. — intended for AI agents, crawlers, and partners.\n\nThe authenticated Clicki Referrals product API (promoters, referrals, campaigns, bonuses, webhooks) is a separate surface documented at https://v2.clicki.io/docs with its own OpenAPI document at https://v2.clicki.io/docs/api-spec.yml (base URL https://v2.clicki.io/api/v1, `X-API-KEY` header auth).\n\nEvery non-2xx response from this API uses the shared `Error` envelope: `{ \"error\": { \"code\", \"message\", \"hint\", \"docs\", \"status\" } }`.",
    "contact": {
      "name": "Clicki, Inc.",
      "url": "https://joinclicki.com",
      "email": "support@joinclicki.com"
    },
    "license": {
      "name": "CC BY 4.0",
      "identifier": "CC-BY-4.0"
    }
  },
  "externalDocs": {
    "description": "Clicki Referrals product API documentation",
    "url": "https://v2.clicki.io/docs"
  },
  "servers": [
    {
      "url": "https://hnmavfrjjeqasbszyzsn.supabase.co/functions/v1/public-api",
      "description": "Content API (dynamic; structured JSON errors, CORS, Vary: Accept)"
    },
    {
      "url": "https://joinclicki.com/api",
      "description": "Static mirror of the same payloads (append .json, e.g. /company.json)"
    }
  ],
  "tags": [
    { "name": "Discovery", "description": "Index of available resources." },
    { "name": "Company", "description": "Company profile, products, and API pointers." },
    { "name": "Catalog", "description": "Pricing, industries, solutions, and integrations." }
  ],
  "paths": {
    "/v1": {
      "get": {
        "tags": ["Discovery"],
        "operationId": "getIndex",
        "summary": "List available resources",
        "responses": {
          "200": {
            "description": "Resource index.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Index" }
              }
            }
          },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/v1/company": {
      "get": {
        "tags": ["Company"],
        "operationId": "getCompany",
        "summary": "Company profile",
        "responses": {
          "200": {
            "description": "Company profile, address, products, and product API pointers.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/CompanyEnvelope" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/v1/pricing": {
      "get": {
        "tags": ["Catalog"],
        "operationId": "getPricing",
        "summary": "Plans and pricing",
        "responses": {
          "200": {
            "description": "Published plans, monthly prices, annual discount, and included features.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/PricingEnvelope" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/v1/industries": {
      "get": {
        "tags": ["Catalog"],
        "operationId": "listIndustries",
        "summary": "Industry pages",
        "responses": {
          "200": {
            "description": "Industry landing pages with canonical HTML and markdown URLs.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/PageListEnvelope" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/v1/solutions": {
      "get": {
        "tags": ["Catalog"],
        "operationId": "listSolutions",
        "summary": "Solution pages",
        "responses": {
          "200": {
            "description": "Solution landing pages with canonical HTML and markdown URLs.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/PageListEnvelope" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/v1/integrations": {
      "get": {
        "tags": ["Catalog"],
        "operationId": "listIntegrations",
        "summary": "Supported CRM and field-software integrations",
        "responses": {
          "200": {
            "description": "Integration catalog with vendor URLs and categories.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/IntegrationListEnvelope" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    }
  },
  "components": {
    "responses": {
      "BadRequest": {
        "description": "Malformed request.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "NotFound": {
        "description": "No such resource.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "MethodNotAllowed": {
        "description": "This API is read-only; use GET or HEAD.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "RateLimited": {
        "description": "Too many requests.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "InternalError": {
        "description": "Unexpected server error.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message", "hint", "status"],
            "properties": {
              "code": {
                "type": "string",
                "enum": ["bad_request", "not_found", "method_not_allowed", "rate_limited", "internal_error"]
              },
              "message": { "type": "string" },
              "hint": { "type": "string", "description": "How an agent can resolve the failure." },
              "docs": { "type": "string", "format": "uri" },
              "status": { "type": "integer" }
            }
          }
        },
        "examples": [
          {
            "error": {
              "code": "not_found",
              "message": "No such resource: /v1/foo",
              "hint": "Available resources: /v1/company, /v1/pricing, /v1/industries, /v1/solutions, /v1/integrations",
              "docs": "https://joinclicki.com/openapi.json",
              "status": 404
            }
          }
        ]
      },
      "Index": {
        "type": "object",
        "required": ["object", "resources"],
        "properties": {
          "object": { "const": "index" },
          "docs": { "type": "string", "format": "uri" },
          "openapi": { "type": "string", "format": "uri" },
          "platform_api_docs": { "type": "string", "format": "uri" },
          "platform_api_openapi": { "type": "string", "format": "uri" },
          "resources": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["name", "path"],
              "properties": {
                "name": { "type": "string" },
                "path": { "type": "string" },
                "static_url": { "type": "string", "format": "uri" }
              }
            }
          }
        }
      },
      "CompanyEnvelope": {
        "type": "object",
        "required": ["object", "data"],
        "properties": {
          "object": { "const": "company" },
          "docs": { "type": "string", "format": "uri" },
          "license": { "type": "string" },
          "data": {
            "type": "object",
            "required": ["legal_name", "url", "description"],
            "properties": {
              "legal_name": { "type": "string" },
              "brand": { "type": "string" },
              "url": { "type": "string", "format": "uri" },
              "founded": { "type": "string" },
              "description": { "type": "string" },
              "address": {
                "type": "object",
                "properties": {
                  "street": { "type": "string" },
                  "locality": { "type": "string" },
                  "region": { "type": "string" },
                  "postal_code": { "type": "string" },
                  "country": { "type": "string" }
                }
              },
              "sales_phone": { "type": "string" },
              "products": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["name", "url"],
                  "properties": {
                    "name": { "type": "string" },
                    "url": { "type": "string", "format": "uri" },
                    "description": { "type": "string" }
                  }
                }
              },
              "platform_api": {
                "type": "object",
                "properties": {
                  "docs": { "type": "string", "format": "uri" },
                  "openapi": { "type": "string", "format": "uri" },
                  "base_url": { "type": "string", "format": "uri" },
                  "auth": {
                    "type": "object",
                    "properties": {
                      "type": { "type": "string" },
                      "in": { "type": "string" },
                      "name": { "type": "string" }
                    }
                  }
                }
              },
              "same_as": { "type": "array", "items": { "type": "string", "format": "uri" } }
            }
          }
        }
      },
      "PricingEnvelope": {
        "type": "object",
        "required": ["object", "data"],
        "properties": {
          "object": { "const": "pricing" },
          "docs": { "type": "string", "format": "uri" },
          "license": { "type": "string" },
          "data": {
            "type": "object",
            "required": ["currency", "plans"],
            "properties": {
              "currency": { "type": "string" },
              "billing_interval": { "type": "string" },
              "annual_discount_percent": { "type": "number" },
              "notes": { "type": "string" },
              "pricing_page": { "type": "string", "format": "uri" },
              "plans": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["name", "price_label"],
                  "properties": {
                    "name": { "type": "string" },
                    "monthly_price": { "type": ["number", "null"] },
                    "price_label": { "type": "string" },
                    "description": { "type": "string" },
                    "includes": { "type": "array", "items": { "type": "string" } }
                  }
                }
              }
            }
          }
        }
      },
      "PageListEnvelope": {
        "type": "object",
        "required": ["object", "data"],
        "properties": {
          "object": { "const": "list" },
          "docs": { "type": "string", "format": "uri" },
          "license": { "type": "string" },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["slug", "name", "url"],
              "properties": {
                "slug": { "type": "string" },
                "name": { "type": "string" },
                "url": { "type": "string", "format": "uri" },
                "markdown_url": { "type": "string", "format": "uri" },
                "description": { "type": "string" }
              }
            }
          }
        }
      },
      "IntegrationListEnvelope": {
        "type": "object",
        "required": ["object", "data"],
        "properties": {
          "object": { "const": "list" },
          "docs": { "type": "string", "format": "uri" },
          "license": { "type": "string" },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["name"],
              "properties": {
                "name": { "type": "string" },
                "categories": { "type": "array", "items": { "type": "string" } },
                "description": { "type": "string" },
                "vendor_url": { "type": ["string", "null"] },
                "url": { "type": "string", "format": "uri" }
              }
            }
          }
        }
      }
    }
  }
}
