Files
dashback/docs/api/routes/subagentschedule.post.md
2026-10-17 02:59:35 +02:00

69 lines
1.4 KiB
Markdown

# `POST /subagentschedule`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Create subagent schedule
Creates a new scheduled subagent execution for the selected company.
`cron` must be a valid 5-part cron timetable expression (e.g. "0 9 * * 1-5").
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `prompt` | yes | string | |
| `cron` | yes | string | |
| `desc` | no | string | |
| `skills` | no | string | |
| `lastagentnote` | no | string | |
| `max_itr` | no | integer | |
```json
{
"prompt": "…",
"cron": "…",
"desc": "…",
"skills": "…",
"lastagentnote": "…",
"max_itr": 1
}
```
## Signals
On success, emits SSE signal: `subagentschedule` (see [`GET /events`](../events.md)).
## Response `201`
Created subagent schedule
```json
{
"schedule": {
"id": 1,
"company_id": 1,
"desc": "…",
"prompt": "…",
"skills": "…",
"lastagentnote": "…",
"max_itr": 1,
"cron": "…",
"created_at": "…",
"lastrun_at": "…"
}
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid input, missing prompt, or invalid cron expression — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._