---
title: "Rename a computer, or set when it ends"
method: PATCH
path: "/api/computers/{id}"
tags: ["computers"]
---

# Rename a computer, or set when it ends

`PATCH /api/computers/{id}`

## Request

- Base URL: `https://www.orgo.ai`
- URL: `https://www.orgo.ai/api/computers/{id}`
- Auth: HTTP bearer

Body: name, bot_mascot, and the end: ends_at (ISO 8601, in the future, at most 720 hours away), ends_in_hours (1 to 720), or ends_at null to keep it forever (send one of the two). When the end is up the computer is deleted: every end set or moved here deletes it, on a computer whose end was set before this rule (on_end "stop") too. on_end is not a choice: "delete" is accepted and changes nothing (alone, it needs a computer with an end: 400 INVALID_ENDS when there is none), and any other value ("stop" included) is 400 INVALID_ENDS. Changing the end needs write access to the workspace and clears a stopped computer’s ended mark. Only Linux and Windows computers can have an end. A running hourly computer prepays its run to the new end: a later end holds the extra (402 when the credit is short, an hour of the owner’s other hourly computers kept, nothing changed), an earlier one gives back what is past it, and ends_at null gives back what it has not used and bills it by the hour again. Only the workspace owner prepays a later end, and on a paid plan only signed in or with a key that has Billing write; anyone else who may write the workspace still moves the end, nothing more is held, the time past what is prepaid is billed by the hour, and the answer says prepay_warning. The answer carries prepaid_until, prepaid_cents and, when credit reached the balance, prepay_returned_cents: what reached it, which after a monthly credit refresh can be less than the unused part, or nothing.

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string
  - `ends_at` string, date-time, nullable
  - `ends_in_hours` integer, nullable
  - `on_end` 'delete' | 'null', nullable: Not a choice: a computer with an end is deleted when its time is up, running or not, with everything on it. "delete" is accepted and changes nothing; omitted or null is the same. Any other value, "stop" included, is 400 INVALID_ENDS: "A computer with an end is deleted when its time is up. To keep a computer, leave out the end." On a computer (GET, the listing, and the create, PATCH, Start and Resume answers) on_end is read only: "delete", "stop" for a computer whose end was set before this rule (stopped then, and deleted 7 days later unless it is started), or null with no end.

## Response `200`

The computer’s id and name, and ends_at, ended_at, deletes_at and on_end (read only) when the end changed or only the end was sent (an hourly computer: prepaid_until, prepaid_cents, prepay_returned_cents, and prepay_warning when a later end was not prepaid).

## Other responses

- `400`: INVALID_ENDS (a time in the past, past 720 hours, both fields, an on_end other than "delete", or on_end alone for a computer with no end) or ENDS_NOT_SUPPORTED (not a Linux or Windows computer).
- `402`: insufficient_credit: a later end on an hourly computer needs more credit than there is: error, needed_cents (the extra, plus keep_cents for an hour of the owner’s other hourly computers) and available_cents. Nothing changed.
- `403`: View only access (workspace_read_only).
- `409`: COMPUTER_BUSY (retryable): an operation (a Stop, a Start, or the end itself) holds the computer, so its end did not change.
- `429`: Over one of the account's rate limits (rate_limited): `limit` names it, `retry_after` and Retry-After say how many seconds to wait. Limits are per account (the workspace owner when the request acts on a computer or a workspace) and set by its plan (x-rate-limits).
- `503`: ENDS_UNAVAILABLE: ends are not set up yet, or on_end was sent where an end still stops the computer.

## Changes

- **2026-10-30** `afb6f0ee1aac`: 2 info
  - added the new optional request property `on_end`
  - added the non-success response with the status `429`
- **2026-10-28** `b4913b379821`: 1 info
  - added the non-success response with the status `402`
- **2026-10-27** `f19180c8e614`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/orgo/apis/orgo-api/changes/api/computers/:id/patch.md)

---

[API](https://skmtc.dev/orgo/apis/orgo-api.md) - [All operations](https://skmtc.dev/orgo/apis/orgo-api/llms.txt) - [OpenAPI document](https://skmtc.dev/orgo/apis/orgo-api/revisions/e4c1e7379fa5?raw)
