Save an artifact
curl --request POST \
--url http://localhost:8000/apps/{app_name}/users/{user_id}/sessions/{session_id}/artifacts \
--header 'Content-Type: application/json' \
--data '
{
"filename": "notes.txt",
"artifact": {
"text": "Travel notes"
}
}
'import requests
url = "http://localhost:8000/apps/{app_name}/users/{user_id}/sessions/{session_id}/artifacts"
payload = {
"filename": "notes.txt",
"artifact": { "text": "Travel notes" }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({filename: 'notes.txt', artifact: {text: 'Travel notes'}})
};
fetch('http://localhost:8000/apps/{app_name}/users/{user_id}/sessions/{session_id}/artifacts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"version": 123,
"canonicalUri": "<string>",
"customMetadata": {},
"createTime": 123,
"mimeType": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<string>"
}Artifacts
Save an artifact
Save a new artifact version from a Part payload and return its version, URI, and metadata
POST
/
apps
/
{app_name}
/
users
/
{user_id}
/
sessions
/
{session_id}
/
artifacts
Save an artifact
curl --request POST \
--url http://localhost:8000/apps/{app_name}/users/{user_id}/sessions/{session_id}/artifacts \
--header 'Content-Type: application/json' \
--data '
{
"filename": "notes.txt",
"artifact": {
"text": "Travel notes"
}
}
'import requests
url = "http://localhost:8000/apps/{app_name}/users/{user_id}/sessions/{session_id}/artifacts"
payload = {
"filename": "notes.txt",
"artifact": { "text": "Travel notes" }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({filename: 'notes.txt', artifact: {text: 'Travel notes'}})
};
fetch('http://localhost:8000/apps/{app_name}/users/{user_id}/sessions/{session_id}/artifacts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"version": 123,
"canonicalUri": "<string>",
"customMetadata": {},
"createTime": 123,
"mimeType": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<string>"
}This operation writes a new version to the configured artifact store. Repeating the same request can create another version. Confirm the content and target application, user, and session before saving
artifact.text for text. For binary content, use artifact.inlineData with mimeType and Base64-encoded data. Read the exact saved version using the returned version; direct access to canonicalUri depends on the storage backend and permissionsPath Parameters
Application name
User ID
Session ID
Body
application/json
Response
Successful response
Last modified on September 19, 2026