Skip to main content

Scheduled Tasks

Scheduled tasks allow you to automate actions at specific times or intervals. Tasks can be paused, resumed, and managed programmatically.

List Scheduled Tasks

GET /scheduled-tasks

Returns a list of all scheduled tasks in your workspace.

Query Parameters

number
Page number for pagination
number
Number of items per page

Create Scheduled Task

POST /scheduled-tasks

Creates a new scheduled task.

Request Body

string
required
Task name
string
required
ISO timestamp when the task should execute
string
required
Type of task to execute
object
required
Task-specific payload data

Get Scheduled Task

GET /scheduled-tasks/:task_id

Returns detailed information about a specific scheduled task.
:task_id
string
required
Task unique identifier

Delete Scheduled Task

DELETE /scheduled-tasks/:task_id

Deletes a scheduled task.
:task_id
string
required
Task unique identifier

Pause Scheduled Task

PATCH /scheduled-tasks/:task_id/pause

Pauses a scheduled task, preventing it from executing until resumed.
:task_id
string
required
Task unique identifier

Resume Scheduled Task

PATCH /scheduled-tasks/:task_id/resume

Resumes a paused scheduled task.
:task_id
string
required
Task unique identifier

Examples

Create Scheduled Task

curl -X POST https://api.plati.ai/scheduled-tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Send Daily Report",
    "scheduled_at": "2024-01-20T09:00:00Z",
    "task_type": "send_message",
    "payload": {
      "identity_id": "user_12345",
      "channel_id": "channel_abc",
      "message": "Your daily report is ready!"
    }
  }'

Pause Task

curl -X PATCH https://api.plati.ai/scheduled-tasks/task_123/pause \
  -H "Authorization: Bearer YOUR_API_KEY"

Resume Task

curl -X PATCH https://api.plati.ai/scheduled-tasks/task_123/resume \
  -H "Authorization: Bearer YOUR_API_KEY"

Next Steps