Skip to main content
PATCH
/
v3
/
designs
/
{editorId}
/
artifacts
/
{artifactId}
/
files
Write artifact files
curl --request PATCH \
  --url https://api.magicpatterns.com/api/v3/designs/{editorId}/artifacts/{artifactId}/files \
  --header 'Content-Type: application/json' \
  --header 'x-mp-api-key: <api-key>' \
  --data '
{
  "files": [
    {
      "fileName": "App.tsx",
      "code": "<string>"
    }
  ]
}
'
{
  "files": [
    "App.tsx",
    "index.tsx",
    "index.css"
  ]
}

Documentation Index

Fetch the complete documentation index at: https://magicpatterns.mintlify.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-mp-api-key
string
header
required

Magic Patterns API key. The same key authenticates v3 REST and the MCP server. Create one at https://www.magicpatterns.com/settings/api-keys.

Path Parameters

editorId
string
required

The design's editor ID.

Example:

"abc123"

artifactId
string
required

The artifact ID.

Body

application/json
files
object[]
required
Minimum array length: 1

Response

Updated. Response lists all file names in the artifact after the write.

files
string[]
Example:
["App.tsx", "index.tsx", "index.css"]