Set the mission agent’s schedule
const url = 'https://beta-api.plune.ai/v1/missions/example/agent/schedule';const options = { method: 'PUT', headers: { cookie: 'plune_session=<plune_session>', 'Content-Type': 'application/json' }, body: '{"budgetUsd":2,"everyHours":24,"firstRunAt":"2026-11-14T06:00:00Z"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The mission’s id
Request Body required
Section titled “Request Body required ”object
What each run may spend on the project’s key, in USD; at most the project’s monthly AI limit
Hours from one run to the next (720: thirty days)
The first time it runs, with its offset
Example
{ "budgetUsd": 2, "everyHours": 24, "firstRunAt": "2026-11-14T06:00:00Z"}Responses
Section titled “ Responses ”The schedule, on and the caller’s
object
off: turned off by someone who may write; paused: its author left the project; a person setting it again turns it on
The person who set it: its runs act for them
The run its last time queued or resumed
What its last time did: a run queued or resumed, or why none
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
object
Example generated
{ "error": "example"}No / invalid token or session
A token (session_required), or a reader
object
Example generated
{ "error": "example"}No such mission in your project
object
Example generated
{ "error": "example"}price_unknown, ai_not_connected, ai_disabled, mission_done
object
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.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over
The platform has no AI key (platform_not_configured)
object
Example generated
{ "error": "example"}