---
title: "Save or restore one design-system file [write]"
method: PUT
path: "/artifacts/{id}/design-system/files/{path}"
tags: ["artifacts"]
---

# Save or restore one design-system file \[write\]

`PUT /artifacts/{id}/design-system/files/{path}`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/artifacts/{id}/design-system/files/{path}`
- Auth: HTTP bearer

Saves one of the system's `editable_files` (path relative to `root`, such as `project/README.md`) as the system's next version: `content` replaces it, or `restore_version` puts back the file as it was in that version. tokens.json is saved as tokens are, recompiling tokens.css. Sets the index's lastChange. 409 `conflict` when `base_version` is not the current version; 400 on a read-only system or a file that is not editable; 404 when the file is not in the system or in the restored version.

## Path parameters

- `id` string, required
- `path` string, required

## Request body

- object
  - `base_version` integer, required
  - `content` string: The file's new text; send this or restore_version
  - `restore_version` integer: An earlier version whose copy of the file becomes the next version
  - `note` string

## Response `200`

OK

- object
  - `artifact` Artifact, required
    - `id` string, required
    - `task_id` string, required: The task it belongs to (sess_…)
    - `name` string, required: Unique within the task; publishing under the same name adds a version
    - `kind` 'design_system' | 'null', nullable, required: design_system when the current revision holds project/design-system.json; null otherwise
    - `version` integer, required: The current revision
    - `entry` string, required: The file opened first
    - `files` object[], required
      - `path` string, required
      - `sha256` string, required
      - `size_bytes` integer, required
    - `share_url` string, nullable, required: The public link, or null while not shared
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `default`: Error — { error: { code, message } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/artifacts/:id/design-system/files/:path/put.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/8280a065ef6a?raw)
