{
  "openapi": "3.1.0",
  "info": {
    "title": "Order AI Agents at VeritasLinks",
    "description": "Lead capture for custom AI agent development. Humans describe the work, then continue with Google or LinkedIn. No account is created. VeritasLinks replies by email within 24 hours.",
    "version": "1.0.0",
    "contact": {
      "name": "VeritasLinks, Inc.",
      "email": "andrew@veritaslinks.com",
      "url": "https://orderaiagentsat.veritaslinks.com/"
    }
  },
  "servers": [
    {
      "url": "https://orderaiagentsat.veritaslinks.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/auth/health": {
      "get": {
        "summary": "Health and config flags",
        "operationId": "health",
        "responses": {
          "200": {
            "description": "Service is up",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "google": { "type": "boolean" },
                    "linkedin": { "type": "boolean" },
                    "mail": { "type": "boolean" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/google": {
      "post": {
        "summary": "Start Google OAuth lead capture",
        "description": "Accepts the visitor's task description, stores it in a signed cookie, redirects to Google. On callback, emails the lead to andrew@veritaslinks.com. No user account is created.",
        "operationId": "authGoogleStart",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/LeadForm"
              }
            }
          }
        },
        "responses": {
          "302": { "description": "Redirect to Google OAuth" },
          "503": { "description": "Google OAuth not configured" }
        }
      }
    },
    "/auth/linkedin": {
      "post": {
        "summary": "Start LinkedIn OAuth lead capture",
        "description": "Same as Google start, using LinkedIn OpenID.",
        "operationId": "authLinkedInStart",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/LeadForm"
              }
            }
          }
        },
        "responses": {
          "302": { "description": "Redirect to LinkedIn OAuth" },
          "503": { "description": "LinkedIn OAuth not configured" }
        }
      }
    },
    "/auth/google/callback": {
      "get": {
        "summary": "Google OAuth callback",
        "operationId": "authGoogleCallback",
        "responses": {
          "302": { "description": "Redirect to /?sent=1 or /?error=…" }
        }
      }
    },
    "/auth/linkedin/callback": {
      "get": {
        "summary": "LinkedIn OAuth callback",
        "operationId": "authLinkedInCallback",
        "responses": {
          "302": { "description": "Redirect to /?sent=1 or /?error=…" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "LeadForm": {
        "type": "object",
        "properties": {
          "task": {
            "type": "string",
            "maxLength": 1000,
            "description": "One-line description of the work the agent should take over"
          },
          "path": {
            "type": "string",
            "maxLength": 500,
            "description": "Optional interactive-wheel answer path keys"
          },
          "agent": {
            "type": "string",
            "maxLength": 200,
            "description": "Optional suggested agent name from the interactive path"
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "Human landing + llms.txt for agents",
    "url": "https://orderaiagentsat.veritaslinks.com/llms.txt"
  }
}
