> ## Documentation Index
> Fetch the complete documentation index at: https://www.agent37.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Restart an instance

> Restart an instance using its current image and files.

<RequestExample>
  ```bash curl wrap theme={null}
  curl -X POST \
    https://api.agent37.com/v1/instances/ab12cd34ef/restart \
    -H "Authorization: Bearer sk_live_..."
  ```

  ```python Python wrap theme={null}
  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())
  ```

  ```javascript Node wrap theme={null}
  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());
  ```
</RequestExample>

<ResponseExample>
  ```json 200 wrap theme={null}
  {
    "id": "ab12cd34ef",
    "status": "running"
  }
  ```
</ResponseExample>

Authenticate with `Authorization: Bearer sk_live_...` on `https://api.agent37.com`.

## Path parameters

<ParamField path="id" type="string" required>
  The instance id, returned when you create an instance.
</ParamField>

## 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](https://github.com/NousResearch/hermes-agent) switch takes effect: run `hermes profile use <name>` in the instance (over [exec](/docs/agents-api/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](/docs/agents-api/instance-lifecycle) for disk persistence and boot hooks. Retrieve the [instance object](/docs/agents-api/instances/get) for its full representation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.