Stop a workspace
curl --request POST \
--url https://api.runaether.dev/workspaces/{workspaceID}/stop \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.runaether.dev/workspaces/{workspaceID}/stop"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.runaether.dev/workspaces/{workspaceID}/stop', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runaether.dev/workspaces/{workspaceID}/stop",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.runaether.dev/workspaces/{workspaceID}/stop"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.runaether.dev/workspaces/{workspaceID}/stop")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/workspaces/{workspaceID}/stop")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"display_state": "deleted",
"hardware": {
"cpu_kind": "shared",
"cpus": 8,
"gpu_kind": "a10",
"memory_mb": 16512,
"volume_size_gb": 250
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"keep_active": true,
"previews": [
{
"name": "<string>",
"port": 32768,
"url": "<string>"
}
],
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startable": true,
"updated_at": "2023-11-07T05:31:56Z",
"vm_size": "small",
"error_message": "<string>",
"git_ref": "<string>",
"last_accessed_at": "2023-11-07T05:31:56Z",
"last_shutdown_at": "2023-11-07T05:31:56Z",
"last_started_at": "2023-11-07T05:31:56Z",
"machine_id": "<string>",
"private_ip": "<string>",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "org_membership_required",
"error": "<string>"
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Workspaces
Stop a workspace
Stops the workspace’s machine and answers 200 with the workspace as the stop left it, usually stopping.
Use this tool when you need to:
- Stop a running workspace and keep it to start again later
- Stop a workspace that errored but still has its machine
Examples:
- POST /workspaces//stop
- POST /workspaces/6f1c2a9e-3b7d-4c55-9a2e-0d8b1f4e7c21/stop
Hints:
- workspaceID is the workspace’s uuid (422 otherwise); takes no body.
- A ready, preparing or errored workspace with a machine is stopped; one already stopping answers with that stop. The stop finishes in the background: getWorkspace shows the state it settles in.
- Refused with 409 for a workspace with no machine, one that is not running (any other state), or one with a lifecycle operation in flight.
- Use connectTask on its task instead, with start_sandbox=true, to start it again; use deleteWorkspace to remove it with its machine.
- The workspace’s creator, or an owner or admin of its organization; another member is refused with 403 control_forbidden, a viewer or billing member with 403 org_role_insufficient, a suspended organization with 403 org_suspended, a workspace the caller cannot see is 404, and 503 when the membership check is unavailable. An agent host’s grant is refused with 403 agent_host_route_not_allowed.
POST
/
workspaces
/
{workspaceID}
/
stop
Stop a workspace
curl --request POST \
--url https://api.runaether.dev/workspaces/{workspaceID}/stop \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.runaether.dev/workspaces/{workspaceID}/stop"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.runaether.dev/workspaces/{workspaceID}/stop', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runaether.dev/workspaces/{workspaceID}/stop",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.runaether.dev/workspaces/{workspaceID}/stop"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.runaether.dev/workspaces/{workspaceID}/stop")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/workspaces/{workspaceID}/stop")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"display_state": "deleted",
"hardware": {
"cpu_kind": "shared",
"cpus": 8,
"gpu_kind": "a10",
"memory_mb": 16512,
"volume_size_gb": 250
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"keep_active": true,
"previews": [
{
"name": "<string>",
"port": 32768,
"url": "<string>"
}
],
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startable": true,
"updated_at": "2023-11-07T05:31:56Z",
"vm_size": "small",
"error_message": "<string>",
"git_ref": "<string>",
"last_accessed_at": "2023-11-07T05:31:56Z",
"last_shutdown_at": "2023-11-07T05:31:56Z",
"last_started_at": "2023-11-07T05:31:56Z",
"machine_id": "<string>",
"private_ip": "<string>",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "org_membership_required",
"error": "<string>"
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Authorizations
Response
OK