---
title: "Create a swarm"
method: POST
path: "/projects/{projectId}/swarms"
tags: ["Swarms"]
---

# Create a swarm

`POST /projects/{projectId}/swarms`

A swarm is an authoring container holding DEFAULTS for the journeys made under it. Creating one starts nothing.

## Headers

- `Idempotency-Key` string

## Request body

- SwarmCreateRequest
  - `name` string, required
  - `description` string
  - `environmentIds` string[]
  - `sessionsPerTarget` integer, required
  - `maxTurns` integer, required

## Response `201`

The created swarm.

- Swarm — An authoring container for journeys. It holds DEFAULTS, not execution state — launching happens per journey.
  - `id` string, required
  - `projectId` string, required
  - `name` string, required
  - `description` string, nullable, required
  - `environmentIds` string[], required — Default fan-out for journeys authored under this container.
  - `sessionsPerTarget` integer, nullable, required
  - `maxTurns` integer, nullable, required
  - `createdAt` number, required — Epoch milliseconds.
  - `updatedAt` number, required — Epoch milliseconds.

## Other responses

- `400` — Malformed body or parameters.
- `401` — Missing, invalid, revoked, or orphaned key (`UNAUTHORIZED`) — or the **target MCP server** needs an OAuth grant (`OAUTH_REQUIRED`), which is a property of the server, not your key.
- `403` — Key is valid but not allowed to do this.
- `404` — Unknown project, server, or resource.
- `409` — The resource is not in a state that accepts this write — a stale `expectedRevision`, a duplicate name, or an environment that cannot currently be launched. The request was well-formed; re-read the resource and retry.
- `429` — Per-key rate limit exceeded (60 requests/minute sustained, bursts up to 10). Honor `Retry-After` and back off with jitter.
- `500` — Something failed on MCPJam's side.

---

[API](https://skmtc.net/mcpjam/apis/mcpjam-api.md) · [All operations](https://skmtc.net/mcpjam/apis/mcpjam-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mcpjam/mcpjam-api/revisions/7d1aff84ce3b/schema)
