curl --request PATCH \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/artifacts/{artifactId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "Updated greeting message",
"change_summary": "Updated greeting message"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: 'Updated greeting message',
change_summary: 'Updated greeting message'
})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/artifacts/{artifactId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/artifacts/{artifactId}"
payload = {
"content": "Updated greeting message",
"change_summary": "Updated greeting message"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Update artifact content or restore a version
Two mutation modes, both creating a new current version:
restore_version re-commits a historical version’s content (it
wins when both are sent), otherwise content replaces the whole
document. base_version opts into optimistic concurrency control
on the content mode.
curl --request PATCH \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/artifacts/{artifactId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "Updated greeting message",
"change_summary": "Updated greeting message"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: 'Updated greeting message',
change_summary: 'Updated greeting message'
})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/artifacts/{artifactId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/artifacts/{artifactId}"
payload = {
"content": "Updated greeting message",
"change_summary": "Updated greeting message"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Authorizations
User-bound credential carrying an identity: either a session JWT
or a user access token (at:*) generated from the user settings UI.
Send as Authorization: Bearer <token>.
Org API keys (iak_*) are not accepted here - they carry
no user identity. Use the x-prismeai-api-key header instead
(see OrgApiKeyAuth).
Path Parameters
128Body
Send content (full replace) or restore_version (fork a
historical version into a new current version).
Response
New version persisted.
Helper-defined update result - includes the new
current_version and total_versions.
Was this page helpful?