Scheduled Debates API

Automate recurring debates on a daily, weekly, or monthly cadence.

8 min read
Share

Scheduled debates let you automate recurring debate runs on a question at a fixed cadence — daily, weekly, or monthly. The scheduler fires the debate engine at the computed UTC time and applies the same billing rules as a manually created debate.

Base URL

All endpoints below are relative to https://api.askverdict.ai. All scheduled debate endpoints require authentication via Authorization: Bearer <your_api_key>.


Endpoints

MethodPathDescription
GET/api/scheduled-debatesList your schedules (paginated)
POST/api/scheduled-debatesCreate a schedule
GET/api/scheduled-debates/:idGet a single schedule
PATCH/api/scheduled-debates/:idUpdate a schedule
DELETE/api/scheduled-debates/:idDelete a schedule

How Scheduling Works

When you create a schedule, the server computes nextRunAt — the next UTC datetime when the debate should fire based on your frequency, timeOfDay, and (for weekly/monthly) the target dayOfWeek or dayOfMonth.

The scheduler polls for due schedules, creates the debate, and immediately recomputes the next nextRunAt for the following period. Schedules with maxRuns set are automatically deactivated when the run limit is reached.

UTC-only scheduling

All times are computed in UTC. Timezone-aware scheduling (e.g. "every Monday at 9 AM EST") is planned for a future release. Set timezone to the IANA identifier you intend to use — the field is persisted but currently UTC is used for all computation.


POST /api/scheduled-debates

POST/api/scheduled-debates

Create a new schedule. The schedule is activated immediately and the first run is computed from the current time.

Request Body

NameTypeRequiredDescription
questionstringRequiredThe debate question to run on each occurrence. 10–500 characters.
frequency"daily" | "weekly" | "monthly"RequiredHow often the debate runs.
dayOfWeekinteger (0–6)OptionalRequired when frequency is "weekly". Day of week (0 = Sunday, 6 = Saturday).
dayOfMonthinteger (1–31)OptionalRequired when frequency is "monthly". Day of the month to run the debate.
timeOfDaystring (HH:MM)OptionalUTC time to run the debate. Must match HH:MM format. Default: "09:00".
timezonestringOptionalIANA timezone identifier (e.g. "America/New_York"). Reserved for future use — currently all times are UTC. Default: "UTC".
mode"fast" | "balanced" | "thorough"OptionalDebate depth for each run. Defaults to fast if not set.
contextstringOptionalBackground context injected into every scheduled debate run. Maximum 2000 characters.
maxRunsinteger (1–1000)OptionalMaximum number of times this schedule should fire before auto-deactivating. Omit for indefinite recurrence.

Example Requests

bash
# Weekly debate every Monday at 09:00 UTC
curl -X POST https://api.askverdict.ai/api/scheduled-debates \
  -H "Authorization: Bearer vrd_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "question": "What is the most critical engineering risk this week?",
    "frequency": "weekly",
    "dayOfWeek": 1,
    "timeOfDay": "09:00",
    "mode": "balanced"
  }'
 
# Daily debate, limited to 30 runs
curl -X POST https://api.askverdict.ai/api/scheduled-debates \
  -H "Authorization: Bearer vrd_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "question": "Should we deploy the pending database migration today?",
    "frequency": "daily",
    "timeOfDay": "08:00",
    "mode": "fast",
    "maxRuns": 30
  }'

Response

Frequency Rules

FrequencyRequired fieldBehaviour
dailyNoneFires every day at timeOfDay UTC
weeklydayOfWeek (0–6)Fires on the specified weekday at timeOfDay UTC
monthlydayOfMonth (1–31)Fires on the specified day of each month at timeOfDay UTC

Error Responses

StatusCodeDescription
400VALIDATION_ERRORMissing required fields, dayOfWeek absent for weekly, dayOfMonth absent for monthly, or question outside length limits
401UNAUTHORIZEDMissing or invalid API key

GET /api/scheduled-debates

GET/api/scheduled-debates

List all of your scheduled debates. Supports pagination and optional active/inactive filtering.

Query Parameters

NameTypeRequiredDescription
pageintegerOptionalPage number, 1-indexed. Default: 1.
limitintegerOptionalResults per page. Between 1 and 100. Default: 20.
active"true" | "false"OptionalFilter by active status. Omit to return all schedules.

Example Requests

bash
# All schedules
curl "https://api.askverdict.ai/api/scheduled-debates" \
  -H "Authorization: Bearer vrd_your_api_key"
 
# Only active schedules
curl "https://api.askverdict.ai/api/scheduled-debates?active=true" \
  -H "Authorization: Bearer vrd_your_api_key"

Response


GET /api/scheduled-debates/:id

GET/api/scheduled-debates/:id

Retrieve a single schedule by ID. Only accessible to the schedule owner.

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe schedule ID.

Example Request

bash
curl "https://api.askverdict.ai/api/scheduled-debates/sched_3f2a1b0c" \
  -H "Authorization: Bearer vrd_your_api_key"

Response


PATCH /api/scheduled-debates/:id

PATCH/api/scheduled-debates/:id

Update a schedule. All fields are optional — only the supplied fields are changed. If any timing fields (frequency, dayOfWeek, dayOfMonth, timeOfDay, timezone) are changed, nextRunAt is recomputed automatically.

Pause a schedule

Set active: false to pause a schedule without deleting it. Set active: true to resume it. The nextRunAt is recomputed from the current time when a paused schedule is resumed.

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe schedule ID to update.

Request Body

NameTypeRequiredDescription
questionstringOptionalUpdated debate question. 10–500 characters.
mode"fast" | "balanced" | "thorough" | nullOptionalUpdated debate mode.
contextstring | nullOptionalUpdated context. Pass null to clear it.
frequency"daily" | "weekly" | "monthly"OptionalUpdated frequency. If changing to weekly, dayOfWeek is also required.
dayOfWeekinteger (0–6) | nullOptionalUpdated day of week for weekly schedules.
dayOfMonthinteger (1–31) | nullOptionalUpdated day of month for monthly schedules.
timeOfDaystring (HH:MM)OptionalUpdated time of day in HH:MM format (UTC).
timezonestringOptionalUpdated IANA timezone identifier.
activebooleanOptionalPause (false) or resume (true) the schedule.
maxRunsinteger | nullOptionalUpdated maximum run limit. Pass null to remove the limit.

Example Requests

bash
# Pause a schedule
curl -X PATCH "https://api.askverdict.ai/api/scheduled-debates/sched_3f2a1b0c" \
  -H "Authorization: Bearer vrd_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "active": false }'
 
# Change to daily at 08:00 UTC
curl -X PATCH "https://api.askverdict.ai/api/scheduled-debates/sched_3f2a1b0c" \
  -H "Authorization: Bearer vrd_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "frequency": "daily", "timeOfDay": "08:00" }'

Response


DELETE /api/scheduled-debates/:id

DELETE/api/scheduled-debates/:id

Permanently delete a schedule. Any debates already created by past runs are not affected.

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe schedule ID to delete.

Example Request

bash
curl -X DELETE "https://api.askverdict.ai/api/scheduled-debates/sched_3f2a1b0c" \
  -H "Authorization: Bearer vrd_your_api_key"

Response

Error Responses

StatusCodeDescription
403FORBIDDENSchedule belongs to a different user
404NOT_FOUNDSchedule not found

Schedule Object Reference

FieldTypeDescription
idstringSchedule identifier
userIdstringID of the owning user
questionstringThe debate question run each cycle
mode"fast" | "balanced" | "thorough" | nullDebate mode used for each run
contextstring | nullOptional background context for debates
frequency"daily" | "weekly" | "monthly"Recurrence frequency
dayOfWeekinteger (0–6) | nullTarget weekday for weekly schedules
dayOfMonthinteger (1–31) | nullTarget day for monthly schedules
timeOfDaystring (HH:MM)UTC time of day
timezonestringIANA timezone identifier (persisted, currently UTC-only)
activebooleanWhether the schedule is currently running
maxRunsinteger | nullMaximum run cap, or null for unlimited
runCountintegerTotal number of debates created by this schedule
nextRunAtstring (ISO 8601)UTC datetime of the next scheduled run
lastRunAtstring (ISO 8601) | nullUTC datetime of the most recent run, or null if never run
createdAtstring (ISO 8601)When the schedule was created
updatedAtstring (ISO 8601)When the schedule was last updated

Was this page helpful?