Update account data-retention policy
Enable or disable account zero data retention using a sandbox session.
curl --request PATCH \
--url https://boat.dev/api/v1/account/data-retention \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"snapshotsOff": true,
"confirmation": "delete archived sandbox data"
}
'import requests
url = "https://boat.dev/api/v1/account/data-retention"
payload = {
"enabled": True,
"snapshotsOff": True,
"confirmation": "delete archived sandbox data"
}
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({
enabled: true,
snapshotsOff: true,
confirmation: 'delete archived sandbox data'
})
};
fetch('https://boat.dev/api/v1/account/data-retention', 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://boat.dev/api/v1/account/data-retention",
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([
'enabled' => true,
'snapshotsOff' => true,
'confirmation' => 'delete archived sandbox data'
]),
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://boat.dev/api/v1/account/data-retention"
payload := strings.NewReader("{\n \"enabled\": true,\n \"snapshotsOff\": true,\n \"confirmation\": \"delete archived sandbox data\"\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://boat.dev/api/v1/account/data-retention")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"snapshotsOff\": true,\n \"confirmation\": \"delete archived sandbox data\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://boat.dev/api/v1/account/data-retention")
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 \"enabled\": true,\n \"snapshotsOff\": true,\n \"confirmation\": \"delete archived sandbox data\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"type": "data_retention.info",
"enabled": true,
"enabledAt": "2023-11-07T05:31:56Z",
"queuedSandboxes": 1,
"acceptedDeletionOperationsIrreversible": true,
"snapshotsOff": true,
"snapshotsOffAt": "2023-11-07T05:31:56Z"
}{
"ok": false,
"type": "sandbox.error",
"status": 400,
"code": "invalid_json",
"message": "Request body must be valid JSON.",
"error": {
"code": "invalid_json",
"message": "Request body must be valid JSON.",
"status": 400
},
"requestId": "req_01HX..."
}{
"ok": false,
"type": "sandbox.error",
"status": 401,
"code": "unauthorized",
"message": "Unauthorized",
"error": {
"code": "unauthorized",
"message": "Unauthorized",
"status": 401
},
"requestId": "req_01HX..."
}{
"ok": false,
"type": "sandbox.error",
"status": 403,
"code": "forbidden",
"message": "Forbidden",
"error": {
"code": "forbidden",
"message": "Forbidden",
"status": 403
},
"requestId": "req_01HX..."
}{
"ok": false,
"type": "sandbox.error",
"status": 409,
"code": "provider_not_configured",
"message": "Prompting is locked until Codex is configured on the Agents page.",
"requestId": "req_01HX...",
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
}
}Authorizations
Boat bearer token in the form boat_.... Service API keys authenticate sandbox operations.
Body
Pass enabled to change zero data retention, or snapshotsOff alone to change the account's snapshots-off setting.
Turn snapshots off for every sandbox created from now on. Existing sandboxes keep their setting. While on, a create or fork that passes snapshots: true is refused with 409 snapshots_off_for_account.
Required when enabling and must exactly equal delete archived sandbox data.
"delete archived sandbox data"Response
Updated retention policy. Responses are never cached.
true
Stable success envelope discriminator added by v1.
data_retention.info, data_retention.updated Archived Sandboxes newly queued for deletion by this policy update.
x >= 0Always true on updates. Disabling the policy does not cancel accepted deletion operations.
When true, every new sandbox of this account is created with snapshots off.
curl --request PATCH \
--url https://boat.dev/api/v1/account/data-retention \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"snapshotsOff": true,
"confirmation": "delete archived sandbox data"
}
'import requests
url = "https://boat.dev/api/v1/account/data-retention"
payload = {
"enabled": True,
"snapshotsOff": True,
"confirmation": "delete archived sandbox data"
}
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({
enabled: true,
snapshotsOff: true,
confirmation: 'delete archived sandbox data'
})
};
fetch('https://boat.dev/api/v1/account/data-retention', 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://boat.dev/api/v1/account/data-retention",
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([
'enabled' => true,
'snapshotsOff' => true,
'confirmation' => 'delete archived sandbox data'
]),
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://boat.dev/api/v1/account/data-retention"
payload := strings.NewReader("{\n \"enabled\": true,\n \"snapshotsOff\": true,\n \"confirmation\": \"delete archived sandbox data\"\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://boat.dev/api/v1/account/data-retention")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"snapshotsOff\": true,\n \"confirmation\": \"delete archived sandbox data\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://boat.dev/api/v1/account/data-retention")
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 \"enabled\": true,\n \"snapshotsOff\": true,\n \"confirmation\": \"delete archived sandbox data\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"type": "data_retention.info",
"enabled": true,
"enabledAt": "2023-11-07T05:31:56Z",
"queuedSandboxes": 1,
"acceptedDeletionOperationsIrreversible": true,
"snapshotsOff": true,
"snapshotsOffAt": "2023-11-07T05:31:56Z"
}{
"ok": false,
"type": "sandbox.error",
"status": 400,
"code": "invalid_json",
"message": "Request body must be valid JSON.",
"error": {
"code": "invalid_json",
"message": "Request body must be valid JSON.",
"status": 400
},
"requestId": "req_01HX..."
}{
"ok": false,
"type": "sandbox.error",
"status": 401,
"code": "unauthorized",
"message": "Unauthorized",
"error": {
"code": "unauthorized",
"message": "Unauthorized",
"status": 401
},
"requestId": "req_01HX..."
}{
"ok": false,
"type": "sandbox.error",
"status": 403,
"code": "forbidden",
"message": "Forbidden",
"error": {
"code": "forbidden",
"message": "Forbidden",
"status": 403
},
"requestId": "req_01HX..."
}{
"ok": false,
"type": "sandbox.error",
"status": 409,
"code": "provider_not_configured",
"message": "Prompting is locked until Codex is configured on the Agents page.",
"requestId": "req_01HX...",
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
}
}