{
  "openapi": "3.1.0",
  "info": {
    "title": "RentACreator API",
    "description": "Order real human UGC videos for your app. Agent-native API for brands, startups, and AI agents.",
    "version": "1.0.0",
    "contact": { "email": "hello@vizzylabs.ai", "url": "https://rentacreator.io" }
  },
  "servers": [
    { "url": "https://rentacreator.io", "description": "Production" }
  ],
  "paths": {
    "/v1/apply": {
      "get": {
        "operationId": "getApiDocs",
        "summary": "Get API documentation",
        "description": "Returns the API schema, available fields, and example payloads.",
        "responses": {
          "200": {
            "description": "API documentation",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiDocs" } } }
          }
        }
      },
      "post": {
        "operationId": "submitApplication",
        "summary": "Submit a brand or creator application",
        "description": "Submit an application as a brand/agent looking for creators, or as a creator looking for work. Data is saved and the team is notified in real-time.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/Application" },
              "examples": {
                "brand": {
                  "summary": "Brand/Agent application",
                  "value": {
                    "type": "agent",
                    "email": "founder@myapp.com",
                    "app_url": "https://myapp.com",
                    "description": "AI-powered fitness coaching app",
                    "budget": "$5K/mo",
                    "phone": "+1234567890"
                  }
                },
                "creator": {
                  "summary": "Creator application",
                  "value": {
                    "type": "creator",
                    "email": "creator@gmail.com",
                    "profile_url": "https://tiktok.com/@mycreator",
                    "past_brands": "Shein, HelloFresh",
                    "niche": "fitness, beauty",
                    "phone": "+1987654321"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Application submitted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "message": { "type": "string" },
                    "record_id": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": { "description": "Missing required fields" },
          "500": { "description": "Server error" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Application": {
        "type": "object",
        "required": ["email"],
        "properties": {
          "type": { "type": "string", "enum": ["agent", "creator"], "description": "Application type. Defaults to 'agent' if not specified." },
          "email": { "type": "string", "format": "email", "description": "Contact email (required)" },
          "app_url": { "type": "string", "description": "App Store URL or website (for brands)" },
          "product_url": { "type": "string", "description": "Alias for app_url" },
          "description": { "type": "string", "description": "What your product does (for brands)" },
          "product_desc": { "type": "string", "description": "Alias for description" },
          "budget": { "type": "string", "description": "Monthly growth budget (for brands)" },
          "linkedin": { "type": "string", "description": "Founder LinkedIn URL (for brands)" },
          "phone": { "type": "string", "description": "Phone number" },
          "tiktok": { "type": "string", "description": "TikTok/Instagram profile URL (for creators)" },
          "profile_url": { "type": "string", "description": "Alias for tiktok" },
          "past_brands": { "type": "string", "description": "Brands previously worked with (for creators)" },
          "niche": { "type": "string", "description": "Industry keywords / niche (for creators)" }
        }
      },
      "ApiDocs": {
        "type": "object",
        "properties": {
          "service": { "type": "string" },
          "version": { "type": "string" },
          "endpoints": { "type": "object" }
        }
      }
    }
  }
}
