Ask for a code to link your phone
curl --request POST \
--url https://api.runaether.dev/agent/phone/verification \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"timezone": "<string>"
}
'import requests
url = "https://api.runaether.dev/agent/phone/verification"
payload = { "timezone": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({timezone: '<string>'})
};
fetch('https://api.runaether.dev/agent/phone/verification', 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/agent/phone/verification",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'timezone' => '<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/agent/phone/verification"
payload := strings.NewReader("{\n \"timezone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.runaether.dev/agent/phone/verification")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/agent/phone/verification")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"line_e164": "<string>",
"refusal": "phone_linked_to_another_account"
}{
"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>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Agent
Ask for a code to link your phone
Gives the caller a code to text, alone, to the line it names from the phone they link, valid for ten minutes.
Use this tool when you need to:
- Link the caller's phone so their texts reach their agent, creating the agent if they have none
- Replace the verified phone with another, or get a fresh code once the last one expired
Examples:
- POST /agent/phone/verification {"timezone": "America/New_York"}
Hints:
- timezone is required, the caller's IANA timezone as their browser names it (1 to 64 characters); one the tz database does not know is refused with 400.
- Answers 201 with code, line_e164 and expires_at; the code replaces any the caller had.
- The text links that phone, replacing the one verified, and sets the agent's timezone to the one sent, creating the agent if the caller has none. A phone another account verified is not linked: the code's refusal then says so.
- Use getAgentPhone instead to read the verified phone and the live code without replacing the code.
- Any signed-in user on the personal agent allowlist: refused with 403 agent_host_not_allowlisted otherwise, 409 agent_host_account_deleting once the account is being deleted and 503 agent_line_unavailable while no line is set up.
POST
/
agent
/
phone
/
verification
Ask for a code to link your phone
curl --request POST \
--url https://api.runaether.dev/agent/phone/verification \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"timezone": "<string>"
}
'import requests
url = "https://api.runaether.dev/agent/phone/verification"
payload = { "timezone": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({timezone: '<string>'})
};
fetch('https://api.runaether.dev/agent/phone/verification', 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/agent/phone/verification",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'timezone' => '<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/agent/phone/verification"
payload := strings.NewReader("{\n \"timezone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.runaether.dev/agent/phone/verification")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/agent/phone/verification")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"line_e164": "<string>",
"refusal": "phone_linked_to_another_account"
}{
"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>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Your IANA timezone, such as America/New_York, as your browser names it: your agent runs in it once the phone is linked.
Required string length:
1 - 64Response
Created
Text it, alone, to line_e164 from the phone to link.
Pattern:
^[A-HJ-NP-Z2-9]{6}$When the code stops working; ask for a new one then.
The number to text the code to, in E.164.
Why the last text of the code linked nothing: phone_linked_to_another_account, the phone is another account's; not_allowlisted, your account is not on the personal agent allowlist.
Available options:
phone_linked_to_another_account, not_allowlisted