Subscription Management API Documentation
Base Path
/subscriptions
Endpoints
Get Subscriptions List
Query Parameters
{
searchValue?: string, // Search keyword
ids?: string // JSON-encoded ID array, e.g. "[1,2]"
}
Create Subscription
Request Body
{
type: string, // Subscription type
schedule?: string, // Schedule
interval_schedule?: { // Interval schedule
type: string,
value: number
},
name?: string, // Name
url: string, // Subscription URL
whitelist?: string, // Whitelist
blacklist?: string, // Blacklist
branch?: string, // Branch
dependences?: string, // Dependencies
pull_type?: string, // Pull type
pull_option?: object, // Pull options
extensions?: string, // Extensions
sub_before?: string, // Pre-execution script
sub_after?: string, // Post-execution script
schedule_type: string, // Schedule type
alias: string, // Alias
proxy?: string, // Proxy
autoAddCron?: boolean, // Auto add cron task
autoDelCron?: boolean // Auto delete cron task
}
Update Subscription
The body requires id: number, type: string, url: string and alias: string. Other fields follow the create request, but schedule_type is optional when updating. On creation, interval_schedule.value must be at least 1.
Delete Subscriptions
The body is an array of subscription IDs, such as [1, 2]. The optional query parameter force=true also deletes associated cron tasks, script directories and repository directories. Omitting it removes only the subscriptions.
Get Subscription Details
id is a numeric subscription ID. The response data contains the subscription object.
Run Subscription
Request Body
number[] // Array of subscription IDs
Stop Subscription
Request Body
number[] // Array of subscription IDs
Disable Subscription
Request Body
number[] // Array of subscription IDs
Enable Subscription
Request Body
number[] // Array of subscription IDs
Get Subscription Log
Query parameters accept offset (non-negative integer byte offset), limit (1–1048576 bytes) and tail (boolean). The response includes log text in data, plus offset, nextOffset, total and truncated. Use nextOffset to continue reading, rather than counting characters. See the Log API.
Update Subscription Status
Request Body
{
ids: number[], // Array of subscription IDs
status: string, // Status
pid?: string, // Process ID
log_path?: string // Log path
}
Get Subscription Logs List
Error Handling
- All endpoints follow unified error handling mechanism
- Successful responses return
{ code: 200, data: ... }
- Error logging is handled by Winston logger
Notes
- Parameter validation using celebrate/Joi
- Cron expressions are validated through cron-parser
- Supports batch operations (run, stop, enable, disable, etc.)