---
title: "Save a new version of a Library artifact"
method: PATCH
path: "/library/artifacts/{id}/source"
---

# Save a new version of a Library artifact

`PATCH /library/artifacts/{id}/source`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/library/artifacts/{id}/source`
- Auth: HTTP bearer

Save a new version as the web editor does: `revision` (the current version; 409 when it is no longer current), `requestId`, and one of `html`, `text`, `docx` (base64) or `restoreRevision`.

## Path parameters

- `id` string, required

## Request body

- object
  - `revision` integer, required
  - `requestId` string, required
  - `html` string
  - `text` string
  - `docx` string
  - `restoreRevision` integer

## Response `200`

OK

- object

## Other responses

- `400`: Error — { error: { code, message } }
- `401`: Error — { error: { code, message } }
- `403`: Error — { error: { code, message } }
- `404`: Error — { error: { code, message } }
- `409`: Error — { error: { code, message } }
- `413`: Error — { error: { code, message } }
- `default`: Error — { error: { code, message, request_id } }

## Changes

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

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/library/artifacts/:id/source/patch.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)
