API Documentation
Dashboard

Schedules

Create and manage cron-style scheduled scraping jobs.

GET/api/v1/workspaces/{workspace_id}/schedules

List Schedules

Get all scheduled scraping jobs for the workspace.

Path Parameters

NameTypeRequiredDescription
workspace_iduuidRequiredWorkspace 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 schedules
json
[
  {
    "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}/schedules

Create Schedule

Create a new scheduled scraping job with a cron expression.

Path Parameters

NameTypeRequiredDescription
workspace_iduuidRequiredWorkspace ID

Request Body

NameTypeRequiredDescription
targetstringRequiredSubreddit name or username
target_typestringDefault: subredditsubreddit or user
modestringDefault: historyfull, history, or monitor
cron_expressionstringRequiredCron expression (e.g. '0 */6 * * *' for every 6 hours)
configobjectOptionalAdditional 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 created
json
{
  "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

NameTypeRequiredDescription
workspace_iduuidRequiredWorkspace ID
schedule_iduuidRequiredSchedule ID

Request Body

NameTypeRequiredDescription
is_activebooleanOptionalEnable or disable the schedule
cron_expressionstringOptionalNew cron expression
modestringOptionalNew scrape mode
configobjectOptionalUpdated 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 updated
json
{
  "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

NameTypeRequiredDescription
workspace_iduuidRequiredWorkspace ID
schedule_iduuidRequiredSchedule 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 deleted
json
{
  "message": "Schedule deleted successfully"
}