Computers
Move computer
Move a computer to a different workspace while preserving its state and ID.
PATCH
/
computers
/
{id}
/
move
Move computer to another workspace
curl --request PATCH \
--url https://www.orgo.ai/api/computers/{id}/move \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": "<string>",
"project_id": "<string>"
}
'import requests
url = "https://www.orgo.ai/api/computers/{id}/move"
payload = {
"workspace_id": "<string>",
"project_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({workspace_id: '<string>', project_id: '<string>'})
};
fetch('https://www.orgo.ai/api/computers/{id}/move', 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://www.orgo.ai/api/computers/{id}/move",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'workspace_id' => '<string>',
'project_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.orgo.ai/api/computers/{id}/move"
payload := strings.NewReader("{\n \"workspace_id\": \"<string>\",\n \"project_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://www.orgo.ai/api/computers/{id}/move")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": \"<string>\",\n \"project_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.orgo.ai/api/computers/{id}/move")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspace_id\": \"<string>\",\n \"project_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"workspace_id": "<string>",
"project_id": "<string>"
}{
"error": "Invalid API key"
}{
"error": "Access denied"
}{
"error": "Resource not found"
}Moves a computer to a different workspace within your account. The computer keeps its state, configuration, and ID - only its parent workspace changes. You must own both the source and destination workspaces.
Path parameters
string
required
Computer UUID.
Body parameters
string
required
ID of the destination workspace. Must be owned by the same user. (Workspaces are still referred to as
project_id on this endpoint for backwards compatibility.)Response
boolean
true if the move succeeded.string
The destination workspace ID.
Example
curl -X PATCH https://www.orgo.ai/api/computers/a3bb189e-8bf9-3888-9912-ace4e6543002/move \
-H "Authorization: Bearer $ORGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"project_id": "550e8400-e29b-41d4-a716-446655440099"}'
import requests
response = requests.patch(
f"https://www.orgo.ai/api/computers/{computer_id}/move",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
},
json={"project_id": target_workspace_id}
)
print(response.json())
const response = await fetch(`https://www.orgo.ai/api/computers/${computerId}/move`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ project_id: targetWorkspaceId })
});
console.log(await response.json());
Response
{
"success": true,
"project_id": "550e8400-e29b-41d4-a716-446655440099"
}
Errors
| Status | Meaning |
|---|---|
400 | project_id missing, or the computer is already in that workspace. |
401 | Missing or invalid API key. |
403 | You do not own the source and/or destination workspace. |
404 | Computer not found. |
500 | Internal error while updating the database. |
Authorizations
API key authentication. Get your key at orgo.ai/workspaces
Path Parameters
Computer ID
Body
application/json
⌘I
Move computer to another workspace
curl --request PATCH \
--url https://www.orgo.ai/api/computers/{id}/move \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": "<string>",
"project_id": "<string>"
}
'import requests
url = "https://www.orgo.ai/api/computers/{id}/move"
payload = {
"workspace_id": "<string>",
"project_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({workspace_id: '<string>', project_id: '<string>'})
};
fetch('https://www.orgo.ai/api/computers/{id}/move', 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://www.orgo.ai/api/computers/{id}/move",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'workspace_id' => '<string>',
'project_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.orgo.ai/api/computers/{id}/move"
payload := strings.NewReader("{\n \"workspace_id\": \"<string>\",\n \"project_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://www.orgo.ai/api/computers/{id}/move")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": \"<string>\",\n \"project_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.orgo.ai/api/computers/{id}/move")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspace_id\": \"<string>\",\n \"project_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"workspace_id": "<string>",
"project_id": "<string>"
}{
"error": "Invalid API key"
}{
"error": "Access denied"
}{
"error": "Resource not found"
}