Scheduling

Create scheduled task

Create a task that runs automatically at a cron schedule. Use run_once=true for one-time actions (e.g. publish a page at a specific date/time). Supports publish_page, unpublish_page, and webhook actions.

post/aapi/project/{projectId}/tasks

Request

  • Base URL: https://api.websitepublisher.ai
  • URL: https://api.websitepublisher.ai/aapi/project/{projectId}/tasks
  • Auth: OAuth 2 (authorization code, authorization URL https://api.websitepublisher.ai/dapi/oauth/authorize, token URL https://api.websitepublisher.ai/dapi/oauth/token, scopes: read, write)

Path parameters

projectIdinteger required

Request body

namestring required

Human-readable task name

action_type'publish_page' | 'unpublish_page' | 'webhook' required

Action type. publish/unpublish require page_id in payload. webhook requires url in payload.

action_payloadobject required

Action parameters. publish_page/unpublish_page: {"page_id": 123}. webhook: {"url": "https://...", "body": {}}

schedulestring required

Cron expression (e.g. "0 9 * * 1" = Monday 9am)

timezonestring

Timezone (default: Europe/Amsterdam)

run_onceboolean

Run once at next matching time then deactivate (default: false)

Example request

{
  "name": "Publish blog post Monday 9am",
  "schedule": "0 9 * * 1",
  "timezone": "Europe/Amsterdam"
}

Response

Scheduled task created

Changes

No recorded changes to this operation across all 1 revision of this API.