Skip to main content
PUT
Publish an environment for user testing

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.

Path Parameters

projectId
string
required

ID of the hosted project that contains the server.

environmentId
string
required

Project environment ID, as returned by the project's environment list.

Body

application/json

Optional create-time overrides. A bodyless publish is the common case.

Optional CREATE-TIME overrides, applied in the same call so the scenario is never briefly live in a wider mode than you asked for. Ignored on a republish — see overridesIgnored.

name
string
Maximum string length: 200
description
string
Maximum string length: 2000
mode
enum<string>

Who may open the share link:

  • project_members — signed-in members of the project only
  • invited_only — named members, invited individually
  • anyone_with_linkanyone holding the URL, signed in or not
Available options:
project_members,
invited_only,
anyone_with_link

Response

The scenario, new or existing.

A published environment: what a visitor lands on when you share a link.

id
string
required
environmentId
string
required
name
string
required
mode
enum<string>
required

Who may open the share link:

  • project_members — signed-in members of the project only
  • invited_only — named members, invited individually
  • anyone_with_linkanyone holding the URL, signed in or not
Available options:
project_members,
invited_only,
anyone_with_link
accessVersion
integer
required

Bumped whenever access NARROWS — a mode change, or a member removal. Sessions minted under an older version stop working, which is what makes those changes take effect at once rather than at expiry. A link ROTATION is deliberately not one of them: it mints a new URL without bumping this, so anyone who already redeemed the old link keeps working. Rotating is half of closing a leak — see the rotate-link operation.

The share link. null when the scenario has no link token.

created
boolean

False when the environment was ALREADY published and this returned the existing scenario. Publishing is idempotent, so this is how you tell "I published it" from "it was already there" without a preflight read.

overridesIgnored
boolean

True when the create-time overrides (name, description, mode) were NOT applied because the environment was already published. Paired with created: false — change an existing scenario with PATCH .../user-testing/scenarios/{scenarioId}.