Skip to main content
POST
Launch a swarm run

Authorizations

Authorization
string
header
required

MCPJam API key (sk_…). Create one at Settings → API keys. Guest sessions cannot use the API, and API keys cannot manage other API keys.

Headers

Idempotency-Key
string

Send one. The same key answers with the same launch rather than starting a second, and resumes it once it was stopped or interrupted. It wins over idempotencyKey in the body. The same key with a different request answers 409.

With no key at all, every call starts a new swarm run.

Required string length: 1 - 200

Path Parameters

projectId
string
required

ID of the hosted project that contains the server.

Body

application/json

What to launch: exactly one of swarmRun, swarm or goals.

What to launch: exactly one of swarmRun, swarm or goals.

swarmRun
string

Launch this swarm run's goals again: its swarmRunId.

swarm
string

Launch this swarm's goals: those of its latest swarm run, or its goals if it has never run.

goals
object[]

Launch exactly these goals. With swarm, they launch for that swarm. Not with swarmRun or goalIds.

Required array length: 1 - 100 elements
goalIds
string[]

Launch only these goals of the swarm run or swarm.

Required array length: 1 - 100 elements
iterations
integer

Sessions per target for every goal that sets none of its own.

Required range: 1 <= x <= 5
environmentIds
string[]

Environments every goal that sets none of its own runs against, instead of its own targets.

Maximum array length: 10
expectedSponsored
integer

How many conversations you expect to be sponsored (paid from MCPJam's allowance instead of your organization's credits). The launch answers 409 with details.code: "swarm_funding_changed", starting nothing, when fewer would be.

Required range: x >= 0
idempotencyKey
string

The Idempotency-Key header, in the body. The header wins when both are sent.

Required string length: 1 - 200

Response

The launch is under way: its first goal started.

A launch under way, or answered from its record.

swarmRunId
string
required
launch
object
required

The launch that started a swarm run, goal by goal.

plan
object

What was planned. Absent on a replay or a resume, which plan nothing.

funding
object

How the launch's sessions are funded, when the preview could say.