curl -X PATCH "$ATAI_API_ENDPOINT/agents/deployments/dpl_01jcg7r2t9xb5qw3m8n6kfzc4d" \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sessions": {"max": 64}}'
import os
import requests
base_url = os.environ["ATAI_API_ENDPOINT"]
api_key = os.environ["ATAI_API_KEY"]
response = requests.patch(
f"{base_url}/agents/deployments/dpl_01jcg7r2t9xb5qw3m8n6kfzc4d",
headers={"Authorization": f"Bearer {api_key}"},
json={"sessions": {"max": 64}},
)
if response.status_code == 200:
print(response.json()["sessions"])
else:
print(f"Error: {response.json()['errors']}")
const response = await fetch(
`${process.env.ATAI_API_ENDPOINT}/agents/deployments/dpl_01jcg7r2t9xb5qw3m8n6kfzc4d`,
{
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ sessions: { max: 64 } })
}
);
const body = await response.json();
if (response.ok) {
console.log(body.sessions);
} else {
console.error('Error:', body.errors);
}
{
"id": "dpl_01jcg7r2t9xb5qw3m8n6kfzc4d",
"org_id": "org_01jc8m5r2vq9xt4bn7h3kdzs6w",
"project_id": "prj_01jcd4m8t2vq6xn3r7k5hbzw9e",
"created_by": "usr_01jc8m6t3wr0yv5cp8j4mezt7x",
"package_id": "pkg_01jcb2x7m4qv8n3h5t6rk9dzs0",
"kind": "serving",
"status": "ready",
"error": null,
"created_at": "2026-11-05T17:00:00Z",
"ready_at": "2026-11-05T17:02:10Z",
"stopped_at": null,
"sessions": {"max": 64, "idle_timeout_secs": 900}
}
Deployments
Update Deployment
Change a ready serving deployment’s session limits
PATCH
/
api
/
agents
/
deployments
/
{deployment_id}
curl -X PATCH "$ATAI_API_ENDPOINT/agents/deployments/dpl_01jcg7r2t9xb5qw3m8n6kfzc4d" \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sessions": {"max": 64}}'
import os
import requests
base_url = os.environ["ATAI_API_ENDPOINT"]
api_key = os.environ["ATAI_API_KEY"]
response = requests.patch(
f"{base_url}/agents/deployments/dpl_01jcg7r2t9xb5qw3m8n6kfzc4d",
headers={"Authorization": f"Bearer {api_key}"},
json={"sessions": {"max": 64}},
)
if response.status_code == 200:
print(response.json()["sessions"])
else:
print(f"Error: {response.json()['errors']}")
const response = await fetch(
`${process.env.ATAI_API_ENDPOINT}/agents/deployments/dpl_01jcg7r2t9xb5qw3m8n6kfzc4d`,
{
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ sessions: { max: 64 } })
}
);
const body = await response.json();
if (response.ok) {
console.log(body.sessions);
} else {
console.error('Error:', body.errors);
}
{
"id": "dpl_01jcg7r2t9xb5qw3m8n6kfzc4d",
"org_id": "org_01jc8m5r2vq9xt4bn7h3kdzs6w",
"project_id": "prj_01jcd4m8t2vq6xn3r7k5hbzw9e",
"created_by": "usr_01jc8m6t3wr0yv5cp8j4mezt7x",
"package_id": "pkg_01jcb2x7m4qv8n3h5t6rk9dzs0",
"kind": "serving",
"status": "ready",
"error": null,
"created_at": "2026-11-05T17:00:00Z",
"ready_at": "2026-11-05T17:02:10Z",
"stopped_at": null,
"sessions": {"max": 64, "idle_timeout_secs": 900}
}
Requires version 2.0.1 or later of the Archetype platform.
Overview
This endpoint changes the session settings of aserving deployment and returns the deployment.
Only a ready serving deployment takes a change.
Each field of sessions you send replaces the deployment’s current value. Each one you leave out,
or send as null, keeps it. Leaving out sessions, or sending null or {}, changes nothing and
returns the deployment as it is.
Request
New limits for the deployment’s sessions. A field this object does not have is refused with
400.The most sessions the deployment holds open at once, per running copy of the deployment.
Minimum
1, maximum 1000. Lowering it closes no open session; it only refuses new ones.Seconds a session can sit unused, counted from its last use, before the deployment closes it.
Maximum
86400. 0 means never, which is refused with 400 where the platform stops idle
deployments.Response
Returns200 OK with the deployment, with the same fields as Get
Deployment returns. Its sessions gives the
stored settings.
curl -X PATCH "$ATAI_API_ENDPOINT/agents/deployments/dpl_01jcg7r2t9xb5qw3m8n6kfzc4d" \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sessions": {"max": 64}}'
import os
import requests
base_url = os.environ["ATAI_API_ENDPOINT"]
api_key = os.environ["ATAI_API_KEY"]
response = requests.patch(
f"{base_url}/agents/deployments/dpl_01jcg7r2t9xb5qw3m8n6kfzc4d",
headers={"Authorization": f"Bearer {api_key}"},
json={"sessions": {"max": 64}},
)
if response.status_code == 200:
print(response.json()["sessions"])
else:
print(f"Error: {response.json()['errors']}")
const response = await fetch(
`${process.env.ATAI_API_ENDPOINT}/agents/deployments/dpl_01jcg7r2t9xb5qw3m8n6kfzc4d`,
{
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ sessions: { max: 64 } })
}
);
const body = await response.json();
if (response.ok) {
console.log(body.sessions);
} else {
console.error('Error:', body.errors);
}
{
"id": "dpl_01jcg7r2t9xb5qw3m8n6kfzc4d",
"org_id": "org_01jc8m5r2vq9xt4bn7h3kdzs6w",
"project_id": "prj_01jcd4m8t2vq6xn3r7k5hbzw9e",
"created_by": "usr_01jc8m6t3wr0yv5cp8j4mezt7x",
"package_id": "pkg_01jcb2x7m4qv8n3h5t6rk9dzs0",
"kind": "serving",
"status": "ready",
"error": null,
"created_at": "2026-11-05T17:00:00Z",
"ready_at": "2026-11-05T17:02:10Z",
"stopped_at": null,
"sessions": {"max": 64, "idle_timeout_secs": 900}
}
Important Notes
- A
400means the body does not parse, names a field this endpoint does not have, or gives a value that is not a whole number (invalid_request_body); a value is outside its limits (out_of_range); or the deployment is notserving, oridle_timeout_secsis0where idle deployments are stopped (bad_request). A value the deployment already has is kept as it is, not checked again. - A
403means you can see the deployment’s project but cannot modify it. - A
404means the deployment does not exist, belongs to another organization, or is in a project you cannot see. - A
409with the codeconflictmeans the deployment is notready. The message says whether to wait for it or that it has ended. Nothing is stored. - A
409with the codedeployment_sessions_unsupportedmeans the deployment cannot take session settings. Deploy the package again to get one that can. Nothing is stored. - A
503with the codeunavailablemeans the settings could not be stored. The same request is safe to retry.
Was this page helpful?