---
title: "Update a journey"
method: PATCH
path: "/projects/{projectId}/journeys/{journeyId}"
tags: ["Swarms"]
---

# Update a journey

`PATCH /projects/{projectId}/journeys/{journeyId}`

Editing a journey never disturbs a run already under way: a run pins its own immutable snapshot of the definition at launch.

## Request body

- JourneyUpdateRequest — PATCH with a TRI-STATE, and the third state is the point: a field absent leaves it alone, present sets it, and `null` CLEARS it. There is no other way to say "stop fanning this journey out across environments and go back to its host targets". `sessionsPerTarget` and `maxTurns` must be sent TOGETHER — they are one config object upstream, so a partial update would need a read-modify-write that could silently clobber a concurrent edit. Requiring both is a 400 you can fix rather than a lost update you never see.
  - `name` string
  - `goal` string
  - `environmentIds` string[], nullable — A non-empty list to set, or `null` to clear and fall back to host targets.
  - `serverAttachmentId` string, nullable — `null` clears the attachment.
  - `hostIds` string[]
  - `sessionsPerTarget` integer
  - `maxTurns` integer

## Response `200`

The updated journey.

- Journey — A persona's task: what they are trying to accomplish, and across which targets. Launching one is `POST /projects/{projectId}/journeys/{journeyId}/runs`.
  - `id` string, required
  - `projectId` string, required
  - `name` string, required
  - `goal` string, required — What the persona is trying to accomplish. This drives the whole run.
  - `personaId` string, required
  - `swarmId` string, nullable, required — The swarm container this journey was authored under. Provenance only — nothing resolves through it at run time, and a journey created outside a swarm has none.
  - `environmentIds` string[], required — Environments this journey fans out across. EMPTY on a host-pinned journey — that is a different execution model, not a journey with no targets.
  - `serverAttachmentId` string — Legacy host-pinned grounding. Absent on an environment-based journey.
  - `sessionsPerTarget` integer, nullable, required — Sessions run against EACH target. Total sessions = targets × this.
  - `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.
- `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/d3adfe49fbbf/schema)
