---
title: "Replace an artifact's source"
method: PUT
path: "/v1/mcp-apps/{appId}"
tags: ["Artifacts"]
---

# Replace an artifact's source

`PUT /v1/mcp-apps/{appId}`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/v1/mcp-apps/{appId}`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Compiles React source and publishes it as the next revision of an artifact, exactly as update_app does for an agent. The artifact keeps its tools, saved data and public link. Requires the artifactsCli feature, editor access to the artifact, and the revision the caller last saw.

## Path parameters

- `appId` string, required

## Request body

- McpAppDeployReplaceRequest
  - `title` string, required
  - `description` string
  - `textFallback` string, required
  - `reactSource` string, required
  - `cssSource` string
  - `expectedRevisionId` string, required

## Response `200`

The published revision.

- McpAppDeployResponse
  - `appId` string, required
  - `pluginId` string, required
  - `revisionId` string, required
  - `title` string, required
  - `description` string, nullable, required
  - `textFallback` string, required
  - `toolName` 'open_app', required
  - `resourceUri` string, required
  - `serverPath` string, required
  - `tools` object[], required
    - `name` string, required
    - `description` string, required
    - `capability` string, required
    - `mode` 'input' | 'live', required
    - `readOnly` boolean, required
    - `loadOnOpen` boolean

## Other responses

- `400`: The request was not a complete artifact.
- `401`: The caller must be signed in.
- `403`: The caller may not create a Plugin, or may not edit this artifact.
- `404`: Deploying from the command line is off, artifacts are off on this deployment, or the artifact is unavailable.
- `409`: A Plugin already has this name, or the artifact changed since it was read.
- `413`: The artifact is too large.
- `422`: The source did not compile.

## Changes

- **2026-12-01** `92c81f5a4580`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/mcp-apps/:appId/put.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) - [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openworklabs/apis/den-api/revisions/84fb0f99fb95?raw)
