Set a personal secret
curl --request PUT \
--url https://sailbox-api.sailresearch.com/v1/user/secrets/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "token-from-your-service"
}
'import requests
url = "https://sailbox-api.sailresearch.com/v1/user/secrets/{name}"
payload = { "value": "token-from-your-service" }
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({value: 'token-from-your-service'})
};
fetch('https://sailbox-api.sailresearch.com/v1/user/secrets/{name}', 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://sailbox-api.sailresearch.com/v1/user/secrets/{name}",
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([
'value' => 'token-from-your-service'
]),
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://sailbox-api.sailresearch.com/v1/user/secrets/{name}"
payload := strings.NewReader("{\n \"value\": \"token-from-your-service\"\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://sailbox-api.sailresearch.com/v1/user/secrets/{name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"token-from-your-service\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sailbox-api.sailresearch.com/v1/user/secrets/{name}")
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 \"value\": \"token-from-your-service\"\n}"
response = http.request(request)
puts response.read_body{
"org_id": "org_1a2b3c",
"name": "GITHUB_TOKEN",
"visibility": "personal",
"owner_user_id": "user_4d5e6f",
"created_at": "2026-08-20T09:30:00Z",
"updated_at": "2026-08-20T09:30:00Z"
}{
"error": {
"message": "value is required",
"type": "invalid_request_error",
"param": null,
"code": null
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error",
"param": null,
"code": "invalid_api_key"
}
}{
"error": {
"message": "Your API key has been disabled due to insufficient credits. Visit https://app.sailresearch.com/billing to add credits.",
"type": "billing_error",
"param": null,
"code": "credits_exhausted",
"billing_url": "https://app.sailresearch.com/billing"
}
}{
"error": {
"message": "personal secrets require a credential that belongs to a user",
"type": "permission_error",
"param": null,
"code": null
}
}{
"error": {
"message": "request body too large",
"type": "invalid_request_error",
"param": null,
"code": null
}
}{
"error": {
"message": "you are limited to 100 personal secrets in this organization",
"type": "quota_exceeded_error",
"param": null,
"code": null
}
}{
"error": {
"message": "set secret failed",
"type": "server_error",
"param": null,
"code": null
}
}{
"error": {
"message": "Authentication service unavailable",
"type": "server_error",
"param": null,
"code": null
}
}Secrets
Set a personal secret
Creates a personal secret that belongs to you in this organization, or replaces its value when you already have one with that name. Only you can set, replace, or delete it, and Sail never returns the stored value. Sail uses it only in private Sailboxes you created, in place of the organization secret with the same name. After this call succeeds, the next matching request from any of those Sailboxes gets the new value. See Personal secrets.
PUT
/
user
/
secrets
/
{name}
Set a personal secret
curl --request PUT \
--url https://sailbox-api.sailresearch.com/v1/user/secrets/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "token-from-your-service"
}
'import requests
url = "https://sailbox-api.sailresearch.com/v1/user/secrets/{name}"
payload = { "value": "token-from-your-service" }
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({value: 'token-from-your-service'})
};
fetch('https://sailbox-api.sailresearch.com/v1/user/secrets/{name}', 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://sailbox-api.sailresearch.com/v1/user/secrets/{name}",
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([
'value' => 'token-from-your-service'
]),
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://sailbox-api.sailresearch.com/v1/user/secrets/{name}"
payload := strings.NewReader("{\n \"value\": \"token-from-your-service\"\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://sailbox-api.sailresearch.com/v1/user/secrets/{name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"token-from-your-service\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sailbox-api.sailresearch.com/v1/user/secrets/{name}")
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 \"value\": \"token-from-your-service\"\n}"
response = http.request(request)
puts response.read_body{
"org_id": "org_1a2b3c",
"name": "GITHUB_TOKEN",
"visibility": "personal",
"owner_user_id": "user_4d5e6f",
"created_at": "2026-08-20T09:30:00Z",
"updated_at": "2026-08-20T09:30:00Z"
}{
"error": {
"message": "value is required",
"type": "invalid_request_error",
"param": null,
"code": null
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error",
"param": null,
"code": "invalid_api_key"
}
}{
"error": {
"message": "Your API key has been disabled due to insufficient credits. Visit https://app.sailresearch.com/billing to add credits.",
"type": "billing_error",
"param": null,
"code": "credits_exhausted",
"billing_url": "https://app.sailresearch.com/billing"
}
}{
"error": {
"message": "personal secrets require a credential that belongs to a user",
"type": "permission_error",
"param": null,
"code": null
}
}{
"error": {
"message": "request body too large",
"type": "invalid_request_error",
"param": null,
"code": null
}
}{
"error": {
"message": "you are limited to 100 personal secrets in this organization",
"type": "quota_exceeded_error",
"param": null,
"code": null
}
}{
"error": {
"message": "set secret failed",
"type": "server_error",
"param": null,
"code": null
}
}{
"error": {
"message": "Authentication service unavailable",
"type": "server_error",
"param": null,
"code": null
}
}Authorizations
Path Parameters
Secret name. It starts with a letter or number and contains only letters, numbers, underscores, and dashes, up to 128 characters. Surrounding whitespace is ignored.
Pattern:
^[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*[A-Za-z0-9][A-Za-z0-9_-]{0,127}[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$Body
application/json
Response
The secret metadata.