---
title: "Update a computer environment"
method: PATCH
path: "/projects/{projectId}/computer-environments/{environmentId}"
tags: ["Computer environments"]
---

# Update a computer environment

`PATCH /projects/{projectId}/computer-environments/{environmentId}`

Edit an environment's name and/or Dockerfile. Re-build it for the changes to take effect on a computer. Guest callers are denied (a write).

## Path parameters

- `projectId` string, required
- `environmentId` string, required

## Request body

- union — Edit an environment. Provide at least one of `name` or `dockerfile`; only the fields you pass change.
  - object
    - `name` string, required — New display name; must be non-empty after trimming.
    - `dockerfile` string — Replacement Dockerfile text.
  - object
    - `name` string — New display name; must be non-empty after trimming.
    - `dockerfile` string, required — Replacement Dockerfile text.

## Response `200`

The updated environment.

- ComputerEnvironment — A project's custom Computer image: a digest-pinned Dockerfile plus its latest build.
  - `id` string, required
  - `projectId` string, required
  - `name` string, required
  - `dockerfile` string, required
  - `contentHash` string, required
  - `sharing` 'user' | 'project', required — `user` = a personal draft; `project` = shared with the whole project.
  - `isOwner` boolean, required
  - `currentBuild` ComputerEnvironmentBuild, required — One build of an environment's image.
    - `id` string, required
    - `status` 'queued' | 'building' | 'ready' | 'failed', required
    - `provider` 'e2b' | 'stub', required
    - `e2bBuildId` string
    - `baseImageDigests` string[], required — Resolved sha256 digest of every FROM base (the reproducibility pin).
    - `logPreview` string — Capped, ANSI-stripped tail of the build log.
    - `error` string
    - `createdAt` number, required
    - `startedAt` number
    - `finishedAt` number
  - `createdAt` number, required
  - `updatedAt` number, required

## 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.
- `502` — Could not connect to the target MCP server.

## Changes

- **2026-06-27** `249bf9dfa099` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/mcpjam/apis/mcpjam-api/changes/projects/:projectId/computer-environments/:environmentId/patch.md)

---

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