curl --request POST \
--url https://api.cool.computer/api/computers/{id}/emails/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "jsmith@example.com",
"subject": "<string>",
"text": "<string>",
"html": "<string>"
}
'import requests
url = "https://api.cool.computer/api/computers/{id}/emails/send"
payload = {
"to": "jsmith@example.com",
"subject": "<string>",
"text": "<string>",
"html": "<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({
to: 'jsmith@example.com',
subject: '<string>',
text: '<string>',
html: '<string>'
})
};
fetch('https://api.cool.computer/api/computers/{id}/emails/send', 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.cool.computer/api/computers/{id}/emails/send",
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([
'to' => 'jsmith@example.com',
'subject' => '<string>',
'text' => '<string>',
'html' => '<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.cool.computer/api/computers/{id}/emails/send"
payload := strings.NewReader("{\n \"to\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"html\": \"<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.cool.computer/api/computers/{id}/emails/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"html\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/computers/{id}/emails/send")
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 \"to\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"html\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"direction": "inbound",
"status": "received",
"from": "<string>",
"envelope_from": "<string>",
"to": [
"<string>"
],
"subject": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"sender_authentication": "<string>",
"authenticated_sender": "<string>",
"text": "<string>",
"html": "<string>",
"message_id": "<string>",
"in_reply_to": "<string>",
"error": "<string>",
"read_at": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}Send computer email
Immediately sends a real email from the computer’s stable inbox address. Call this only after the user approves the recipient and content, and send an Idempotency-Key so a network retry cannot send it twice.
curl --request POST \
--url https://api.cool.computer/api/computers/{id}/emails/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "jsmith@example.com",
"subject": "<string>",
"text": "<string>",
"html": "<string>"
}
'import requests
url = "https://api.cool.computer/api/computers/{id}/emails/send"
payload = {
"to": "jsmith@example.com",
"subject": "<string>",
"text": "<string>",
"html": "<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({
to: 'jsmith@example.com',
subject: '<string>',
text: '<string>',
html: '<string>'
})
};
fetch('https://api.cool.computer/api/computers/{id}/emails/send', 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.cool.computer/api/computers/{id}/emails/send",
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([
'to' => 'jsmith@example.com',
'subject' => '<string>',
'text' => '<string>',
'html' => '<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.cool.computer/api/computers/{id}/emails/send"
payload := strings.NewReader("{\n \"to\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"html\": \"<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.cool.computer/api/computers/{id}/emails/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"html\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/computers/{id}/emails/send")
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 \"to\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"html\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"direction": "inbound",
"status": "received",
"from": "<string>",
"envelope_from": "<string>",
"to": [
"<string>"
],
"subject": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"sender_authentication": "<string>",
"authenticated_sender": "<string>",
"text": "<string>",
"html": "<string>",
"message_id": "<string>",
"in_reply_to": "<string>",
"error": "<string>",
"read_at": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}Authorizations
A Cool Computers API key, user access token, or claimed agent access token in the Authorization header. Follow https://www.cool.computer/auth.md for agent registration and https://www.cool.computer/authentication.md for direct user credentials.
Headers
A caller-generated key for safely retrying this side effect. The server retains the key and response for 24 hours. Reusing it with the same request replays the original response; reusing it with different input returns 409.
1 - 128^[!-~]+$"req_01J6M6Y9TF9Q9QF6M1ZP8K4R2A"
Path Parameters
Stable public computer identifier.
1"cmp_123"
Body
Response
One inbound or outbound email.
inbound, outbound received, pending, sent, failed, ambiguous, rejected 
