Skip to content

Set the mission agent’s schedule

PUT
/v1/missions/{id}/agent/schedule
curl --request PUT \
--url https://beta-api.plune.ai/v1/missions/example/agent/schedule \
--header 'Content-Type: application/json' \
--cookie plune_session=<plune_session> \
--data '{ "budgetUsd": 2, "everyHours": 24, "firstRunAt": "2026-11-14T06:00:00Z" }'

A person sets when the built-in agent runs the mission: first at firstRunAt, then every everyHours, each run with budgetUsd of its own, held within the project’s monthly AI limit (400 budget_over_cap). Its runs act for that person, as their own start would, and every time it runs is an entry in the mission’s journal naming them. A person in a session only (403 session_required for a token); setting it again makes it theirs and turns an off or a paused one on. When its author leaves the project it is paused (author_left), so the agent never spends for a former member. 409 price_unknown, ai_not_connected, ai_disabled, mission_done. Ten a minute.

id
required
string

The mission’s id

Media type application/json
object
budgetUsd
required

What each run may spend on the project’s key, in USD; at most the project’s monthly AI limit

number
> 0 <= 1000000
everyHours
required

Hours from one run to the next (720: thirty days)

integer
>= 1 <= 720
firstRunAt
required

The first time it runs, with its offset

string format: date-time
Example
{
"budgetUsd": 2,
"everyHours": 24,
"firstRunAt": "2026-11-14T06:00:00Z"
}

The schedule, on and the caller’s

Media type application/json
object
id
required
string
missionId
required
string
state
required

off: turned off by someone who may write; paused: its author left the project; a person setting it again turns it on

string
Allowed values: on off paused
pauseReason
string
Allowed values: author_left
budgetUsd
required
number
everyHours
required
integer
nextRunAt
required
string format: date-time
createdBy
required

The person who set it: its runs act for them

string
lastFiredAt
required
string format: date-time
nullable
lastRunId
required

The run its last time queued or resumed

string
nullable
lastOutcome
required

What its last time did: a run queued or resumed, or why none

string
nullable
Allowed values: queued resumed running mission_done budget_too_low
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{
"id": "6c1d8e2a-3b4f-4a7e-8d21-5f9b0c3e7a42",
"missionId": "6f1c2b3a-0000-4000-8000-000000002188",
"state": "on",
"budgetUsd": 2,
"everyHours": 24,
"nextRunAt": "2026-11-14T06:00:00.000Z",
"createdBy": "6f1c2b3a-0000-4000-8000-0000000000a2",
"lastFiredAt": null,
"lastRunId": null,
"lastOutcome": null,
"createdAt": "2026-11-13T09:00:00.000Z",
"updatedAt": "2026-11-13T09:00:00.000Z"
}

Invalid JSON or schedule; budget_over_cap

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

No / invalid token or session

A token (session_required), or a reader

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

No such mission in your project

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

price_unknown, ai_not_connected, ai_disabled, mission_done

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}
Retry-After
integer

Seconds until the window rolls over

The platform has no AI key (platform_not_configured)

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}