tasks/create
POST
/scheduled-agentsCreate a Task. Requires editor access and the configuration:write permission.
Request
cURL
curl -X POST "https://provisioning.cloudx.io/api/v1/scheduled-agents" \
-H "Authorization: Bearer $CLOUDX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"<string>","prompt":"<string>","schedule":"0 9 * * 1","timezone":"Europe/Madrid","enabled":true,"access_mode":"private"}'Body
| Field | Type | Description |
|---|---|---|
name | string | Optional name. CloudX derives one from the prompt when omitted. |
promptrequired | string | |
schedulerequired | string | Five-field cron expression in the supplied timezone. |
timezone | string | IANA timezone for the schedule. |
enabled | boolean | |
access_mode | object |
Responses
Created Task.
{
"id": "<string>",
"domain": "buying",
"name": "<string>",
"prompt": "<string>",
"template_id": "<string>",
"cron_expression": "<string>",
"timezone": "<string>",
"schedule_description": "<string>",
"enabled": true,
"creation_origin": "web_app",
"access_mode": "private",
"creator_user_id": "<string>",
"next_run_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}200Created Task.
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable Task ID. |
domainrequired | string | Side of the platform the Task works for. |
namerequired | string | |
promptrequired | string | Prompt that the Task runs on its schedule. |
template_id | string | Template used to create the Task, when applicable. |
cron_expressionrequired | string | Five-field cron expression in the Task timezone. |
timezonerequired | string | IANA timezone for the cron expression. |
schedule_descriptionrequired | string | Human-readable schedule. |
enabledrequired | boolean | |
creation_originrequired | string | Surface that created the Task. |
access_moderequired | object | |
creator_user_id | string | User who created the Task. Omitted for API and internal Tasks. |
next_run_atrequired | string<date-time> | |
created_atrequired | string<date-time> | |
updated_atrequired | string<date-time> |
400Invalid Task input.
| Field | Type | Description |
|---|---|---|
errorrequired | string |
401Unauthorized.
| Field | Type | Description |
|---|---|---|
errorrequired | string |
403Forbidden or feature unavailable.
| Field | Type | Description |
|---|---|---|
errorrequired | string |
409Task limit reached.
| Field | Type | Description |
|---|---|---|
errorrequired | string |
500Internal server error.
| Field | Type | Description |
|---|---|---|
errorrequired | string |