Upsert an agent retention policy
curl --request PUT \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/retention \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"conversations_retention_days": 123,
"documents_retention_days": 123,
"tasks_retention_days": 123,
"artifacts_retention_days": 123,
"admin_override": true
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversations_retention_days: 123,
documents_retention_days: 123,
tasks_retention_days: 123,
artifacts_retention_days: 123,
admin_override: true
})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/retention', 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/agents/{agentId}/retention"
payload = {
"conversations_retention_days": 123,
"documents_retention_days": 123,
"tasks_retention_days": 123,
"artifacts_retention_days": 123,
"admin_override": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"policy": {},
"effective": {
"conversations_retention_days": 123,
"documents_retention_days": 123,
"tasks_retention_days": 123,
"artifacts_retention_days": 123
}
}{
"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": {}
}Retention
Upsert an agent retention policy
Upserts the agent-level retention policy. Each field is
validated against the org limit; admins (platform admin or
agent-factory admin) may set admin_override: true to exceed
the org limits.
PUT
/
v1
/
agents
/
{agentId}
/
retention
Upsert an agent retention policy
curl --request PUT \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/retention \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"conversations_retention_days": 123,
"documents_retention_days": 123,
"tasks_retention_days": 123,
"artifacts_retention_days": 123,
"admin_override": true
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversations_retention_days: 123,
documents_retention_days: 123,
tasks_retention_days: 123,
artifacts_retention_days: 123,
admin_override: true
})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/retention', 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/agents/{agentId}/retention"
payload = {
"conversations_retention_days": 123,
"documents_retention_days": 123,
"tasks_retention_days": 123,
"artifacts_retention_days": 123,
"admin_override": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"policy": {},
"effective": {
"conversations_retention_days": 123,
"documents_retention_days": 123,
"tasks_retention_days": 123,
"artifacts_retention_days": 123
}
}{
"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
BearerAuthOrgApiKeyAuth
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
Maximum string length:
64Body
application/json
Response
Upserted policy + effective values.
Raw retention_policies document for this agent
(scope: "agent"). Null when no override is set.
Was this page helpful?