curl -X POST "$ATAI_API_ENDPOINT/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a/stop" \
-H "Authorization: Bearer $ATAI_API_KEY"
import os
import requests
base_url = os.environ["ATAI_API_ENDPOINT"]
api_key = os.environ["ATAI_API_KEY"]
response = requests.post(
f"{base_url}/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a/stop",
headers={"Authorization": f"Bearer {api_key}"},
)
if response.status_code == 200:
print(response.json()["status"])
else:
print(f"Error: {response.json()['errors']}")
const response = await fetch(
`${process.env.ATAI_API_ENDPOINT}/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a/stop`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
const body = await response.json();
if (response.ok) {
console.log(body.status);
} else {
console.error('Error:', body.errors);
}
{
"id": "dpl_01jcf3n8q5vx2mt7r4k6hbzd9a",
"org_id": "org_01jc8m5r2vq9xt4bn7h3kdzs6w",
"project_id": "prj_01jcd4m8t2vq6xn3r7k5hbzw9e",
"created_by": "usr_01jc8m6t3wr0yv5cp8j4mezt7x",
"package_id": "pkg_01jcb2x7m4qv8n3h5t6rk9dzs0",
"kind": "batch",
"status": "stopped",
"error": null,
"created_at": "2026-10-29T16:00:00Z",
"ready_at": "2026-10-29T16:00:00Z",
"stopped_at": "2026-10-29T18:30:00Z",
"sessions": null
}
Deployments
Stop Deployment
Stop a deployment and cancel the sessions still running on it
POST
/
api
/
agents
/
deployments
/
{deployment_id}
/
stop
curl -X POST "$ATAI_API_ENDPOINT/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a/stop" \
-H "Authorization: Bearer $ATAI_API_KEY"
import os
import requests
base_url = os.environ["ATAI_API_ENDPOINT"]
api_key = os.environ["ATAI_API_KEY"]
response = requests.post(
f"{base_url}/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a/stop",
headers={"Authorization": f"Bearer {api_key}"},
)
if response.status_code == 200:
print(response.json()["status"])
else:
print(f"Error: {response.json()['errors']}")
const response = await fetch(
`${process.env.ATAI_API_ENDPOINT}/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a/stop`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
const body = await response.json();
if (response.ok) {
console.log(body.status);
} else {
console.error('Error:', body.errors);
}
{
"id": "dpl_01jcf3n8q5vx2mt7r4k6hbzd9a",
"org_id": "org_01jc8m5r2vq9xt4bn7h3kdzs6w",
"project_id": "prj_01jcd4m8t2vq6xn3r7k5hbzw9e",
"created_by": "usr_01jc8m6t3wr0yv5cp8j4mezt7x",
"package_id": "pkg_01jcb2x7m4qv8n3h5t6rk9dzs0",
"kind": "batch",
"status": "stopped",
"error": null,
"created_at": "2026-10-29T16:00:00Z",
"ready_at": "2026-10-29T16:00:00Z",
"stopped_at": "2026-10-29T18:30:00Z",
"sessions": null
}
Requires version 2.0.1 or later of the Archetype platform.
Overview
This endpoint stops a deployment and returns it. The deployment becomesstopped, and
every session on it that has not ended becomes cancelled, its run stopped. No session can be
opened on a stopped deployment.
You can stop a deployment that is deploying or ready. Stopping is final: to run the package
again, deploy it again. Once it is stopped, you can delete
it after deleting its sessions.
Request
Response
Returns200 OK with the stopped deployment, with the same fields as Get
Deployment returns. Its status is stopped
and stopped_at is set.
curl -X POST "$ATAI_API_ENDPOINT/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a/stop" \
-H "Authorization: Bearer $ATAI_API_KEY"
import os
import requests
base_url = os.environ["ATAI_API_ENDPOINT"]
api_key = os.environ["ATAI_API_KEY"]
response = requests.post(
f"{base_url}/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a/stop",
headers={"Authorization": f"Bearer {api_key}"},
)
if response.status_code == 200:
print(response.json()["status"])
else:
print(f"Error: {response.json()['errors']}")
const response = await fetch(
`${process.env.ATAI_API_ENDPOINT}/agents/deployments/dpl_01jcf3n8q5vx2mt7r4k6hbzd9a/stop`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
const body = await response.json();
if (response.ok) {
console.log(body.status);
} else {
console.error('Error:', body.errors);
}
{
"id": "dpl_01jcf3n8q5vx2mt7r4k6hbzd9a",
"org_id": "org_01jc8m5r2vq9xt4bn7h3kdzs6w",
"project_id": "prj_01jcd4m8t2vq6xn3r7k5hbzw9e",
"created_by": "usr_01jc8m6t3wr0yv5cp8j4mezt7x",
"package_id": "pkg_01jcb2x7m4qv8n3h5t6rk9dzs0",
"kind": "batch",
"status": "stopped",
"error": null,
"created_at": "2026-10-29T16:00:00Z",
"ready_at": "2026-10-29T16:00:00Z",
"stopped_at": "2026-10-29T18:30:00Z",
"sessions": null
}
Important Notes
- A
409means the deployment has already ended asstoppedorfailed. - 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. - Stopping cancels the deployment’s
pendingandrunningsessions. Each one records acancelled: its deployment was stoppedevent in List Session Events.
Was this page helpful?