Skip to main content
POST
Extend computer
Adds hours to the end a computer already has. The computer keeps running, and it is deleted at its new end. Update computer sets an end counted from now, so "ends_in_hours": 24 on a computer with three days left shortens it to one day. Extend adds to what is left, so it only ever lengthens, and it can take the end further out: up to 90 days from now, where Update computer stops at 30.
Extending does not keep a computer for good. When the new end comes, the computer is deleted with everything on it. To keep it, take the end off with Update computer and "ends_at": null.
Extending needs write access to the workspace. Only a computer that has an end can be extended.

Headers

string
required
8 to 255 printable characters, such as a UUID. Required, because repeating this call would otherwise add the time twice. Send a new key for each extend, and the same key when you retry one. Retries has the rules.

Path parameters

string
required
Computer ID. Accepts the computer’s UUID or its instance_id.

Body

integer
required
Hours to add, a whole number from 1 to 2160. The new end is the current ends_at plus hours. If ends_at has just passed and the computer has not been deleted yet, it is now plus hours. The new end can be at most 2160 hours (90 days) from now.

How extending is billed

A computer on the plan is paid for by the plan. Only its end moves, and nothing is prepaid. On a computer that runs by the hour and is running, the prepay follows the new end in the same step, as it does on Update computer. What the old prepay has not used comes back and the run to the new end is held, so it needs only the extra. When your credit cannot cover the extra plus an hour of your other hourly computers that are not prepaid, the request returns 402 and nothing changes. Only the workspace owner can prepay. On a paid plan the owner must also be signed in, or use a key with Billing write. A caller who may not prepay but has write access still moves the end: nothing more is held, the time past the old prepay is billed by the hour, and the answer carries prepay_warning. An hourly computer that is stopped keeps its new end and stays billed by the hour, with no prepay.

Retries

  • A retry with the same key and body gets the first answer back with the header Idempotent-Replayed: true. Nothing more is added or held.
  • A refused request changes nothing and frees its key, so you can send the same key again once the reason is fixed, for example after adding credit.
  • The same key with another body returns 422.
  • A retry while the first is still running returns 409 with code idempotency_in_progress. Try again in a few seconds.
  • A request that did not finish returns 409 with code idempotency_unfinished on its retry, because the end may have moved. Read the computer with Get computer before you try again with a new key.
Keys last a day.

Response

string
Computer identifier (UUID).
string
Computer name.
string
The new end, as an ISO 8601 time.
string
Read only: "delete". An extended computer is deleted at its new end, also if its old end would have stopped it.
string | null
null.
string
When Orgo deletes the computer, which is ends_at.
string | null
On a computer that runs by the hour. When its prepaid run ends now, or null when its time is not prepaid.
integer | null
Present alongside prepaid_until. What is held from your credits for the run now, in cents. null when prepaid_until is.
integer
Present when some of the earlier prepay came back to your credits, in cents.
string
Present when the end moved but its time was not prepaid.

Example

Add 30 days to an hourly Medium ($0.055 an hour) that has 10 days left.

Errors

Authorizations

Authorization
string
header
required

API key authentication. Get your key at orgo.ai/workspaces

Headers

Idempotency-Key
string
required

8 to 255 printable characters, such as a UUID. A retry with the same key and body gets the first answer back and adds nothing. A refused request frees its key. Keys last a day.

Required string length: 8 - 255

Path Parameters

id
string
required

Computer ID. Accepts the computer's UUID or its instance_id.

Body

application/json
hours
integer
required

Hours to add to the end the computer has.

Required range: 1 <= x <= 2160
Example:

720

Response

The end moved. Same fields as changing the end with Update computer: id, name, ends_at, on_end, ended_at and deletes_at, and on an hourly computer prepaid_until, prepaid_cents, and when they apply prepay_returned_cents and prepay_warning.