Skip to main content
POST
/
scheduled-tasks
/
manage
Create a scheduled task
curl --request POST \
  --url https://asteragents.com/api/scheduled-tasks/manage \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Weekly portfolio digest",
  "prompt": "Summarize any new documents added this week.",
  "schedule": "0 13 * * 1",
  "agentId": 123,
  "description": "<string>",
  "enabled": true
}
'
{
  "id": 42,
  "name": "Weekly portfolio digest",
  "description": "<string>",
  "prompt": "Summarize any new documents added this week.",
  "schedule": "0 13 * * 1",
  "enabled": true,
  "agentId": 123,
  "agentName": "Portfolio Monitor",
  "userId": "<string>",
  "lastRunAt": "2023-11-07T05:31:56Z",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

JWT token from Clerk authentication.

Must be from a user with org:admin role.

Body

application/json
name
string
required
Maximum string length: 100
Example:

"Weekly portfolio digest"

prompt
string
required

The message sent to the agent on each run.

Example:

"Summarize any new documents added this week."

schedule
string
required

Cron expression (UTC).

Example:

"0 13 * * 1"

agentId
integer
required
Example:

123

description
string | null
enabled
boolean
default:true

Response

Task created.

id
integer
Example:

42

name
string
Example:

"Weekly portfolio digest"

description
string | null
prompt
string
Example:

"Summarize any new documents added this week."

schedule
string

Cron expression (UTC).

Example:

"0 13 * * 1"

enabled
boolean
agentId
integer
Example:

123

agentName
string

Present on list/get responses.

Example:

"Portfolio Monitor"

userId
string
lastRunAt
string<date-time> | null
createdAt
string<date-time>
updatedAt
string<date-time>