This commit is contained in:
seb
2026-10-17 02:59:35 +02:00
parent fd21cb7319
commit c61df92d63
13 changed files with 3214 additions and 2198 deletions

View File

@@ -0,0 +1,68 @@
# `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`._