2691 lines
64 KiB
YAML
2691 lines
64 KiB
YAML
basePath: /
|
|
definitions:
|
|
admin.CreateAdminPaymentRequest:
|
|
properties:
|
|
payment_method:
|
|
type: string
|
|
plan_id:
|
|
type: string
|
|
term_months:
|
|
type: integer
|
|
topup_amount:
|
|
type: number
|
|
user_id:
|
|
type: string
|
|
required:
|
|
- payment_method
|
|
- plan_id
|
|
- term_months
|
|
- user_id
|
|
type: object
|
|
admin.CreateAdminUserRequest:
|
|
properties:
|
|
email:
|
|
type: string
|
|
password:
|
|
minLength: 6
|
|
type: string
|
|
plan_id:
|
|
type: string
|
|
role:
|
|
type: string
|
|
username:
|
|
type: string
|
|
required:
|
|
- email
|
|
- password
|
|
type: object
|
|
admin.DashboardPayload:
|
|
properties:
|
|
active_subscriptions:
|
|
type: integer
|
|
new_users_today:
|
|
type: integer
|
|
new_videos_today:
|
|
type: integer
|
|
total_ad_templates:
|
|
type: integer
|
|
total_payments:
|
|
type: integer
|
|
total_revenue:
|
|
type: number
|
|
total_storage_used:
|
|
type: integer
|
|
total_users:
|
|
type: integer
|
|
total_videos:
|
|
type: integer
|
|
type: object
|
|
admin.SaveAdminAdTemplateRequest:
|
|
properties:
|
|
ad_format:
|
|
type: string
|
|
description:
|
|
type: string
|
|
duration:
|
|
type: integer
|
|
is_active:
|
|
type: boolean
|
|
is_default:
|
|
type: boolean
|
|
name:
|
|
type: string
|
|
user_id:
|
|
type: string
|
|
vast_tag_url:
|
|
type: string
|
|
required:
|
|
- name
|
|
- user_id
|
|
- vast_tag_url
|
|
type: object
|
|
admin.SaveAdminVideoRequest:
|
|
properties:
|
|
ad_template_id:
|
|
type: string
|
|
description:
|
|
type: string
|
|
duration:
|
|
type: integer
|
|
format:
|
|
type: string
|
|
size:
|
|
type: integer
|
|
status:
|
|
type: string
|
|
title:
|
|
type: string
|
|
url:
|
|
type: string
|
|
user_id:
|
|
type: string
|
|
required:
|
|
- size
|
|
- title
|
|
- url
|
|
- user_id
|
|
type: object
|
|
admin.SavePlanRequest:
|
|
properties:
|
|
cycle:
|
|
type: string
|
|
description:
|
|
type: string
|
|
features:
|
|
items:
|
|
type: string
|
|
type: array
|
|
is_active:
|
|
type: boolean
|
|
name:
|
|
type: string
|
|
price:
|
|
type: number
|
|
storage_limit:
|
|
type: integer
|
|
upload_limit:
|
|
type: integer
|
|
required:
|
|
- cycle
|
|
- name
|
|
- price
|
|
- storage_limit
|
|
- upload_limit
|
|
type: object
|
|
admin.UpdateAdminPaymentRequest:
|
|
properties:
|
|
status:
|
|
type: string
|
|
required:
|
|
- status
|
|
type: object
|
|
admin.UpdateAdminUserRequest:
|
|
properties:
|
|
email:
|
|
type: string
|
|
password:
|
|
type: string
|
|
plan_id:
|
|
type: string
|
|
role:
|
|
type: string
|
|
username:
|
|
type: string
|
|
type: object
|
|
admin.UpdateUserRoleRequest:
|
|
properties:
|
|
role:
|
|
type: string
|
|
required:
|
|
- role
|
|
type: object
|
|
admin.createJobRequest:
|
|
properties:
|
|
command:
|
|
type: string
|
|
env:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
image:
|
|
type: string
|
|
name:
|
|
type: string
|
|
priority:
|
|
type: integer
|
|
time_limit:
|
|
type: integer
|
|
user_id:
|
|
type: string
|
|
type: object
|
|
adtemplates.SaveAdTemplateRequest:
|
|
properties:
|
|
ad_format:
|
|
type: string
|
|
description:
|
|
type: string
|
|
duration:
|
|
type: integer
|
|
is_active:
|
|
type: boolean
|
|
is_default:
|
|
type: boolean
|
|
name:
|
|
type: string
|
|
vast_tag_url:
|
|
type: string
|
|
required:
|
|
- name
|
|
- vast_tag_url
|
|
type: object
|
|
adtemplates.TemplateListPayload:
|
|
properties:
|
|
templates:
|
|
items:
|
|
$ref: '#/definitions/model.AdTemplate'
|
|
type: array
|
|
type: object
|
|
adtemplates.TemplatePayload:
|
|
properties:
|
|
template:
|
|
$ref: '#/definitions/model.AdTemplate'
|
|
type: object
|
|
auth.ChangePasswordRequest:
|
|
properties:
|
|
current_password:
|
|
type: string
|
|
new_password:
|
|
minLength: 6
|
|
type: string
|
|
required:
|
|
- current_password
|
|
- new_password
|
|
type: object
|
|
auth.ForgotPasswordRequest:
|
|
properties:
|
|
email:
|
|
type: string
|
|
required:
|
|
- email
|
|
type: object
|
|
auth.LoginRequest:
|
|
properties:
|
|
email:
|
|
type: string
|
|
password:
|
|
type: string
|
|
required:
|
|
- email
|
|
- password
|
|
type: object
|
|
auth.RegisterRequest:
|
|
properties:
|
|
email:
|
|
type: string
|
|
password:
|
|
minLength: 6
|
|
type: string
|
|
username:
|
|
type: string
|
|
required:
|
|
- email
|
|
- password
|
|
- username
|
|
type: object
|
|
auth.ResetPasswordRequest:
|
|
properties:
|
|
new_password:
|
|
minLength: 6
|
|
type: string
|
|
token:
|
|
type: string
|
|
required:
|
|
- new_password
|
|
- token
|
|
type: object
|
|
auth.UpdateMeRequest:
|
|
properties:
|
|
email:
|
|
type: string
|
|
language:
|
|
type: string
|
|
locale:
|
|
type: string
|
|
username:
|
|
type: string
|
|
type: object
|
|
auth.UserPayload:
|
|
properties:
|
|
avatar:
|
|
type: string
|
|
created_at:
|
|
type: string
|
|
email:
|
|
type: string
|
|
google_id:
|
|
type: string
|
|
id:
|
|
type: string
|
|
language:
|
|
type: string
|
|
locale:
|
|
type: string
|
|
plan_expires_at:
|
|
type: string
|
|
plan_expiring_soon:
|
|
type: boolean
|
|
plan_id:
|
|
type: string
|
|
plan_payment_method:
|
|
type: string
|
|
plan_started_at:
|
|
type: string
|
|
plan_term_months:
|
|
type: integer
|
|
role:
|
|
type: string
|
|
storage_used:
|
|
type: integer
|
|
updated_at:
|
|
type: string
|
|
username:
|
|
type: string
|
|
wallet_balance:
|
|
type: number
|
|
type: object
|
|
domains.CreateDomainRequest:
|
|
properties:
|
|
name:
|
|
type: string
|
|
required:
|
|
- name
|
|
type: object
|
|
model.AdTemplate:
|
|
properties:
|
|
ad_format:
|
|
type: string
|
|
created_at:
|
|
type: string
|
|
description:
|
|
type: string
|
|
duration:
|
|
type: integer
|
|
id:
|
|
type: string
|
|
is_active:
|
|
type: boolean
|
|
is_default:
|
|
type: boolean
|
|
name:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
user_id:
|
|
type: string
|
|
vast_tag_url:
|
|
type: string
|
|
type: object
|
|
model.Video:
|
|
properties:
|
|
created_at:
|
|
type: string
|
|
description:
|
|
type: string
|
|
duration:
|
|
type: integer
|
|
format:
|
|
type: string
|
|
hls_path:
|
|
type: string
|
|
hls_token:
|
|
type: string
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
processing_status:
|
|
type: string
|
|
size:
|
|
type: integer
|
|
status:
|
|
type: string
|
|
storage_type:
|
|
type: string
|
|
thumbnail:
|
|
type: string
|
|
title:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
url:
|
|
type: string
|
|
user_id:
|
|
type: string
|
|
views:
|
|
type: integer
|
|
type: object
|
|
payment.CreatePaymentRequest:
|
|
properties:
|
|
payment_method:
|
|
type: string
|
|
plan_id:
|
|
type: string
|
|
term_months:
|
|
type: integer
|
|
topup_amount:
|
|
type: number
|
|
required:
|
|
- payment_method
|
|
- plan_id
|
|
- term_months
|
|
type: object
|
|
payment.TopupWalletRequest:
|
|
properties:
|
|
amount:
|
|
type: number
|
|
required:
|
|
- amount
|
|
type: object
|
|
preferences.SettingsPreferencesRequest:
|
|
properties:
|
|
airplay:
|
|
type: boolean
|
|
autoplay:
|
|
type: boolean
|
|
chromecast:
|
|
type: boolean
|
|
email_notifications:
|
|
type: boolean
|
|
language:
|
|
type: string
|
|
locale:
|
|
type: string
|
|
loop:
|
|
type: boolean
|
|
marketing_notifications:
|
|
type: boolean
|
|
muted:
|
|
type: boolean
|
|
pip:
|
|
type: boolean
|
|
push_notifications:
|
|
type: boolean
|
|
show_controls:
|
|
type: boolean
|
|
telegram_notifications:
|
|
type: boolean
|
|
type: object
|
|
response.Response:
|
|
properties:
|
|
code:
|
|
type: integer
|
|
data: {}
|
|
message:
|
|
type: string
|
|
type: object
|
|
services.ComponentHealth:
|
|
properties:
|
|
checked_at:
|
|
type: string
|
|
latency:
|
|
type: string
|
|
message:
|
|
type: string
|
|
status:
|
|
$ref: '#/definitions/services.HealthStatus'
|
|
type: object
|
|
services.HealthReport:
|
|
properties:
|
|
checked_at:
|
|
type: string
|
|
components:
|
|
additionalProperties:
|
|
$ref: '#/definitions/services.ComponentHealth'
|
|
type: object
|
|
status:
|
|
$ref: '#/definitions/services.HealthStatus'
|
|
version:
|
|
type: string
|
|
type: object
|
|
services.HealthStatus:
|
|
enum:
|
|
- healthy
|
|
- unhealthy
|
|
- degraded
|
|
type: string
|
|
x-enum-varnames:
|
|
- HealthStatusHealthy
|
|
- HealthStatusUnhealthy
|
|
- HealthStatusDegraded
|
|
usage.UsagePayload:
|
|
properties:
|
|
total_storage:
|
|
type: integer
|
|
total_videos:
|
|
type: integer
|
|
user_id:
|
|
type: string
|
|
type: object
|
|
video.CreateVideoRequest:
|
|
properties:
|
|
description:
|
|
type: string
|
|
duration:
|
|
description: Maybe client knows, or we process later
|
|
type: integer
|
|
format:
|
|
type: string
|
|
size:
|
|
type: integer
|
|
title:
|
|
type: string
|
|
url:
|
|
description: The S3 Key or Full URL
|
|
type: string
|
|
required:
|
|
- size
|
|
- title
|
|
- url
|
|
type: object
|
|
video.UpdateVideoRequest:
|
|
properties:
|
|
ad_template_id:
|
|
type: string
|
|
description:
|
|
type: string
|
|
title:
|
|
type: string
|
|
required:
|
|
- title
|
|
type: object
|
|
video.UploadURLRequest:
|
|
properties:
|
|
content_type:
|
|
type: string
|
|
filename:
|
|
type: string
|
|
size:
|
|
type: integer
|
|
required:
|
|
- content_type
|
|
- filename
|
|
- size
|
|
type: object
|
|
host: localhost:8080
|
|
info:
|
|
contact:
|
|
email: support@swagger.io
|
|
name: API Support
|
|
url: http://www.swagger.io/support
|
|
description: This is the API server for Stream application.
|
|
license:
|
|
name: Apache 2.0
|
|
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
|
termsOfService: http://swagger.io/terms/
|
|
title: Stream API
|
|
version: "1.0"
|
|
paths:
|
|
/ad-templates:
|
|
get:
|
|
description: Get all VAST ad templates for the current user
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/response.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/adtemplates.TemplateListPayload'
|
|
type: object
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: List Ad Templates
|
|
tags:
|
|
- ad-templates
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create a VAST ad template for the current user
|
|
parameters:
|
|
- description: Ad template payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/adtemplates.SaveAdTemplateRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/response.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/adtemplates.TemplatePayload'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Create Ad Template
|
|
tags:
|
|
- ad-templates
|
|
/ad-templates/{id}:
|
|
delete:
|
|
description: Delete a VAST ad template for the current user
|
|
parameters:
|
|
- description: Ad Template ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Delete Ad Template
|
|
tags:
|
|
- ad-templates
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update a VAST ad template for the current user
|
|
parameters:
|
|
- description: Ad Template ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
- description: Ad template payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/adtemplates.SaveAdTemplateRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/response.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/adtemplates.TemplatePayload'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Update Ad Template
|
|
tags:
|
|
- ad-templates
|
|
/admin/ad-templates:
|
|
get:
|
|
description: Get paginated list of all ad templates across users (admin only)
|
|
parameters:
|
|
- default: 1
|
|
description: Page
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- default: 20
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- description: Filter by user ID
|
|
in: query
|
|
name: user_id
|
|
type: string
|
|
- description: Search by name
|
|
in: query
|
|
name: search
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: List All Ad Templates
|
|
tags:
|
|
- admin
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create an ad template for any user (admin only)
|
|
parameters:
|
|
- description: Ad template payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/admin.SaveAdminAdTemplateRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Create Ad Template
|
|
tags:
|
|
- admin
|
|
/admin/ad-templates/{id}:
|
|
delete:
|
|
description: Delete any ad template by ID (admin only)
|
|
parameters:
|
|
- description: Ad Template ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Delete Ad Template (Admin)
|
|
tags:
|
|
- admin
|
|
get:
|
|
description: Get ad template detail (admin only)
|
|
parameters:
|
|
- description: Ad Template ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Get Ad Template Detail
|
|
tags:
|
|
- admin
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update an ad template for any user (admin only)
|
|
parameters:
|
|
- description: Ad Template ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
- description: Ad template payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/admin.SaveAdminAdTemplateRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Update Ad Template
|
|
tags:
|
|
- admin
|
|
/admin/agents:
|
|
get:
|
|
description: Returns currently connected render agents and current runtime stats
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: List connected render agents
|
|
tags:
|
|
- admin-render
|
|
/admin/agents/{id}/restart:
|
|
post:
|
|
description: Sends a restart command to a currently connected render agent
|
|
parameters:
|
|
- description: Agent ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"503":
|
|
description: Service Unavailable
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Restart connected render agent
|
|
tags:
|
|
- admin-render
|
|
/admin/agents/{id}/update:
|
|
post:
|
|
description: Sends an update command to a currently connected render agent
|
|
parameters:
|
|
- description: Agent ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"503":
|
|
description: Service Unavailable
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Update connected render agent
|
|
tags:
|
|
- admin-render
|
|
/admin/dashboard:
|
|
get:
|
|
description: Get system-wide statistics for the admin dashboard
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/response.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/admin.DashboardPayload'
|
|
type: object
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Admin Dashboard
|
|
tags:
|
|
- admin
|
|
/admin/jobs:
|
|
get:
|
|
description: Returns paginated render jobs for admin management
|
|
parameters:
|
|
- description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
- description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- description: Agent ID
|
|
in: query
|
|
name: agent_id
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: List render jobs
|
|
tags:
|
|
- admin-render
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Queues a new render job for agents
|
|
parameters:
|
|
- description: Job payload
|
|
in: body
|
|
name: payload
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/admin.createJobRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Create render job
|
|
tags:
|
|
- admin-render
|
|
/admin/jobs/{id}:
|
|
get:
|
|
description: Returns a render job by ID
|
|
parameters:
|
|
- description: Job ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Get render job detail
|
|
tags:
|
|
- admin-render
|
|
/admin/jobs/{id}/cancel:
|
|
post:
|
|
description: Cancels a pending or running render job
|
|
parameters:
|
|
- description: Job ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Cancel render job
|
|
tags:
|
|
- admin-render
|
|
/admin/jobs/{id}/logs:
|
|
get:
|
|
description: Returns plain text logs for a render job
|
|
parameters:
|
|
- description: Job ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- text/plain
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
type: string
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Get render job logs
|
|
tags:
|
|
- admin-render
|
|
/admin/jobs/{id}/retry:
|
|
post:
|
|
description: Retries a failed or cancelled render job
|
|
parameters:
|
|
- description: Job ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Retry render job
|
|
tags:
|
|
- admin-render
|
|
/admin/payments:
|
|
get:
|
|
description: Get paginated list of all payments across users (admin only)
|
|
parameters:
|
|
- default: 1
|
|
description: Page
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- default: 20
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- description: Filter by user ID
|
|
in: query
|
|
name: user_id
|
|
type: string
|
|
- description: Filter by status
|
|
in: query
|
|
name: status
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: List All Payments
|
|
tags:
|
|
- admin
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create a model subscription charge for a user (admin only)
|
|
parameters:
|
|
- description: Payment payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/admin.CreateAdminPaymentRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Create Payment
|
|
tags:
|
|
- admin
|
|
/admin/payments/{id}:
|
|
get:
|
|
description: Get payment detail (admin only)
|
|
parameters:
|
|
- description: Payment ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Get Payment Detail
|
|
tags:
|
|
- admin
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update payment status safely without hard delete (admin only)
|
|
parameters:
|
|
- description: Payment ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
- description: Payment update payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/admin.UpdateAdminPaymentRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Update Payment
|
|
tags:
|
|
- admin
|
|
/admin/plans:
|
|
get:
|
|
description: Get all plans with usage counts (admin only)
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: List Plans
|
|
tags:
|
|
- admin
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create a plan (admin only)
|
|
parameters:
|
|
- description: Plan payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/admin.SavePlanRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Create Plan
|
|
tags:
|
|
- admin
|
|
/admin/plans/{id}:
|
|
delete:
|
|
description: Delete a plan, or deactivate it if already used (admin only)
|
|
parameters:
|
|
- description: Plan ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Delete Plan
|
|
tags:
|
|
- admin
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update a plan (admin only)
|
|
parameters:
|
|
- description: Plan ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
- description: Plan payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/admin.SavePlanRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Update Plan
|
|
tags:
|
|
- admin
|
|
/admin/users:
|
|
get:
|
|
description: Get paginated list of all users (admin only)
|
|
parameters:
|
|
- default: 1
|
|
description: Page
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- default: 20
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- description: Search by email or username
|
|
in: query
|
|
name: search
|
|
type: string
|
|
- description: Filter by role
|
|
in: query
|
|
name: role
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: List Users
|
|
tags:
|
|
- admin
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create a user from admin panel (admin only)
|
|
parameters:
|
|
- description: User payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/admin.CreateAdminUserRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Create User
|
|
tags:
|
|
- admin
|
|
/admin/users/{id}:
|
|
delete:
|
|
description: Delete a user and their data (admin only)
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Delete User
|
|
tags:
|
|
- admin
|
|
get:
|
|
description: Get detailed info about a single user (admin only)
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Get User Detail
|
|
tags:
|
|
- admin
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update a user from admin panel (admin only)
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
- description: User payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/admin.UpdateAdminUserRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Update User
|
|
tags:
|
|
- admin
|
|
/admin/users/{id}/role:
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: 'Change user role (admin only). Valid: USER, ADMIN, BLOCK'
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
- description: Role payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/admin.UpdateUserRoleRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Update User Role
|
|
tags:
|
|
- admin
|
|
/admin/videos:
|
|
get:
|
|
description: Get paginated list of all videos across users (admin only)
|
|
parameters:
|
|
- default: 1
|
|
description: Page
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- default: 20
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- description: Search by title
|
|
in: query
|
|
name: search
|
|
type: string
|
|
- description: Filter by user ID
|
|
in: query
|
|
name: user_id
|
|
type: string
|
|
- description: Filter by status
|
|
in: query
|
|
name: status
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: List All Videos
|
|
tags:
|
|
- admin
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create a model video record for a user (admin only)
|
|
parameters:
|
|
- description: Video payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/admin.SaveAdminVideoRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Create Video
|
|
tags:
|
|
- admin
|
|
/admin/videos/{id}:
|
|
delete:
|
|
description: Delete any video by ID (admin only)
|
|
parameters:
|
|
- description: Video ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Delete Video (Admin)
|
|
tags:
|
|
- admin
|
|
get:
|
|
description: Get video detail by ID (admin only)
|
|
parameters:
|
|
- description: Video ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Get Video Detail
|
|
tags:
|
|
- admin
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update video metadata and status (admin only)
|
|
parameters:
|
|
- description: Video ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
- description: Video payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/admin.SaveAdminVideoRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Update Video
|
|
tags:
|
|
- admin
|
|
/admin/ws:
|
|
get:
|
|
description: Upgrade to websocket for authenticated admin realtime job and agent
|
|
updates
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"101":
|
|
description: Switching Protocols
|
|
schema:
|
|
type: string
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Admin realtime websocket
|
|
tags:
|
|
- admin-render
|
|
/auth/change-password:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Change the authenticated user's local password
|
|
parameters:
|
|
- description: Password payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/auth.ChangePasswordRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Change Password
|
|
tags:
|
|
- auth
|
|
/auth/forgot-password:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Request password reset link
|
|
parameters:
|
|
- description: Forgot password payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/auth.ForgotPasswordRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
summary: Forgot Password
|
|
tags:
|
|
- auth
|
|
/auth/google/callback:
|
|
get:
|
|
description: Callback for Google Login
|
|
responses:
|
|
"307":
|
|
description: Temporary Redirect
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
summary: Google Callback
|
|
tags:
|
|
- auth
|
|
/auth/google/login:
|
|
get:
|
|
description: Redirect to Google for Login
|
|
responses: {}
|
|
summary: Google Login
|
|
tags:
|
|
- auth
|
|
/auth/login:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Login with email and password
|
|
parameters:
|
|
- description: Login payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/auth.LoginRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/response.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/auth.UserPayload'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
summary: Login
|
|
tags:
|
|
- auth
|
|
/auth/logout:
|
|
post:
|
|
description: Logout user and clear cookies
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Logout
|
|
tags:
|
|
- auth
|
|
/auth/register:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Register a new user
|
|
parameters:
|
|
- description: Registration payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/auth.RegisterRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
summary: Register
|
|
tags:
|
|
- auth
|
|
/auth/reset-password:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Reset password using token
|
|
parameters:
|
|
- description: Reset password payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/auth.ResetPasswordRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
summary: Reset Password
|
|
tags:
|
|
- auth
|
|
/domains:
|
|
get:
|
|
description: Get all whitelisted domains for the current user
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: List Domains
|
|
tags:
|
|
- domains
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Add a domain to the current user's whitelist
|
|
parameters:
|
|
- description: Domain payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domains.CreateDomainRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Create Domain
|
|
tags:
|
|
- domains
|
|
/domains/{id}:
|
|
delete:
|
|
description: Remove a domain from the current user's whitelist
|
|
parameters:
|
|
- description: Domain ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Delete Domain
|
|
tags:
|
|
- domains
|
|
/health/detailed:
|
|
get:
|
|
description: Returns detailed health state for database, redis, and render dependencies
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/services.HealthReport'
|
|
summary: Detailed health check
|
|
tags:
|
|
- health
|
|
/health/live:
|
|
get:
|
|
description: Returns liveness status for the API and render module
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
"503":
|
|
description: Service Unavailable
|
|
schema:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
summary: Liveness health check
|
|
tags:
|
|
- health
|
|
/health/ready:
|
|
get:
|
|
description: Returns readiness status including render gRPC availability flag
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
"503":
|
|
description: Service Unavailable
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
summary: Readiness health check
|
|
tags:
|
|
- health
|
|
/me:
|
|
delete:
|
|
description: Permanently delete the authenticated user's account and related
|
|
data
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Delete My Account
|
|
tags:
|
|
- auth
|
|
get:
|
|
description: Get the authenticated user's profile payload
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Get Current User
|
|
tags:
|
|
- auth
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update the authenticated user's profile information
|
|
parameters:
|
|
- description: Profile payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/auth.UpdateMeRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Update Current User
|
|
tags:
|
|
- auth
|
|
/me/clear-data:
|
|
post:
|
|
description: Remove videos and settings-related resources for the authenticated
|
|
user
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Clear My Data
|
|
tags:
|
|
- auth
|
|
/notifications:
|
|
delete:
|
|
description: Delete all notifications for the current user
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Clear Notifications
|
|
tags:
|
|
- notifications
|
|
get:
|
|
description: Get notifications for the current user
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: List Notifications
|
|
tags:
|
|
- notifications
|
|
/notifications/{id}:
|
|
delete:
|
|
description: Delete a single notification for the current user
|
|
parameters:
|
|
- description: Notification ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Delete Notification
|
|
tags:
|
|
- notifications
|
|
/notifications/{id}/read:
|
|
post:
|
|
description: Mark a single notification as read for the current user
|
|
parameters:
|
|
- description: Notification ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Mark Notification Read
|
|
tags:
|
|
- notifications
|
|
/notifications/read-all:
|
|
post:
|
|
description: Mark all notifications as read for the current user
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Mark All Notifications Read
|
|
tags:
|
|
- notifications
|
|
/payments:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create a new payment for buying or renewing a plan
|
|
parameters:
|
|
- description: Payment Info
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/payment.CreatePaymentRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Create Payment
|
|
tags:
|
|
- payment
|
|
/payments/{id}/invoice:
|
|
get:
|
|
description: Download invoice text for a payment or wallet top-up
|
|
parameters:
|
|
- description: Payment ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- text/plain
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
type: string
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Download Invoice
|
|
tags:
|
|
- payment
|
|
/payments/history:
|
|
get:
|
|
description: Get payment history for the current user
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: List Payment History
|
|
tags:
|
|
- payment
|
|
/plans:
|
|
get:
|
|
description: Get all active plans
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: List Plans
|
|
tags:
|
|
- plan
|
|
/settings/preferences:
|
|
get:
|
|
description: Get notification, player, and locale preferences for the current
|
|
user
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Get Preferences
|
|
tags:
|
|
- settings
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update notification, player, and locale preferences for the current
|
|
user
|
|
parameters:
|
|
- description: Preferences payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/preferences.SettingsPreferencesRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Update Preferences
|
|
tags:
|
|
- settings
|
|
/usage:
|
|
get:
|
|
description: Get the authenticated user's total video count and total storage
|
|
usage
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/response.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/usage.UsagePayload'
|
|
type: object
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Get Usage
|
|
tags:
|
|
- usage
|
|
/videos:
|
|
get:
|
|
description: Get paginated videos
|
|
parameters:
|
|
- default: 1
|
|
description: Page number
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- default: 10
|
|
description: Page size
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: List Videos
|
|
tags:
|
|
- video
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create video record after upload
|
|
parameters:
|
|
- description: Video Info
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/video.CreateVideoRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/response.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/model.Video'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Create Video
|
|
tags:
|
|
- video
|
|
/videos/{id}:
|
|
delete:
|
|
description: Delete a video owned by the current user
|
|
parameters:
|
|
- description: Video ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Delete Video
|
|
tags:
|
|
- video
|
|
get:
|
|
description: Get video details by ID
|
|
parameters:
|
|
- description: Video ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/response.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/model.Video'
|
|
type: object
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Get Video
|
|
tags:
|
|
- video
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update title and description for a video owned by the current user
|
|
parameters:
|
|
- description: Video ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
- description: Video payload
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/video.UpdateVideoRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Update Video
|
|
tags:
|
|
- video
|
|
/videos/upload-url:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Generate presigned URL for video upload
|
|
parameters:
|
|
- description: File Info
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/video.UploadURLRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Get Upload URL
|
|
tags:
|
|
- video
|
|
/wallet/topups:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Add funds to wallet balance for the current user
|
|
parameters:
|
|
- description: Topup Info
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/payment.TopupWalletRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.Response'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: Top Up Wallet
|
|
tags:
|
|
- payment
|
|
securityDefinitions:
|
|
BearerAuth:
|
|
in: header
|
|
name: Authorization
|
|
type: apiKey
|
|
swagger: "2.0"
|