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

# Restart computer

> Reboot a running computer.

Reboots a computer in place on the host it is already running on. The disk is untouched; memory and running processes are not.

<Note>
  A restart keeps the computer's ports and VNC password. Orgo rewrites the stored connection details from what the host reports afterwards, so re-fetch [`GET /computers/{id}`](/api-reference/computers/get) if you need to be certain. Open VNC and terminal WebSockets drop during the reboot.
</Note>

A `frozen` computer has no host, so restarting it returns `500`. Use [start](/api-reference/computers/start) instead. A `stopped` computer whose virtual machine is still on its host is booted there, which requires a plan that funds running computers.

## Path parameters

<ParamField path="id" type="string" required>
  Computer UUID or `instance_id`. Both resolve to the same computer.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  `true` when the computer restarted. The response is sent after the reboot completes, not when it is queued.
</ResponseField>

## Use cases

* Recover from a hung or unresponsive computer
* Reset the running environment

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://www.orgo.ai/api/computers/$COMPUTER_ID/restart \
    -H "Authorization: Bearer $ORGO_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      f"https://www.orgo.ai/api/computers/{computer_id}/restart",
      headers={"Authorization": f"Bearer {api_key}"}
  )

  if response.json().get("success"):
      print("Computer restarted")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(`https://www.orgo.ai/api/computers/${computerId}/restart`, {
    method: 'POST',
    headers: { 'Authorization': `Bearer ${apiKey}` }
  });

  const { success } = await response.json();
  if (success) console.log('Computer restarted');
  ```
</CodeGroup>

### Response

```json theme={null}
{
  "success": true
}
```

## Errors

| Status | Body | When |
| - | - | - |
| `400` | `{ "error": "…", "code": "DEVICE_LIFECYCLE_UNSUPPORTED" }` | The computer runs on a dedicated machine Orgo manages directly. Contact support. |
| `401` | `{ "error": "Invalid API key" }` | The Bearer token starts with `sk_` but is not a known Orgo key. |
| `401` | `{ "error": "Authentication required" }` | No `Authorization` header, or a Bearer token that is not an `sk_` key. |
| `402` | `{ "error": "Your plan does not include running computers. Upgrade to restart this computer.", "code": "upgrade_required" }` | The computer is not `running` and the workspace owner's plan no longer funds running computers. |
| `402` | `{ "error": "Choose a plan to continue." }` | The computer is a trial computer whose trial has ended. |
| `403` | `{ "error": "You do not have access to this workspace." }` | You are not a member of the computer's workspace. |
| `403` | `{ "error": "This workspace is view-only. Ask the owner for write access (workspace_read_only)." }` | You have view-only access to the workspace. |
| `403` | `{ "error": "This API key cannot access this workspace (workspace_scope_mismatch)." }` | The API key is scoped to a different workspace. |
| `404` | `{ "error": "Desktop not found" }` | No computer matches the id. |
| `409` | `{ "error": "This computer is paused. Resume it first, then restart it.", "code": "suspended" }` | The computer is `suspended`. |
| `409` | `{ "error": "…", "code": "migrating" }` | The computer is being moved to another host. Retry in a few minutes. |
| `409` | `{ "error": "…", "code": "NOT_ON_HOST" }` | The host no longer has the computer, and the computer has no archive to start from. Contact support. |
| `409` | `{ "error": "pool_mac_release_required", "message": "This Mac is managed by Orgo. Ask support to release it." }` | The computer is a Mac that has been released back to Orgo. |
| `500` | `{ "error": "…" }` | Every other failure: a computer with no live host, a host that refused or could not be reached, or an error during the reboot. The body carries the underlying message. |
| `503` | `{ "error": "Service temporarily unavailable. …" }` | Orgo could not verify the credential because of a server-side fault. The response carries `Retry-After: 5`. Retry after that delay. |

A failed restart changes the computer's status only to what its host confirms, such as `stopped` or `error`. When the host cannot be reached, the computer keeps the status it had before the call.


## OpenAPI

````yaml POST /computers/{id}/restart
openapi: 3.1.0
info:
  title: Orgo API
  description: >-
    Launch cloud computers that AI agents can control and interact with. Create
    workspaces, provision computers, and control them programmatically.
  version: 2.0.0
  contact:
    name: Orgo Support
    email: spencer@orgo.ai
    url: https://orgo.ai
servers:
  - url: https://www.orgo.ai/api
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Account
    description: >-
      Account capacity: how many computers an account may run, and adding or
      giving back more.
  - name: Clients
    description: >-
      Run Orgo for your clients from your own app: a workspace and scoped key
      each, billed to you or to them.
  - name: Workspaces
    description: Organize computers into named workspaces
  - name: Computers
    description: Provision and manage virtual computers
  - name: Computer Lifecycle
    description: Start, stop, and restart computers
  - name: Computer Actions
    description: Control mouse, keyboard, and execute commands
  - name: Screens
    description: >-
      More than one desktop on a single computer. Each screen is its own X
      server with its own cursor and window manager, so an agent working on one
      cannot disturb another.
  - name: Files
    description: Upload and download files
  - name: Templates
    description: Author, build, and launch reproducible computers from templates
paths:
  /computers/{id}/restart:
    post:
      tags:
        - Computer Lifecycle
      summary: Restart computer
      description: >-
        Reboots a computer in place on the host it is already running on. The
        disk is untouched; memory and running processes are not. The response is
        sent after the reboot completes. A `frozen` computer has no host, so
        restarting it returns `500`; use start instead. Accepts the computer
        UUID or its `instance_id`.
      operationId: restartComputer
      parameters:
        - name: id
          in: path
          required: true
          description: Computer ID
          schema:
            type: string
      responses:
        '200':
          description: The computer restarted
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
        '400':
          description: >-
            The computer runs on a dedicated machine Orgo manages directly.
            Contact support.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: …
                code: DEVICE_LIFECYCLE_UNSUPPORTED
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: >-
            The computer is not `running` and the owner's plan no longer funds
            running computers, or the computer is a trial computer whose trial
            has ended.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                upgrade:
                  summary: Plan does not fund running computers
                  value:
                    error: >-
                      Your plan does not include running computers. Upgrade to
                      restart this computer.
                    code: upgrade_required
                trial:
                  summary: Trial ended
                  value:
                    error: Choose a plan to continue.
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: The restart was refused.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
              examples:
                suspended:
                  summary: The computer is suspended
                  value:
                    error: This computer is paused. Resume it first, then restart it.
                    code: suspended
                migrating:
                  summary: Being moved to another host
                  value:
                    error: >-
                      This computer is being moved to another host. Try again in
                      a few minutes.
                    code: migrating
                not-on-host:
                  summary: The host no longer has the computer and there is no archive
                  value:
                    error: …
                    code: NOT_ON_HOST
                pool-mac:
                  summary: A Mac released back to Orgo
                  value:
                    error: pool_mac_release_required
                    message: This Mac is managed by Orgo. Ask support to release it.
        '500':
          description: >-
            Every other failure: no live host, a host that refused or could not
            be reached, or an error during the reboot. The body carries the
            underlying message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: …
        '503':
          $ref: '#/components/responses/AuthUnavailable'
components:
  schemas:
    Error:
      type: object
      description: >-
        The base error body. Every failure carries `error`; individual endpoints
        add the fields named in the schemas below.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable message.
          example: Access denied
        code:
          type: string
          description: >-
            Machine-readable reason. Present on the failures that define one,
            absent otherwise.
  responses:
    Unauthorized:
      description: 'No usable credential. Send `Authorization: Bearer $ORGO_API_KEY`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalid-key:
              summary: The key is not one of yours
              value:
                error: Invalid API key
            no-credential:
              summary: No key and no session
              value:
                error: Authentication required
    AccessDenied:
      description: >-
        You are not the owner or a member of the computer's workspace, you have
        view-only access, or the API key is scoped to another workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            no-access:
              summary: Not the owner or a member of the workspace
              value:
                error: You do not have access to this workspace.
            view-only:
              summary: View-only member, and the request changes something
              value:
                error: >-
                  This workspace is view-only. Ask the owner for write access
                  (workspace_read_only).
            scope-mismatch:
              summary: The API key is scoped to another workspace
              value:
                error: >-
                  This API key cannot access this workspace
                  (workspace_scope_mismatch).
    NotFound:
      description: No computer with this id on your account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Desktop not found
    AuthUnavailable:
      description: >-
        Orgo could not verify the credential because of a server-side fault,
        such as a database outage. Retry after `Retry-After`. Do not rotate the
        key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: >-
              Service temporarily unavailable. The database is not accepting
              requests. Retry shortly.
      headers:
        Retry-After:
          description: Seconds to wait before retrying. Always `5`.
          schema:
            type: string
            example: '5'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication. Get your key at orgo.ai/workspaces

````

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