Skip to content

Edit artifact files

POST
/v1/artifacts/{id}/edits
curl --request POST \
--url https://shareout.site/v1/artifacts/example/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "base_version": 3, "message": "Blue headings", "ops": [ { "op": "replace", "path": "styles.css", "old": "h1 { color: red; }", "new": "h1 { color: blue; }" } ] }'

Change an artifact with small operations instead of re-publishing every file. The ops run in order on the newest version, which base_version must name; if any op fails nothing is written. The result is published as the next version through the normal publish pipeline (moderation, tests gate, readiness), and files the ops leave unchanged are carried over without re-uploading. Counts once against the daily publish limit (dry_run does not). Requires the editor role. Works on html, markdown, csv, txt and json artifacts. Workspace Agent tokens need artifacts:publish and reach only artifacts in their own workspace. Renaming or deleting the mobile entrypoint turns the artifact’s mobile view off. Send Idempotency-Key to make retries safe.

id
required
string

Artifact ID (e.g. art_abc123).

Media typeapplication/json
object
base_version
required

The version_no of the files you read; must be the newest version.

integer
>= 1
ops
required
Array<object>
>= 1 items <= 100 items

replace {path, old, new, all?}: old must match exactly once unless all; both are literal text ($& stays $&). In a CRLF file an old written with LF still matches and the replacement takes CRLF. write {path, content, encoding?} creates or replaces a whole file (encoding: base64 for binary). delete {path}. rename {from, to} moves a file without re-uploading it (same file type only).

object
op
required
string
Allowed values: replace write delete rename
path
string
old
string
new
string
all
boolean
content
string
encoding
string
Allowed values: utf8 base64
from
string
to
string
message

Note for the version history.

string
dry_run

Report changes without saving anything.

boolean

Example

{
"base_version": 3,
"message": "Blue headings",
"ops": [
{
"op": "replace",
"path": "styles.css",
"old": "h1 { color: red; }",
"new": "h1 { color: blue; }"
}
]
}

dry_run: true ({dry_run, base_version, would_create_version, entrypoint, changes}), or ops that leave every file as it was ({unchanged: true}): no version is created.

Media typeapplication/json
object
dry_run
boolean
unchanged
boolean
base_version
integer
would_create_version
integer
changes
Array<object>
object
path
string
change
string
Allowed values: added modified deleted renamed
from

Old path of a renamed file.

string
size_before
integer
size_after
integer
replacements
integer

Example

{
"changes": [
{
"change": "added"
}
]
}

Saved as a new version. Same body as POST /v1/publish, plus base_version and changes.

Media typeapplication/json
object
artifact
object
version
object
id
string
version_no
integer
deployment
object
visibility

β€˜unlisted’ was retired 2026-07 β€” still accepted as input and treated as β€˜public’.

string
Allowed values: public workspace private
base_version
integer
changes
Array<object>
object
path
string
change
string
Allowed values: added modified deleted renamed
from

Old path of a renamed file.

string
size_before
integer
size_after
integer
replacements
integer

Example

{
"visibility": "public",
"changes": [
{
"change": "added"
}
]
}

Malformed request (VALIDATION_ERROR, INVALID_OPS, INVALID_PATH, INVALID_JSON).

Media typeapplication/json
object
success
required
boolean
error
required

Human-readable message.

string
code
required

Machine-readable error code.

string
request_id

Correlation id (also the X-Request-Id header). Quote it in support tickets.

string
reason

Finer cause under code. For UNAUTHORIZED: missing, invalid, revoked or expired.

string
hint

What to do next, in plain words.

string
suggestion
string
param

The request field at fault.

string
docs

Doc page for this error.

string
redirect_url
string
support

Present on 5xx β€” how to reach a human.

object
how
string
include
Array<string>
op_index

Index in ops of the op that failed.

integer
path
string
nearest

EDIT_NO_MATCH: the line most like the first line of old.

object
line
integer
text
string
lines

EDIT_AMBIGUOUS: 1-based line of each match (first 20).

Array<integer>

Example

{
"success": false,
"support": {
"how": "POST /v1/support/tickets",
"include": [
"request_id"
]
}
}

Access denied

Media typeapplication/json
object
success
required
boolean
error
required

Human-readable message.

string
code
required

Machine-readable error code.

string
request_id

Correlation id (also the X-Request-Id header). Quote it in support tickets.

string
reason

Finer cause under code. For UNAUTHORIZED: missing, invalid, revoked or expired.

string
hint

What to do next, in plain words.

string
suggestion
string
param

The request field at fault.

string
docs

Doc page for this error.

string
redirect_url
string
support

Present on 5xx β€” how to reach a human.

object
how
string
include
Array<string>

Example

{
"success": false,
"support": {
"how": "POST /v1/support/tickets",
"include": [
"request_id"
]
}
}

Resource not found

Media typeapplication/json
object
success
required
boolean
error
required

Human-readable message.

string
code
required

Machine-readable error code.

string
request_id

Correlation id (also the X-Request-Id header). Quote it in support tickets.

string
reason

Finer cause under code. For UNAUTHORIZED: missing, invalid, revoked or expired.

string
hint

What to do next, in plain words.

string
suggestion
string
param

The request field at fault.

string
docs

Doc page for this error.

string
redirect_url
string
support

Present on 5xx β€” how to reach a human.

object
how
string
include
Array<string>

Example

{
"success": false,
"support": {
"how": "POST /v1/support/tickets",
"include": [
"request_id"
]
}
}

VERSION_CONFLICT: the artifact has a newer version than base_version; current_version says which. Nothing was written.

Media typeapplication/json
object
success
required
boolean
error
required

Human-readable message.

string
code
required

Machine-readable error code.

string
request_id

Correlation id (also the X-Request-Id header). Quote it in support tickets.

string
reason

Finer cause under code. For UNAUTHORIZED: missing, invalid, revoked or expired.

string
hint

What to do next, in plain words.

string
suggestion
string
param

The request field at fault.

string
docs

Doc page for this error.

string
redirect_url
string
support

Present on 5xx β€” how to reach a human.

object
how
string
include
Array<string>
base_version
integer
current_version
integer

Example

{
"success": false,
"support": {
"how": "POST /v1/support/tickets",
"include": [
"request_id"
]
}
}

STORAGE_LIMIT_EXCEEDED or FILE_TOO_LARGE.

Media typeapplication/json
object
success
required
boolean
error
required

Human-readable message.

string
code
required

Machine-readable error code.

string
request_id

Correlation id (also the X-Request-Id header). Quote it in support tickets.

string
reason

Finer cause under code. For UNAUTHORIZED: missing, invalid, revoked or expired.

string
hint

What to do next, in plain words.

string
suggestion
string
param

The request field at fault.

string
docs

Doc page for this error.

string
redirect_url
string
support

Present on 5xx β€” how to reach a human.

object
how
string
include
Array<string>

Example

{
"success": false,
"support": {
"how": "POST /v1/support/tickets",
"include": [
"request_id"
]
}
}

An op could not be applied; nothing was written. EDIT_NO_MATCH (old not found; nearest is the closest line), EDIT_AMBIGUOUS (old matches several places; lines lists them β€” add context or set all), FILE_NOT_FOUND, FILE_EXISTS, NOT_TEXT, RENAME_CHANGES_TYPE, ENTRYPOINT_MISSING, UNSUPPORTED_ARTIFACT_TYPE.

Media typeapplication/json
object
success
required
boolean
error
required

Human-readable message.

string
code
required

Machine-readable error code.

string
request_id

Correlation id (also the X-Request-Id header). Quote it in support tickets.

string
reason

Finer cause under code. For UNAUTHORIZED: missing, invalid, revoked or expired.

string
hint

What to do next, in plain words.

string
suggestion
string
param

The request field at fault.

string
docs

Doc page for this error.

string
redirect_url
string
support

Present on 5xx β€” how to reach a human.

object
how
string
include
Array<string>
op_index

Index in ops of the op that failed.

integer
path
string
nearest

EDIT_NO_MATCH: the line most like the first line of old.

object
line
integer
text
string
lines

EDIT_AMBIGUOUS: 1-based line of each match (first 20).

Array<integer>

Example

{
"success": false,
"support": {
"how": "POST /v1/support/tickets",
"include": [
"request_id"
]
}
}

Rate limit reached (RATE_LIMIT_EXCEEDED on publish / account creation / AI routes, RATE_LIMITED on the data plane). Wait for Retry-After / reset.

Media typeapplication/json
object
success
required
boolean
error
required

Human-readable message.

string
code
required

Machine-readable error code.

string
request_id

Correlation id (also the X-Request-Id header). Quote it in support tickets.

string
reason

Finer cause under code. For UNAUTHORIZED: missing, invalid, revoked or expired.

string
hint

What to do next, in plain words.

string
suggestion
string
param

The request field at fault.

string
docs

Doc page for this error.

string
redirect_url
string
support

Present on 5xx β€” how to reach a human.

object
how
string
include
Array<string>

Example

{
"success": false,
"support": {
"how": "POST /v1/support/tickets",
"include": [
"request_id"
]
}
}