QLAPI is available to JavaScript/TypeScript and Python scripts through the panel's task preloader. It uses the local runtime rather than application-token HTTP OpenAPI or the remote CLI. Running a script with plain Node/Python does not guarantee this variable is injected.
This reference follows api.proto and preloader clients. JavaScript methods return Promises; Python methods synchronously return dictionaries. HTTP fields are not necessarily available in this API: for example, work_dir and allow_multiple_instances are absent from the current CronItem protocol.
Pass parameters as one object. Array fields require arrays, even for a single ID.
| Method | Purpose | Parameter object | Response type |
|---|---|---|---|
getEnvs |
List environment variables | { searchValue: string } |
EnvsResponse |
createEnv |
Create environment variables | { envs: EnvItem[] } |
EnvsResponse |
updateEnv |
Update an environment variable | { env: EnvItem } |
EnvResponse |
deleteEnvs |
Delete environment variables | { ids: int32[] } |
Response |
moveEnv |
Move an environment variable | { id: int32, fromIndex: int32, toIndex: int32 } |
EnvResponse |
disableEnvs |
Disable environment variables | { ids: int32[] } |
Response |
enableEnvs |
Enable environment variables | { ids: int32[] } |
Response |
updateEnvNames |
Rename environment variables | { ids: int32[], name: string } |
Response |
getEnvById |
Get an environment variable | { id: int32 } |
EnvResponse |
systemNotify |
Send a notification | { title: string, content: string, notificationInfo?: NotificationInfo } |
Response |
getCronDetail |
Find a task by log path | { log_path: string } |
CronDetailResponse |
createCron |
Create a task | { command: string, schedule: string, name?: string, labels: string[], sub_id?: int32, extra_schedules: ExtraScheduleItem[], task_before?: string, task_after?: string } |
CronResponse |
updateCron |
Update a task | { id: int32, command?: string, schedule?: string, name?: string, labels: string[], sub_id?: int32, extra_schedules: ExtraScheduleItem[], task_before?: string, task_after?: string } |
CronResponse |
deleteCrons |
Delete tasks | { ids: int32[] } |
Response |
getCrons |
List tasks | { searchValue?: string } |
CronsResponse |
getCronById |
Get a task | { id: int32 } |
CronResponse |
enableCrons |
Enable tasks | { ids: int32[] } |
Response |
disableCrons |
Disable tasks | { ids: int32[] } |
Response |
runCrons |
Run tasks | { ids: int32[] } |
Response |
? marks optional protocol fields; server validation still applies. createCron requires command/schedule. Include the complete command and schedule when updating a task. getCronDetail looks up log_path, not a task ID.
The JavaScript client decodes int64 as strings, including position and task time fields. Successful responses have code: 200; check the API code and handle call exceptions.
systemNotify requires title and content. Optional notificationInfo overrides panel notification settings; omit it to use the panel configuration.
Supported notificationInfo.type values:
gotify, goCqHttpBot, serverChan, pushDeer, bark, chat, telegramBot, dingtalkBot, weWorkBot, weWorkApp, aibotk, iGot, pushPlus, wePlusBot, email, pushMe, feishu, webhook, chronocat, ntfy, wxPusherBot, wxPusherSpt, wpush.
Common fields: gotifyUrl/gotifyToken/gotifyPriority for Gotify, telegramBotToken/telegramBotUserId for Telegram, larkKey/larkSecret for Feishu, wxPusherSptList for WxPusher SPT, and wpushApiKey/wpushChannel/wpushTopicCode for WPush. See the notification protocol for the remaining fields.