Register a computer
curl --request PUT \
--url https://api.runaether.dev/computers/{computerID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"secret": "<string>"
}
'import requests
url = "https://api.runaether.dev/computers/{computerID}"
payload = {
"name": "<string>",
"secret": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', secret: '<string>'})
};
fetch('https://api.runaether.dev/computers/{computerID}', 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/computers/{computerID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'secret' => '<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://api.runaether.dev/computers/{computerID}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"secret\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.runaether.dev/computers/{computerID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/computers/{computerID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"agent_starts": {
"state": "off"
},
"agents": [
{
"agent_type": "<string>",
"label": "<string>",
"problem": {
"code": "<string>",
"message": "<string>"
},
"version": "<string>"
}
],
"bridge": {
"problem": {
"code": "computer_needs_setup",
"message": "<string>"
},
"version": "<string>"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_seen_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"reachable": true,
"registered_at": "2023-11-07T05:31:56Z",
"remote_changes": {
"state": "off"
},
"set_up_at": "2023-11-07T05:31:56Z"
}{
"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>"
}
]
}Computers
Register a computer
Registers the computer the caller runs aether setup on, under the id its CLI chose and keeps, with a name: the host name unless they chose another.
Use this tool when you need to:
- Register this computer so that work-tree tasks can live in its checkouts
- Name this computer again after registering it
Examples:
- PUT /computers/{computerID} {"name": "Ada's MacBook Pro", "secret": "<the 64 hex characters aether setup made>"}
- PUT /computers/0f3c9d2a-6b1e-4c7d-8a5f-2e9b1d4c6a08 {"name": "studio"}, with the computer's secret in Aether-Computer-Secret
Hints:
- computerID is a lowercase uuid the CLI chose once on the computer; registering the same id again is idempotent: it keeps the computer, sets its name and records it seen, and answers 200 with it.
- name is 1 to 100 characters with no surrounding space, no control or format character and no "://"; another is refused with 422.
- An id another person registered is refused with 409 computer_registered_to_another_person.
- secret, 64 lower-case hex characters, is the computer's own secret, which aether setup makes and keeps on it; the API keeps only its hash, and set_up_at says when it was set. Only a secret in the body makes a computer or sets the secret of one that has none, and only under a sign-in that began at most 15 minutes earlier: an older one is refused with 403 computer_needs_fresh_sign_in, and nothing is stored. A registration that sets the secret e-mails the person, whatever their notification settings say.
- A registration whose body carries no secret presents the one in its Aether-Computer-Secret header, as every call that names the computer does. It makes no computer and sets no secret: a new computer, or one that has no secret, is refused with 403 computer_needs_setup, and nothing is stored.
- For a computer that has a secret, under a sign-in of any age, the same secret, in the body or the header, is answered as the registration that set it was; another, or none, is refused with 403 computer_set_up_elsewhere.
- Only the grant of the caller's coding agent's bridge registers a computer, a write grant: a session or an API key is refused with 403 credential_kind_not_admitted, and a read grant with 403 grant_scope_insufficient.
PUT
/
computers
/
{computerID}
Register a computer
curl --request PUT \
--url https://api.runaether.dev/computers/{computerID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"secret": "<string>"
}
'import requests
url = "https://api.runaether.dev/computers/{computerID}"
payload = {
"name": "<string>",
"secret": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', secret: '<string>'})
};
fetch('https://api.runaether.dev/computers/{computerID}', 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/computers/{computerID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'secret' => '<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://api.runaether.dev/computers/{computerID}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"secret\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.runaether.dev/computers/{computerID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/computers/{computerID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"agent_starts": {
"state": "off"
},
"agents": [
{
"agent_type": "<string>",
"label": "<string>",
"problem": {
"code": "<string>",
"message": "<string>"
},
"version": "<string>"
}
],
"bridge": {
"problem": {
"code": "computer_needs_setup",
"message": "<string>"
},
"version": "<string>"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_seen_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"reachable": true,
"registered_at": "2023-11-07T05:31:56Z",
"remote_changes": {
"state": "off"
},
"set_up_at": "2023-11-07T05:31:56Z"
}{
"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
Path Parameters
Body
application/json
Response
OK