curl -X POST \
https://api.agent37.com/v1/instances/ab12cd34ef/restart \
-H "Authorization: Bearer sk_live_..."
import requests
response = requests.post(
"https://api.agent37.com/v1/instances/ab12cd34ef/restart",
headers={
"Authorization": "Bearer sk_live_..."
},
)
response.raise_for_status()
print(response.json())
const response = await fetch(
"https://api.agent37.com/v1/instances/ab12cd34ef/restart",
{
method: "POST",
headers: {
"Authorization": "Bearer sk_live_..."
},
},
);
if (!response.ok) {
throw new Error(await response.text());
}
console.log(await response.json());
{
"id": "ab12cd34ef",
"status": "running"
}
Lifecycle
Restart an instance
Restart an instance using its current image and files.
POST
/
v1
/
instances
/
{id}
/
restart
curl -X POST \
https://api.agent37.com/v1/instances/ab12cd34ef/restart \
-H "Authorization: Bearer sk_live_..."
import requests
response = requests.post(
"https://api.agent37.com/v1/instances/ab12cd34ef/restart",
headers={
"Authorization": "Bearer sk_live_..."
},
)
response.raise_for_status()
print(response.json())
const response = await fetch(
"https://api.agent37.com/v1/instances/ab12cd34ef/restart",
{
method: "POST",
headers: {
"Authorization": "Bearer sk_live_..."
},
},
);
if (!response.ok) {
throw new Error(await response.text());
}
console.log(await response.json());
{
"id": "ab12cd34ef",
"status": "running"
}
curl -X POST \
https://api.agent37.com/v1/instances/ab12cd34ef/restart \
-H "Authorization: Bearer sk_live_..."
import requests
response = requests.post(
"https://api.agent37.com/v1/instances/ab12cd34ef/restart",
headers={
"Authorization": "Bearer sk_live_..."
},
)
response.raise_for_status()
print(response.json())
const response = await fetch(
"https://api.agent37.com/v1/instances/ab12cd34ef/restart",
{
method: "POST",
headers: {
"Authorization": "Bearer sk_live_..."
},
},
);
if (!response.ok) {
throw new Error(await response.text());
}
console.log(await response.json());
{
"id": "ab12cd34ef",
"status": "running"
}
Authorization: Bearer sk_live_... on https://api.agent37.com.
Path parameters
string
required
The instance id, returned when you create an instance.
Behavior and errors
POST /v1/instances/{id}/restart recreates the container from the image already on the host (no download) and returns it to running. Use it to recover a wedged agent or pick up changed settings. Same image, same data. On agent37-hermes it is also how a Hermes profile switch takes effect: run hermes profile use <name> in the instance (over exec or the terminal), then restart; the instance boots its gateway, dashboard, and chat API in that profile’s home, and hermes profile use default plus a restart switches back. The instance must be running; use start to bring a stopped one back up. Concurrent restarts of the same instance do not stack: one proceeds and the rest return 409 try_again. A restart that fails returns 502 provisioning_failed and leaves the instance running when its container is still up or its host could not be reached, with the reason in status_reason, so you can simply retry; it reads failed only when the container is confirmed down.
See Instance lifecycle for disk persistence and boot hooks. Retrieve the instance object for its full representation.