Swarms

Create a journey

Creates one goal: a persona pursuing a task against one or more environments. To draft several with a model first, use POST /projects/{projectId}/goals/generate — that route persists nothing.

personaId and swarmId must belong to THIS project. Naming one from another project is a 404, not a silent cross-project reference.

Creating a goal does not run it. Launch it with POST /projects/{projectId}/goals/{goalId}/runs.

post/projects/{projectId}/goals

Headers

Idempotency-Keystring

Retry-safe create key. Replaying the SAME key with the SAME body returns the original resource instead of creating a second one; reusing it with a DIFFERENT body is a 409.

Request body

namestring
goalstring required

1–4000 characters.

personaIdstring required

An existing persona in this project.

swarmIdstring

Authoring provenance only — which swarm container this was made in.

environmentIdsstring[]

The environments to fan out across. NON-EMPTY when present: [] reads as "these, naming none", and would silently fall back to something else.

serverAttachmentIdstring

Legacy host-pinned grounding.

hostIdsstring[]
iterationsinteger required
maxTurnsinteger required

Response

The created goal.

idstring required
projectIdstring required
namestring required
goalstring required

What the persona is trying to accomplish. This drives the whole run.

personaIdstring required
swarmIdstring nullable required

The swarm container this goal was authored under. Provenance only — nothing resolves through it at run time, and a goal created outside a swarm has none.

environmentIdsstring[] required

Environments this goal fans out across. EMPTY on a host-pinned goal — that is a different execution model, not a goal with no targets.

serverAttachmentIdstring

Legacy host-pinned grounding. Absent on an environment-based goal.

iterationsinteger nullable required

Sessions run against EACH target. Total sessions = targets × this.

maxTurnsinteger nullable required
setupWritesboolean

Whether prerequisite setup may create or modify workspace data before sessions run. Defaults to false.

createdAtnumber required

Epoch milliseconds.

updatedAtnumber required

Epoch milliseconds.

Changes