Skip to main content
POST
Authenticate with Authorization: Bearer sk_live_... on https://api.agent37.com.

Path parameters

string
required
The instance id, returned when you create an instance.

Request body

string
Optional template name or version pin. Omit it to re-resolve the stored template. See the behavior below for migration and pinning rules.

Behavior and errors

POST /v1/instances/{id}/update pulls the template’s image, resets the operating system layer to it, and preserves the data in /home/node and /home/linuxbrew. It is the one lifecycle call that discards changes outside those directories, which also makes it the clean-slate repair tool: use it to move an instance onto a newer version after a release (or after you point a workspace template at a new tag), or to recover a failed/stuck instance (read its logs first to see why it failed). A running or recoverable non-stopped instance is recreated and returns running; a stopped instance pulls the image pointer now and stays stopped, then uses that image the next time it starts. The body is optional. Without one, update re-resolves the instance’s stored template: a workspace instance installs the template’s current image and revision, an unpinned system instance moves to the template’s current image, and a version-pinned instance stays on its pin. The one accepted field, template, takes any template name: the same template with an @<version>, a published tag on a system template or a published revision number on a workspace template, pins that release (this works on an unpinned instance too, and pinning an earlier workspace revision is the rollback), the bare name clears the pin to follow latest, and a different template migrates the instance onto it. A template migration keeps the instance’s id, URLs, public ports, and data, and the recreated container adopts the new template’s image, default port, and agent type; the instance keeps its shape, which every template offers. Any other field returns 400. The ack carries the resulting status, the applied template when one was passed, image_ref, image_digest, and template_revision. A sleeping instance is woken first and then updated, so it comes back running; while its checkpoint is still being written the call returns 409 try_again, so retry with backoff. A bad image reference on the template surfaces here as a 502 provisioning_failed.
curl
See Instance lifecycle for disk persistence and boot hooks. Retrieve the instance object for its full representation.