{
  "openapi": "3.0.1",
  "info": {
    "title": "Video Processing API",
    "description": "API for processing video clips from video URLs or YouTube URLs",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://mango.quickreel.io/api/v2"
    }
  ],
  "security": [
    {
      "apiKeyAuth": []
    }
  ],
  "paths": {
    "/projects/{projectId}": {
      "get": {
        "summary": "Get Project",
        "description": "Get Project",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request: Missing required fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: API key invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error: Please try again later or contact support",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests: Please slow down your request rate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Project not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundResponse404"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SuccessResponse": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "Project ID",
            "example": "676409ad10ded0f9fc89d224"
          },
          "status": {
            "type": "string",
            "description": "Status of the project",
            "example": "completed"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Creation timestamp",
            "example": "2024-12-19T11:55:25.602Z"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Completion timestamp",
            "example": "2024-12-19T14:22:35.533Z"
          },
          "error": {
            "type": "string",
            "description": "Error message if any",
            "example": null
          },
          "outputs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Output ID",
                  "example": "67640a41df9247bc89de7813"
                },
                "videoUrl": {
                  "type": "string",
                  "description": "URL of the video",
                  "example": "https://qr-be-api-upload.s3.us-east-1.amazonaws.com/67618d230847a22a7550faf9/676409ad10ded0f9fc89d224/67640a41df9247bc89de7813_final_hook.mp4"
                },
                "thumbnailUrl": {
                  "type": "string",
                  "description": "URL of the thumbnail",
                  "example": "https://qr-be-api-upload.s3.us-east-1.amazonaws.com/67618d230847a22a7550faf9/676409ad10ded0f9fc89d224/67640a41df9247bc89de7813_trim_thumbnail.jpg"
                },
                "info": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "description": "Title of the video",
                      "example": "The Fame Game: Family vs Fortune! 💰🏆"
                    },
                    "caption": {
                      "type": "string",
                      "description": "Caption for the video",
                      "example": "💥 In a world where fame reigns supreme, what would you choose? 💔 Family or 100 Crores? Let's dive into the glitzy side of fame as we pick between loved ones and riches! 🌟✨ #Fame #Choices #Bollywood #Celebrities #Viral"
                    },
                    "viralityScore": {
                      "type": "integer",
                      "description": "Virality score of the video",
                      "example": 88
                    },
                    "viralityScoreReason": {
                      "type": "string",
                      "description": "Reason for the virality score",
                      "example": "The relatable theme of choosing between family and wealth taps into a universal dilemma, increasing its appeal. The celebrity context adds intrigue, likely to resonate with fans and attract shares."
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Tags associated with the video",
                      "example": [
                        "fame",
                        "family",
                        "bollywood",
                        "choices",
                        "viral"
                      ]
                    },
                    "suitablePlatforms": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Platforms suitable for the video",
                      "example": ["x", "youtube"]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "Error message"
              }
            }
          }
        }
      },

      "NotFoundResponse404": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "Error message",
                "example": "Project not found."
              }
            }
          }
        }
      },

      "BadRequestErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "Error message",
                "example": "Bad Request: Missing required fields"
              }
            }
          }
        }
      },
      "UnauthorizedErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "Error message",
                "example": "Unauthorized: API key invalid"
              }
            }
          }
        }
      },

      "InternalServerErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "Error message",
                "example": "Internal Server Error: Please try again later or contact support"
              }
            }
          }
        }
      },
      "TooManyRequestsErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "Error message",
                "example": "Too Many Requests: Please slow down your request rate."
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  }
}
