Schedules
Create and manage cron-style scheduled scraping jobs.
GET
/api/v1/workspaces/{workspace_id}/schedulesList Schedules
Get all scheduled scraping jobs for the workspace.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| workspace_id | uuid | Required | Workspace ID |
Code Examples
bash
curl https://api.sentrasa.com/api/v1/workspaces/{workspace_id}/schedules \
-H "X-API-Key: rp_your_api_key"Response
200List of schedulesjson
[
{
"id": "sched_550e8400-e29b-41d4-a716-446655440000",
"workspace_id": "ws_550e8400-e29b-41d4-a716-446655440000",
"target": "technology",
"target_type": "subreddit",
"mode": "history",
"config": {},
"cron_expression": "0 */6 * * *",
"is_active": true,
"last_run_at": "2026-03-20T12:00:00Z",
"next_run_at": "2026-03-20T18:00:00Z",
"run_count": 45,
"created_at": "2026-02-01T09:00:00Z"
}
]POST
/api/v1/workspaces/{workspace_id}/schedulesCreate Schedule
Create a new scheduled scraping job with a cron expression.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| workspace_id | uuid | Required | Workspace ID |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| target | string | Required | Subreddit name or username |
| target_type | string | Default: subreddit | subreddit or user |
| mode | string | Default: history | full, history, or monitor |
| cron_expression | string | Required | Cron expression (e.g. '0 */6 * * *' for every 6 hours) |
| config | object | Optional | Additional configuration |
json
{
"target": "technology",
"target_type": "subreddit",
"mode": "history",
"cron_expression": "0 */6 * * *"
}Code Examples
bash
curl -X POST https://api.sentrasa.com/api/v1/workspaces/{workspace_id}/schedules \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"target": "technology",
"target_type": "subreddit",
"mode": "history",
"cron_expression": "0 */6 * * *"
}'Response
201Schedule createdjson
{
"id": "sched_661e9400-f39c-52e5-b827-557766551111",
"workspace_id": "ws_550e8400-e29b-41d4-a716-446655440000",
"target": "technology",
"target_type": "subreddit",
"mode": "history",
"config": {},
"cron_expression": "0 */6 * * *",
"is_active": true,
"last_run_at": null,
"next_run_at": "2026-03-20T18:00:00Z",
"run_count": 0,
"created_at": "2026-03-20T14:00:00Z"
}PATCH
/api/v1/workspaces/{workspace_id}/schedules/{schedule_id}Update Schedule
Update a schedule's cron expression, mode, or active status.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| workspace_id | uuid | Required | Workspace ID |
| schedule_id | uuid | Required | Schedule ID |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| is_active | boolean | Optional | Enable or disable the schedule |
| cron_expression | string | Optional | New cron expression |
| mode | string | Optional | New scrape mode |
| config | object | Optional | Updated configuration |
json
{
"is_active": false
}Code Examples
bash
curl -X PATCH https://api.sentrasa.com/api/v1/workspaces/{workspace_id}/schedules/{schedule_id} \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"is_active": false}'Response
200Schedule updatedjson
{
"id": "sched_550e8400-e29b-41d4-a716-446655440000",
"target": "technology",
"is_active": false,
"cron_expression": "0 */6 * * *",
"run_count": 45
}DELETE
/api/v1/workspaces/{workspace_id}/schedules/{schedule_id}Delete Schedule
Permanently delete a scheduled scraping job.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| workspace_id | uuid | Required | Workspace ID |
| schedule_id | uuid | Required | Schedule ID |
Code Examples
bash
curl -X DELETE https://api.sentrasa.com/api/v1/workspaces/{workspace_id}/schedules/{schedule_id} \
-H "X-API-Key: rp_your_api_key"Response
200Schedule deletedjson
{
"message": "Schedule deleted successfully"
}