Jadwal
Menjalankan bot terjadwal dan memeriksa hasilnya. 14 endpoint
GET /schedules
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
botId (query) | string | ||
enabled (query) | string | ||
scope (query) | string |
Contoh
bash
curl -X GET 'https://api.lexcetha.com/api/v1/schedules' \
-H "Authorization: Bearer $LEX_TOKEN"GET /schedules/calendar
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
from (query) | string | ||
to (query) | string |
Contoh
bash
curl -X GET 'https://api.lexcetha.com/api/v1/schedules/calendar' \
-H "Authorization: Bearer $LEX_TOKEN"GET /bots/{botId}/schedules
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
botId (path) | string | ya |
Contoh
bash
curl -X GET 'https://api.lexcetha.com/api/v1/bots/:botId/schedules' \
-H "Authorization: Bearer $LEX_TOKEN"POST /bots/{botId}/schedules
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
botId (path) | string | ya |
Body permintaan
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
name | string | ya | panjang 1–120 |
description | string | panjang 0–1000 | |
taskInput | string | ya | panjang 1–10000 |
scheduleType | "once" | "interval" | "cron" | ya | |
scheduleValue | string | ya | panjang 1–100 |
timezone | string | ya | panjang 1–64 |
enabled | boolean | ya | bawaan true |
misfirePolicy | "run_once" | "skip" | ya | bawaan "run_once" |
timeoutSeconds | integer | ya | min 30 · maks 3600 · bawaan 300 |
maxRetries | integer | ya | min 0 · maks 5 · bawaan 0 |
approvalPolicy | "require" | "deny" | ya | bawaan "require" |
mode | "nalar" | "patih" | "cendikia" | ya | bawaan "patih" |
Contoh
bash
curl -X POST 'https://api.lexcetha.com/api/v1/bots/:botId/schedules' \
-H "Authorization: Bearer $LEX_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"name":"string","taskInput":"string","scheduleType":"once","scheduleValue":"string","timezone":"string","enabled":true,"misfirePolicy":"run_once","timeoutSeconds":300,"maxRetries":0,"approvalPolicy":"require","mode":"patih"}'GET /schedules/{scheduleId}
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
scheduleId (path) | string | ya |
Contoh
bash
curl -X GET 'https://api.lexcetha.com/api/v1/schedules/:scheduleId' \
-H "Authorization: Bearer $LEX_TOKEN"PATCH /schedules/{scheduleId}
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
scheduleId (path) | string | ya |
Body permintaan
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
name | string | panjang 1–120 | |
description | string | panjang 0–1000 | |
taskInput | string | panjang 1–10000 | |
scheduleType | "once" | "interval" | "cron" | ||
scheduleValue | string | panjang 1–100 | |
timezone | string | panjang 1–64 | |
enabled | boolean | bawaan true | |
misfirePolicy | "run_once" | "skip" | bawaan "run_once" | |
timeoutSeconds | integer | min 30 · maks 3600 · bawaan 300 | |
maxRetries | integer | min 0 · maks 5 · bawaan 0 | |
approvalPolicy | "require" | "deny" | bawaan "require" | |
mode | "nalar" | "patih" | "cendikia" | bawaan "patih" |
Contoh
bash
curl -X PATCH 'https://api.lexcetha.com/api/v1/schedules/:scheduleId' \
-H "Authorization: Bearer $LEX_TOKEN" \
-H 'Content-Type: application/json' \
-d '{}'DELETE /schedules/{scheduleId}
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
scheduleId (path) | string | ya |
Contoh
bash
curl -X DELETE 'https://api.lexcetha.com/api/v1/schedules/:scheduleId' \
-H "Authorization: Bearer $LEX_TOKEN"POST /schedules/{scheduleId}/pause
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
scheduleId (path) | string | ya |
Contoh
bash
curl -X POST 'https://api.lexcetha.com/api/v1/schedules/:scheduleId/pause' \
-H "Authorization: Bearer $LEX_TOKEN"POST /schedules/{scheduleId}/resume
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
scheduleId (path) | string | ya |
Contoh
bash
curl -X POST 'https://api.lexcetha.com/api/v1/schedules/:scheduleId/resume' \
-H "Authorization: Bearer $LEX_TOKEN"POST /schedules/{scheduleId}/run-now
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
scheduleId (path) | string | ya |
Contoh
bash
curl -X POST 'https://api.lexcetha.com/api/v1/schedules/:scheduleId/run-now' \
-H "Authorization: Bearer $LEX_TOKEN"POST /schedules/{scheduleId}/duplicate
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
scheduleId (path) | string | ya |
Contoh
bash
curl -X POST 'https://api.lexcetha.com/api/v1/schedules/:scheduleId/duplicate' \
-H "Authorization: Bearer $LEX_TOKEN"GET /scheduled-runs
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
scheduleId (query) | string | ||
status (query) | string |
Contoh
bash
curl -X GET 'https://api.lexcetha.com/api/v1/scheduled-runs' \
-H "Authorization: Bearer $LEX_TOKEN"GET /scheduled-runs/{runId}
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
runId (path) | string | ya |
Contoh
bash
curl -X GET 'https://api.lexcetha.com/api/v1/scheduled-runs/:runId' \
-H "Authorization: Bearer $LEX_TOKEN"POST /scheduled-runs/{runId}/retry
Parameter
| Field | Tipe | Wajib | Catatan |
|---|---|---|---|
runId (path) | string | ya |
Contoh
bash
curl -X POST 'https://api.lexcetha.com/api/v1/scheduled-runs/:runId/retry' \
-H "Authorization: Bearer $LEX_TOKEN"