{"openapi":"3.1.0","info":{"title":"Clipzy API","version":"1.0.0","description":"API for AI-powered image and video generation with templates"},"components":{"schemas":{"HealthResponse":{"type":"object","properties":{"status":{"type":"string","enum":["ok","degraded","error"]},"version":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}},"required":["status","version","timestamp"]},"TemplateResponse":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"thumbnailUrl":{"type":"string","nullable":true},"category":{"$ref":"#/components/schemas/TemplateCategory"},"tags":{"type":"array","nullable":true,"items":{"type":"string"}},"isFeatured":{"type":"boolean"},"outputType":{"$ref":"#/components/schemas/OutputType"},"creditCost":{"type":"number"},"inputSchema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateInputField"}},"promptTemplate":{"type":"string","nullable":true},"enhancePrompt":{"type":"boolean"},"useCount":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","name","description","thumbnailUrl","category","tags","isFeatured","outputType","creditCost","inputSchema","promptTemplate","enhancePrompt","useCount","createdAt"]},"TemplateCategory":{"type":"string","enum":["photo_transform","text_to_image","image_to_video","text_to_video","filter","artistic"]},"OutputType":{"type":"string","enum":["image","video"]},"TemplateInputField":{"type":"object","properties":{"type":{"type":"string","enum":["image_upload","video_upload","text_prompt","select","toggle"]},"key":{"type":"string"},"label":{"type":"string"},"required":{"type":"boolean"},"placeholder":{"type":"string"},"default":{"anyOf":[{"type":"string"},{"type":"boolean"}]},"options":{"type":"array","items":{"$ref":"#/components/schemas/TemplateInputFieldOption"}},"validation":{"$ref":"#/components/schemas/TemplateInputFieldValidation"}},"required":["type","key","label","required"]},"TemplateInputFieldOption":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"creditModifier":{"type":"number"},"modelParams":{"type":"object","additionalProperties":{"nullable":true}}},"required":["label","value"]},"TemplateInputFieldValidation":{"type":"object","properties":{"minLength":{"type":"number"},"maxLength":{"type":"number"},"maxFileSize":{"type":"number"},"maxFiles":{"type":"number"},"allowedFormats":{"type":"array","items":{"type":"string"}}}},"ErrorEnvelope":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"error":{"type":"object","properties":{"message":{"type":"string","example":"Resource not found"},"code":{"type":"string","example":"RESOURCE_001"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["message","code"]}},"required":["success","requestId","timestamp","error"]},"FalWebhookBody":{"type":"object","properties":{"request_id":{"type":"string"},"gateway_request_id":{"type":"string"},"status":{"type":"string","enum":["OK","ERROR"]},"payload":{"nullable":true},"error":{"type":"string","nullable":true},"payload_error":{"type":"string","nullable":true}},"required":["request_id","status"]},"ExploreItem":{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string"},"templateName":{"type":"string"},"prompt":{"type":"string","nullable":true},"output":{"$ref":"#/components/schemas/ExploreItemOutput"},"author":{"$ref":"#/components/schemas/ExploreAuthor"},"likeCount":{"type":"number"},"likedByMe":{"type":"boolean"},"publishedAt":{"type":"string"}},"required":["id","templateId","templateName","prompt","output","author","likeCount","likedByMe","publishedAt"]},"ExploreItemOutput":{"type":"object","nullable":true,"properties":{"url":{"type":"string"},"type":{"$ref":"#/components/schemas/GenerationMediaType"}},"required":["url","type"]},"GenerationMediaType":{"type":"string","enum":["image","video"]},"ExploreAuthor":{"type":"object","properties":{"name":{"type":"string"},"avatarUrl":{"type":"string","nullable":true}},"required":["name","avatarUrl"]},"LikeResponse":{"type":"object","properties":{"likeCount":{"type":"number"},"likedByMe":{"type":"boolean"}},"required":["likeCount","likedByMe"]},"UploadUrlResponse":{"type":"object","properties":{"mediaKey":{"type":"string"},"uploadUrl":{"type":"string"},"expiresAt":{"type":"number"}},"required":["mediaKey","uploadUrl","expiresAt"]},"UploadUrlRequest":{"type":"object","properties":{"templateId":{"type":"string"},"fieldKey":{"type":"string"},"filename":{"type":"string"}},"required":["templateId","fieldKey","filename"]},"CreateGenerationResponse":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/GenerationStatus"}},"required":["id","status"]},"GenerationStatus":{"type":"string","enum":["pending","queued","processing","completed","failed"]},"CreateGenerationRequest":{"type":"object","properties":{"templateId":{"type":"string"},"prompt":{"type":"string"},"enhancedPrompt":{"type":"string","maxLength":4000},"inputs":{"type":"object","additionalProperties":{"nullable":true}},"idempotencyKey":{"type":"string","maxLength":255}},"required":["templateId"]},"GenerationResponse":{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string"},"templateName":{"type":"string"},"prompt":{"type":"string","nullable":true},"enhancedPrompt":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/GenerationStatus"},"creditCost":{"type":"number"},"metadata":{"nullable":true},"createdAt":{"type":"string"},"completedAt":{"type":"string","nullable":true},"publishedAt":{"type":"string","nullable":true},"output":{"$ref":"#/components/schemas/GenerationOutput"},"inputs":{"type":"array","items":{"$ref":"#/components/schemas/GenerationInput"}},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/GenerationOutputDetail"}}},"required":["id","templateId","templateName","prompt","status","creditCost","createdAt","completedAt","publishedAt","output"]},"GenerationOutput":{"type":"object","nullable":true,"properties":{"url":{"type":"string","description":"Public URL to the media"},"type":{"$ref":"#/components/schemas/GenerationMediaType"}},"required":["url","type"]},"GenerationInput":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"mediaUrl":{"type":"string","description":"Public URL to the input media"},"sortOrder":{"type":"number"}},"required":["id","type","mediaUrl","sortOrder"]},"GenerationOutputDetail":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"mediaUrl":{"type":"string","description":"Public URL to the output media"},"sortOrder":{"type":"number"},"metadata":{"nullable":true}},"required":["id","type","mediaUrl","sortOrder"]},"GenerationStatusResponse":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/GenerationStatus"},"step":{"type":"string","nullable":true},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/GenerationStatusOutput"}}},"required":["id","status","step"]},"GenerationStatusOutput":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"mediaUrl":{"type":"string","description":"Public URL to the output media"}},"required":["id","type","mediaUrl"]},"RetryGenerationResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string"}},"required":["id","status"]},"ReferralCodeResponse":{"type":"object","properties":{"code":{"type":"string"},"shareUrl":{"type":"string"},"totalReferrals":{"type":"number"},"successfulReferrals":{"type":"number"},"rewardsEarned":{"type":"number"}},"required":["code","shareUrl","totalReferrals","successfulReferrals","rewardsEarned"]},"Referral":{"type":"object","properties":{"id":{"type":"string"},"referredEmail":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/ReferralStatus"},"signedUpAt":{"type":"string","nullable":true},"convertedAt":{"type":"string","nullable":true},"rewardAmount":{"type":"number","nullable":true},"createdAt":{"type":"string"}},"required":["id","referredEmail","status","signedUpAt","convertedAt","rewardAmount","createdAt"]},"ReferralStatus":{"type":"string","enum":["pending","signed_up","converted","rewarded"]},"TrackReferralResponse":{"type":"object","properties":{"success":{"type":"boolean"},"referralId":{"type":"string"}},"required":["success","referralId"]},"TrackReferralRequest":{"type":"object","properties":{"referralCode":{"type":"string"},"email":{"type":"string","format":"email"}},"required":["referralCode"]},"CreditBalanceResponse":{"type":"object","properties":{"generationCredits":{"type":"number"},"canGenerate":{"type":"boolean"}},"required":["generationCredits","canGenerate"]},"ProfileResponse":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"image":{"type":"string","nullable":true}},"required":["id","name","email","image"]},"UpdateProfileRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"image":{"type":"string","format":"uri"}}},"DeleteAccountResponse":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"BroadcastNotificationResponse":{"type":"object","properties":{"tokenCount":{"type":"number"},"userCount":{"type":"number"}},"required":["tokenCount","userCount"]},"BroadcastNotificationRequest":{"type":"object","properties":{"body":{"type":"string","minLength":1},"data":{"type":"object","additionalProperties":{"nullable":true}},"title":{"type":"string","minLength":1}},"required":["body","title"]},"RegisterDeviceTokenResponse":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"}},"required":["id","token"]},"RegisterDeviceTokenRequest":{"type":"object","properties":{"token":{"type":"string","minLength":1},"platform":{"type":"string","enum":["ios","android"]}},"required":["token"]},"RemoveDeviceTokenResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"RemoveDeviceTokenRequest":{"type":"object","properties":{"token":{"type":"string","minLength":1}},"required":["token"]},"NotificationPreferencesResponse":{"type":"object","properties":{"generationReady":{"type":"boolean"},"marketing":{"type":"boolean"}},"required":["generationReady","marketing"]},"UpdateNotificationPreferencesRequest":{"type":"object","properties":{"generationReady":{"type":"boolean"},"marketing":{"type":"boolean"}}},"AdminStatsResponse":{"type":"object","properties":{"totalUsers":{"type":"integer"},"totalTemplates":{"type":"integer"},"activeTemplates":{"type":"integer"},"totalGenerations":{"type":"integer"},"completedGenerations":{"type":"integer"},"failedGenerations":{"type":"integer"},"pendingGenerations":{"type":"integer"}},"required":["totalUsers","totalTemplates","activeTemplates","totalGenerations","completedGenerations","failedGenerations","pendingGenerations"]},"AdminTemplateResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"thumbnailKey":{"type":"string","nullable":true},"thumbnailUrl":{"type":"string","nullable":true},"category":{"$ref":"#/components/schemas/TemplateCategory"},"tags":{"type":"array","nullable":true,"items":{"type":"string"}},"isFeatured":{"type":"boolean"},"sortOrder":{"type":"integer"},"falModelId":{"type":"string"},"modelParams":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"outputType":{"$ref":"#/components/schemas/OutputType"},"promptTemplate":{"type":"string"},"inputSchema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateInputField"}},"enhancePrompt":{"type":"boolean"},"enhanceSystemPrompt":{"type":"string","nullable":true},"creditCost":{"type":"integer"},"useCount":{"type":"integer"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","thumbnailKey","thumbnailUrl","category","tags","isFeatured","sortOrder","falModelId","modelParams","outputType","promptTemplate","inputSchema","enhancePrompt","enhanceSystemPrompt","creditCost","useCount","isActive","createdAt","updatedAt"]},"AdminTemplateDetailResponse":{"allOf":[{"$ref":"#/components/schemas/AdminTemplateResponse"},{"type":"object","properties":{"translation":{"$ref":"#/components/schemas/AdminTemplateTranslationResponse"}}}]},"AdminTemplateTranslationResponse":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"templateId":{"type":"string","format":"uuid"},"locale":{"type":"string","enum":["en","tr"]},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"inputSchema":{"$ref":"#/components/schemas/InputSchemaTranslation"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","templateId","locale","name","description","inputSchema","createdAt","updatedAt"]},"InputSchemaTranslation":{"type":"object","nullable":true,"additionalProperties":{"$ref":"#/components/schemas/InputSchemaFieldTranslation"}},"InputSchemaFieldTranslation":{"type":"object","properties":{"label":{"type":"string","minLength":1},"placeholder":{"type":"string"},"options":{"type":"object","additionalProperties":{"type":"string"}}}},"AdminCreateTemplateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","nullable":true,"maxLength":2000},"thumbnailKey":{"type":"string","nullable":true,"minLength":1,"maxLength":2048},"category":{"$ref":"#/components/schemas/TemplateCategory"},"tags":{"type":"array","nullable":true,"items":{"type":"string","minLength":1,"maxLength":64}},"isFeatured":{"type":"boolean"},"sortOrder":{"type":"integer","minimum":0},"falModelId":{"type":"string","minLength":1,"maxLength":255},"modelParams":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"outputType":{"$ref":"#/components/schemas/OutputType"},"promptTemplate":{"type":"string","minLength":1},"inputSchema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateInputField"},"minItems":1},"enhancePrompt":{"type":"boolean"},"enhanceSystemPrompt":{"type":"string","nullable":true},"creditCost":{"type":"integer","minimum":1},"isActive":{"type":"boolean"}},"required":["name","category","falModelId","outputType","promptTemplate","inputSchema"]},"AdminUpdateTemplateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","nullable":true,"maxLength":2000},"thumbnailKey":{"type":"string","nullable":true,"minLength":1,"maxLength":2048},"category":{"$ref":"#/components/schemas/TemplateCategory"},"tags":{"type":"array","nullable":true,"items":{"type":"string","minLength":1,"maxLength":64}},"isFeatured":{"type":"boolean"},"sortOrder":{"type":"integer","minimum":0},"falModelId":{"type":"string","minLength":1,"maxLength":255},"modelParams":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"outputType":{"$ref":"#/components/schemas/OutputType"},"promptTemplate":{"type":"string","minLength":1},"inputSchema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateInputField"},"minItems":1},"enhancePrompt":{"type":"boolean"},"enhanceSystemPrompt":{"type":"string","nullable":true},"creditCost":{"type":"integer","minimum":1},"isActive":{"type":"boolean"}}},"AdminTemplateStatusResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"isActive":{"type":"boolean"}},"required":["id","isActive"]},"AdminUpsertTemplateTranslationRequest":{"type":"object","properties":{"name":{"type":"string","nullable":true,"minLength":1,"maxLength":120},"description":{"type":"string","nullable":true,"maxLength":2000},"inputSchema":{"$ref":"#/components/schemas/InputSchemaTranslation"}}},"AdminUploadUrlResponse":{"type":"object","properties":{"mediaKey":{"type":"string"},"uploadUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"integer"}},"required":["mediaKey","uploadUrl","expiresAt"]},"AdminUploadUrlRequest":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"prefix":{"type":"string","enum":["thumbnails","previews"]}},"required":["filename","prefix"]},"AdminUserResponse":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","format":"email"},"image":{"type":"string","nullable":true},"role":{"type":"string","nullable":true},"banned":{"type":"boolean","nullable":true},"banReason":{"type":"string","nullable":true},"banExpires":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"generationCount":{"type":"integer"}},"required":["id","name","email","image","role","banned","banReason","banExpires","createdAt","generationCount"]},"AdminUserStatusResponse":{"type":"object","properties":{"id":{"type":"string"},"banned":{"type":"boolean","nullable":true},"banReason":{"type":"string","nullable":true},"banExpires":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","banned","banReason","banExpires"]},"AdminBanUserRequest":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500},"expiresAt":{"type":"string","format":"date-time"}},"required":["reason"]},"AdminUserRoleResponse":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","nullable":true}},"required":["id","role"]},"AdminUpdateRoleRequest":{"type":"object","properties":{"role":{"type":"string","minLength":1,"maxLength":100}},"required":["role"]}},"parameters":{}},"paths":{"/health":{"get":{"tags":["System"],"summary":"Health check","description":"Returns the health status of the API","responses":{"200":{"description":"API is healthy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/templates":{"get":{"tags":["Templates"],"summary":"List active templates","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":false,"name":"search","in":"query"},{"schema":{"$ref":"#/components/schemas/TemplateCategory"},"required":false,"name":"category","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"featured","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Templates retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TemplateResponse"}},"total":{"type":"integer","example":100},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0},"hasMore":{"type":"boolean","example":true}},"required":["items","total","limit","offset","hasMore"]}},"required":["success","requestId","timestamp","data"]}}}}}}},"/templates/{id}":{"get":{"tags":["Templates"],"summary":"Get template detail with input schema","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Template retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/TemplateResponse"}},"required":["success","requestId","timestamp","data"]}}}},"404":{"description":"Template not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/webhooks/fal":{"post":{"tags":["Webhooks"],"summary":"fal.ai generation webhook callback","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"generationId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FalWebhookBody"}}}},"responses":{"200":{"description":"Webhook processed","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"401":{"description":"Invalid signature","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Generation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Webhook processing failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/explore":{"get":{"tags":["Explore"],"summary":"Browse public generations feed","parameters":[{"schema":{"type":"string","enum":["recent","popular"],"default":"recent"},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Public feed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ExploreItem"}},"total":{"type":"integer","example":100},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0},"hasMore":{"type":"boolean","example":true}},"required":["items","total","limit","offset","hasMore"]}},"required":["success","requestId","timestamp","data"]}}}}}}},"/explore/{id}":{"get":{"tags":["Explore"],"summary":"Get a single public generation","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Public generation","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/ExploreItem"}},"required":["success","requestId","timestamp","data"]}}}},"404":{"description":"Generation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/explore/{id}/like":{"post":{"tags":["Explore"],"summary":"Like a public generation","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Liked","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/LikeResponse"}},"required":["success","requestId","timestamp","data"]}}}},"400":{"description":"Cannot like own generation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Generation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["Explore"],"summary":"Unlike a generation","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Unliked","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/LikeResponse"}},"required":["success","requestId","timestamp","data"]}}}},"404":{"description":"Generation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/generations/upload-url":{"post":{"tags":["Generations"],"summary":"Get a presigned upload URL for media input","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadUrlRequest"}}}},"responses":{"200":{"description":"Presigned upload URL generated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/UploadUrlResponse"}},"required":["success","requestId","timestamp","data"]}}}},"400":{"description":"Invalid field or content type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Template not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/generations":{"post":{"tags":["Generations"],"summary":"Create a new generation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGenerationRequest"}}}},"responses":{"202":{"description":"Generation queued","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/CreateGenerationResponse"}},"required":["success","requestId","timestamp","data"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Template not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Generation could not be started; credits were refunded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"tags":["Generations"],"summary":"List user generations","parameters":[{"schema":{"$ref":"#/components/schemas/GenerationStatus"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Generations retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/GenerationResponse"}},"total":{"type":"integer","example":100},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0},"hasMore":{"type":"boolean","example":true}},"required":["items","total","limit","offset","hasMore"]}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/generations/{id}":{"get":{"tags":["Generations"],"summary":"Get generation detail with inputs and outputs","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Generation retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/GenerationResponse"}},"required":["success","requestId","timestamp","data"]}}}},"404":{"description":"Generation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["Generations"],"summary":"Delete a generation","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Generation deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}},"required":["success","requestId","timestamp","data"]}}}},"400":{"description":"Cannot delete an in-progress generation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Generation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/generations/{id}/status":{"get":{"tags":["Generations"],"summary":"Get generation status for polling","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Status retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/GenerationStatusResponse"}},"required":["success","requestId","timestamp","data"]}}}},"404":{"description":"Generation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/generations/{id}/outputs/{outputId}/media":{"get":{"tags":["Generations"],"summary":"Stream output media","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"outputId","in":"path"}],"responses":{"200":{"description":"Media stream"},"404":{"description":"Output not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/generations/{id}/inputs/{inputId}/media":{"get":{"tags":["Generations"],"summary":"Stream input media","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"inputId","in":"path"}],"responses":{"200":{"description":"Media stream"},"404":{"description":"Input not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/generations/{id}/retry":{"post":{"tags":["Generations"],"summary":"Retry a failed generation","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Generation re-queued","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/RetryGenerationResponse"}},"required":["success","requestId","timestamp","data"]}}}},"400":{"description":"Generation is not in failed state or maximum retries exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient credits for the retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Generation or template not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/generations/{id}/publish":{"post":{"tags":["Generations"],"summary":"Publish a generation to the explore feed","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Published","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"type":"object","properties":{"published":{"type":"boolean"}},"required":["published"]}},"required":["success","requestId","timestamp","data"]}}}},"404":{"description":"Generation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/generations/{id}/unpublish":{"post":{"tags":["Generations"],"summary":"Remove a generation from the explore feed","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Unpublished","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"type":"object","properties":{"published":{"type":"boolean"}},"required":["published"]}},"required":["success","requestId","timestamp","data"]}}}},"404":{"description":"Generation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/referrals/code":{"get":{"tags":["Referrals"],"summary":"Get or create referral code for current user","responses":{"200":{"description":"Referral code retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/ReferralCodeResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/referrals":{"get":{"tags":["Referrals"],"summary":"Get referral history","responses":{"200":{"description":"Referrals retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Referral"}},"total":{"type":"integer","example":100},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0},"hasMore":{"type":"boolean","example":true}},"required":["items","total","limit","offset","hasMore"]}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/referrals/track":{"post":{"tags":["Referrals"],"summary":"Track a referral during sign-up","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackReferralRequest"}}}},"responses":{"200":{"description":"Referral tracked","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/TrackReferralResponse"}},"required":["success","requestId","timestamp","data"]}}}},"400":{"description":"Invalid referral code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/currency/balance":{"get":{"tags":["Currency"],"summary":"Get user's generation credit balance","responses":{"200":{"description":"Balance retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/CreditBalanceResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/account/profile":{"put":{"tags":["Account"],"summary":"Update user profile","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileRequest"}}}},"responses":{"200":{"description":"Profile updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/ProfileResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/account":{"delete":{"tags":["Account"],"summary":"Delete user account","responses":{"200":{"description":"Account deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/DeleteAccountResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/notifications/broadcast":{"post":{"tags":["Notifications"],"summary":"Broadcast push notification to marketing-opted-in users","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastNotificationRequest"}}}},"responses":{"200":{"description":"Broadcast sent","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/BroadcastNotificationResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/notifications/device-tokens":{"post":{"tags":["Notifications"],"summary":"Register device push token","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterDeviceTokenRequest"}}}},"responses":{"200":{"description":"Token registered","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/RegisterDeviceTokenResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["Notifications"],"summary":"Remove device push token","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveDeviceTokenRequest"}}}},"responses":{"200":{"description":"Token removed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/RemoveDeviceTokenResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/notifications/preferences":{"get":{"tags":["Notifications"],"summary":"Get notification preferences","responses":{"200":{"description":"Notification preferences","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/NotificationPreferencesResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"tags":["Notifications"],"summary":"Update notification preferences","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNotificationPreferencesRequest"}}}},"responses":{"200":{"description":"Preferences updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/NotificationPreferencesResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/prompts/enhance":{"post":{"tags":["Prompts"],"summary":"Enhance a user prompt using AI","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"templateId":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"prompt":{"type":"string","minLength":1,"maxLength":2000}},"required":["templateId","prompt"]}}}},"responses":{"200":{"description":"Enhanced prompt","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"type":"object","properties":{"enhancedPrompt":{"type":"string"}},"required":["enhancedPrompt"]}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Template not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/admin/stats":{"get":{"tags":["Admin Stats"],"summary":"Get platform statistics","responses":{"200":{"description":"Stats retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/AdminStatsResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/admin/templates":{"get":{"tags":["Admin Templates"],"summary":"List templates for admin dashboard","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":false,"name":"search","in":"query"},{"schema":{"$ref":"#/components/schemas/TemplateCategory"},"required":false,"name":"category","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"featured","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"isActive","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Templates retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminTemplateResponse"}},"total":{"type":"integer","example":100},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0},"hasMore":{"type":"boolean","example":true}},"required":["items","total","limit","offset","hasMore"]}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["Admin Templates"],"summary":"Create a template","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateTemplateRequest"}}}},"responses":{"200":{"description":"Template created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/AdminTemplateResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/admin/templates/{id}":{"get":{"tags":["Admin Templates"],"summary":"Get template details for admin dashboard","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["en","tr"]},"required":false,"name":"locale","in":"query"}],"responses":{"200":{"description":"Template retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/AdminTemplateDetailResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Template not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["Admin Templates"],"summary":"Update a template","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateTemplateRequest"}}}},"responses":{"200":{"description":"Template updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/AdminTemplateResponse"}},"required":["success","requestId","timestamp","data"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Template not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["Admin Templates"],"summary":"Soft-delete template by setting isActive=false","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Template deactivated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/AdminTemplateStatusResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Template not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/admin/templates/{id}/translations/{locale}":{"get":{"tags":["Admin Templates"],"summary":"Get template translation by locale","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["en","tr"]},"required":true,"name":"locale","in":"path"}],"responses":{"200":{"description":"Template translation retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/AdminTemplateTranslationResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Template translation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"tags":["Admin Templates"],"summary":"Create or update template translation","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["en","tr"]},"required":true,"name":"locale","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpsertTemplateTranslationRequest"}}}},"responses":{"200":{"description":"Template translation upserted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/AdminTemplateTranslationResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Template not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/admin/upload-url":{"post":{"tags":["Admin Upload"],"summary":"Generate a presigned upload URL","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUploadUrlRequest"}}}},"responses":{"200":{"description":"Upload URL generated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/AdminUploadUrlResponse"}},"required":["success","requestId","timestamp","data"]}}}},"400":{"description":"Invalid file type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/admin/users":{"get":{"tags":["Admin Users"],"summary":"List users for admin dashboard","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"banned","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Users retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminUserResponse"}},"total":{"type":"integer","example":100},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0},"hasMore":{"type":"boolean","example":true}},"required":["items","total","limit","offset","hasMore"]}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/admin/users/{id}/ban":{"patch":{"tags":["Admin Users"],"summary":"Ban a user","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminBanUserRequest"}}}},"responses":{"200":{"description":"User banned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/AdminUserStatusResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/admin/users/{id}/unban":{"patch":{"tags":["Admin Users"],"summary":"Unban a user","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"User unbanned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/AdminUserStatusResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/admin/users/{id}/role":{"patch":{"tags":["Admin Users"],"summary":"Update user role","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateRoleRequest"}}}},"responses":{"200":{"description":"Role updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"requestId":{"type":"string","example":"abc-123-def-456"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"data":{"$ref":"#/components/schemas/AdminUserRoleResponse"}},"required":["success","requestId","timestamp","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}}}