Schedules
Run bots on a schedule and inspect scheduled runs. 14 endpoints
GET /schedules
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
botId (query) | string | ||
enabled (query) | string | ||
scope (query) | string |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/schedules' \
-H "Authorization: Bearer $LEX_TOKEN"GET /schedules/calendar
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
from (query) | string | ||
to (query) | string |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/schedules/calendar' \
-H "Authorization: Bearer $LEX_TOKEN"GET /bots/{botId}/schedules
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
botId (path) | string | yes |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/bots/:botId/schedules' \
-H "Authorization: Bearer $LEX_TOKEN"POST /bots/{botId}/schedules
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
botId (path) | string | yes |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | yes | length 1–120 |
description | string | length 0–1000 | |
taskInput | string | yes | length 1–10000 |
scheduleType | "once" | "interval" | "cron" | yes | |
scheduleValue | string | yes | length 1–100 |
timezone | string | yes | length 1–64 |
enabled | boolean | yes | default true |
misfirePolicy | "run_once" | "skip" | yes | default "run_once" |
timeoutSeconds | integer | yes | min 30 · max 3600 · default 300 |
maxRetries | integer | yes | min 0 · max 5 · default 0 |
approvalPolicy | "require" | "deny" | yes | default "require" |
mode | "nalar" | "patih" | "cendikia" | yes | default "patih" |
Example
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}
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
scheduleId (path) | string | yes |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/schedules/:scheduleId' \
-H "Authorization: Bearer $LEX_TOKEN"PATCH /schedules/{scheduleId}
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
scheduleId (path) | string | yes |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | length 1–120 | |
description | string | length 0–1000 | |
taskInput | string | length 1–10000 | |
scheduleType | "once" | "interval" | "cron" | ||
scheduleValue | string | length 1–100 | |
timezone | string | length 1–64 | |
enabled | boolean | default true | |
misfirePolicy | "run_once" | "skip" | default "run_once" | |
timeoutSeconds | integer | min 30 · max 3600 · default 300 | |
maxRetries | integer | min 0 · max 5 · default 0 | |
approvalPolicy | "require" | "deny" | default "require" | |
mode | "nalar" | "patih" | "cendikia" | default "patih" |
Example
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}
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
scheduleId (path) | string | yes |
Example
bash
curl -X DELETE 'https://api.lexcetha.com/api/v1/schedules/:scheduleId' \
-H "Authorization: Bearer $LEX_TOKEN"POST /schedules/{scheduleId}/pause
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
scheduleId (path) | string | yes |
Example
bash
curl -X POST 'https://api.lexcetha.com/api/v1/schedules/:scheduleId/pause' \
-H "Authorization: Bearer $LEX_TOKEN"POST /schedules/{scheduleId}/resume
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
scheduleId (path) | string | yes |
Example
bash
curl -X POST 'https://api.lexcetha.com/api/v1/schedules/:scheduleId/resume' \
-H "Authorization: Bearer $LEX_TOKEN"POST /schedules/{scheduleId}/run-now
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
scheduleId (path) | string | yes |
Example
bash
curl -X POST 'https://api.lexcetha.com/api/v1/schedules/:scheduleId/run-now' \
-H "Authorization: Bearer $LEX_TOKEN"POST /schedules/{scheduleId}/duplicate
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
scheduleId (path) | string | yes |
Example
bash
curl -X POST 'https://api.lexcetha.com/api/v1/schedules/:scheduleId/duplicate' \
-H "Authorization: Bearer $LEX_TOKEN"GET /scheduled-runs
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
scheduleId (query) | string | ||
status (query) | string |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/scheduled-runs' \
-H "Authorization: Bearer $LEX_TOKEN"GET /scheduled-runs/{runId}
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
runId (path) | string | yes |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/scheduled-runs/:runId' \
-H "Authorization: Bearer $LEX_TOKEN"POST /scheduled-runs/{runId}/retry
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
runId (path) | string | yes |
Example
bash
curl -X POST 'https://api.lexcetha.com/api/v1/scheduled-runs/:runId/retry' \
-H "Authorization: Bearer $LEX_TOKEN"