{
  "openapi": "3.0.0",
  "info": {
    "title": "ROOPON Public API",
    "description": "Public API for AI agents, integrations, and developers. No authentication required for read-only endpoints.",
    "version": "2025-02-24.acacia",
    "contact": {
      "name": "ROOPON Support",
      "email": "support@roopon.com",
      "url": "https://roopon.com"
    }
  },
  "servers": [
    {
      "url": "https://roopon.com/api/public",
      "description": "Production server"
    },
    {
      "url": "http://localhost:3000/api/public",
      "description": "Development server"
    }
  ],
  "paths": {
    "/giveaways": {
      "get": {
        "summary": "List Giveaways",
        "description": "Get a list of active, upcoming, or completed giveaways. No authentication required.",
        "operationId": "listGiveaways",
        "tags": ["Giveaways"],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by status: active, upcoming, completed, or all",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["active", "upcoming", "completed", "all"],
              "default": "active"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of results (max 100)",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Pagination offset",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GiveawaysResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/giveaways/{slug}": {
      "get": {
        "summary": "Get Giveaway by Slug",
        "description": "Get detailed information about a specific giveaway by its slug.",
        "operationId": "getGiveawayBySlug",
        "tags": ["Giveaways"],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The giveaway slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GiveawayResponse"
                }
              }
            }
          },
          "404": {
            "description": "Giveaway not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/membership/plans": {
      "get": {
        "summary": "Get Membership Plans",
        "description": "Get information about all available membership tiers and pricing.",
        "operationId": "getMembershipPlans",
        "tags": ["Membership"],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPlansResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Giveaway": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique giveaway identifier"
          },
          "giveaway_name": {
            "type": "string",
            "description": "Name of the giveaway"
          },
          "slug": {
            "type": "string",
            "description": "URL-friendly identifier"
          },
          "description": {
            "type": "string",
            "description": "Giveaway description"
          },
          "prize_value": {
            "type": "number",
            "description": "Total prize value in AUD"
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "description": "Giveaway start date"
          },
          "end_date": {
            "type": "string",
            "format": "date-time",
            "description": "Giveaway end date"
          },
          "giveaway_date_time": {
            "type": "string",
            "format": "date-time",
            "description": "Draw date and time"
          },
          "status": {
            "type": "string",
            "enum": ["ACTIVE", "COMPLETED", "COMING SOON", "EARLY BIRD"],
            "description": "Giveaway status"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Public URL to view the giveaway"
          },
          "entry_url": {
            "type": "string",
            "format": "uri",
            "description": "URL to enter the giveaway"
          },
          "prizes": {
            "type": "object",
            "properties": {
              "first": {
                "type": "string"
              },
              "second": {
                "type": "string"
              },
              "third": {
                "type": "string"
              },
              "total_value": {
                "type": "number"
              }
            }
          }
        }
      },
      "GiveawaysResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Giveaway"
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "offset": {
                "type": "integer"
              },
              "hasMore": {
                "type": "boolean"
              }
            }
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        }
      },
      "GiveawayResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Giveaway"
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        }
      },
      "MembershipPlan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "enum": ["basic", "premium", "elite", "ultimate"]
          },
          "name": {
            "type": "string"
          },
          "price": {
            "type": "object",
            "properties": {
              "monthly": {
                "type": "number"
              },
              "currency": {
                "type": "string",
                "default": "AUD"
              }
            }
          },
          "entries": {
            "type": "object",
            "properties": {
              "per_giveaway": {
                "type": "integer"
              },
              "accumulation": {
                "type": "object"
              }
            }
          },
          "signup_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "MembershipPlansResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MembershipPlan"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        }
      },
      "Meta": {
        "type": "object",
        "properties": {
          "api_version": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "default": false
          },
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Giveaways",
      "description": "Endpoints for accessing giveaway information"
    },
    {
      "name": "Membership",
      "description": "Endpoints for accessing membership plan information"
    }
  ]
}

