Skip to main content
PATCH
Update an environment

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

Only the fields you send change. serverAttachmentId, skillSelection, and pluginVersionIds are three-state: omit to leave unchanged, send null to CLEAR, send a value to set. An empty array is rejected — it is not a way to clear. Send at least one field besides expectedRevision. Unknown fields are rejected.

expectedRevision
integer
required

The revision you last read. If the environment changed since, the write is rejected with 409 rather than clobbering the other edit.

Required range: x >= 0
name
string
Minimum string length: 1
description
string

Send an empty string to clear the description.

hostId
string
serverAttachmentId
string | null

null clears the pin and falls back to the host config's servers.

skillSelection
object | null

null clears the pinned skill selection.

pluginVersionIds
string[] | null

Pinned plugin VERSION IDs. Narrow by design: the plugin must be installed and enabled, the version must be ready, at most one version per plugin may be pinned, and none of its skills may carry supporting files. Not a general-purpose plugin list. null clears all pins.

Minimum array length: 1

Response

The updated environment.

A project environment: a named, live-editable execution bundle that eval suites and journeys run against.

id
string
required
projectId
string
required
name
string
required

Unique among the project's live (non-archived) environments.

hostId
string
required

The host this environment runs against.

revision
integer
required

Optimistic-concurrency counter. Pass this back as expectedRevision on the next write; if it no longer matches, the write is rejected with 409 instead of overwriting a concurrent edit.

archived
boolean
required

Archived environments cannot be edited or launched until restored.

createdAt
number
required

Unix epoch milliseconds.

updatedAt
number
required

Unix epoch milliseconds.

description
string
serverAttachmentId
string

Present only when the environment pins a standalone server group; otherwise the host config's own servers apply.

skillSelection
object

An explicit pinned skill selection. Cannot be empty — clear the field instead (send null on update) to mean "no pinned skills".

pluginVersionIds
string[]

Pinned plugin VERSION IDs. Narrow by design: the plugin must be installed and enabled, the version must be ready, at most one version per plugin may be pinned, and none of its skills may carry supporting files. Not a general-purpose plugin list.

archivedAt
number

Unix epoch milliseconds. Present only when archived.