Account & setup
Update Box secrets setup
POST
/
secrets
Update Box secrets setup
curl --request POST \
--url https://ascii.dev/api/box/v1/secrets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"envContents": "<string>",
"secretFiles": [
{
"path": "<string>",
"contents": "<string>"
}
]
}
'import requests
url = "https://ascii.dev/api/box/v1/secrets"
payload = {
"envContents": "<string>",
"secretFiles": [
{
"path": "<string>",
"contents": "<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({
envContents: '<string>',
secretFiles: [{path: '<string>', contents: '<string>'}]
})
};
fetch('https://ascii.dev/api/box/v1/secrets', 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://ascii.dev/api/box/v1/secrets",
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([
'envContents' => '<string>',
'secretFiles' => [
[
'path' => '<string>',
'contents' => '<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://ascii.dev/api/box/v1/secrets"
payload := strings.NewReader("{\n \"envContents\": \"<string>\",\n \"secretFiles\": [\n {\n \"path\": \"<string>\",\n \"contents\": \"<string>\"\n }\n ]\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://ascii.dev/api/box/v1/secrets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"envContents\": \"<string>\",\n \"secretFiles\": [\n {\n \"path\": \"<string>\",\n \"contents\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ascii.dev/api/box/v1/secrets")
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 \"envContents\": \"<string>\",\n \"secretFiles\": [\n {\n \"path\": \"<string>\",\n \"contents\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"type": "secrets.updated",
"success": true,
"environmentId": "env_123",
"envContents": "OPENAI_API_KEY=sk-...\n",
"secretFiles": [],
"pushed": {
"updated": 2,
"failed": 0
}
}{
"ok": false,
"type": "box.error",
"status": 401,
"code": "unauthorized",
"message": "Unauthorized",
"error": {
"code": "unauthorized",
"message": "Unauthorized",
"status": 401
},
"requestId": "req_01HX..."
}Authorizations
Box bearer token in the form box_.... Service API keys authenticate Box operations.
Body
application/json
Full replacement for the Box secret setup. Omitted envContents or secretFiles are treated as empty values, and successful updates are pushed to active Boxes.
Response
Updated secret setup metadata.
Example:
true
Stable success envelope discriminator added by v1.
Show child attributes
Show child attributes
Present on update; counts how many active Boxes received the new environment.
⌘I
Update Box secrets setup
curl --request POST \
--url https://ascii.dev/api/box/v1/secrets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"envContents": "<string>",
"secretFiles": [
{
"path": "<string>",
"contents": "<string>"
}
]
}
'import requests
url = "https://ascii.dev/api/box/v1/secrets"
payload = {
"envContents": "<string>",
"secretFiles": [
{
"path": "<string>",
"contents": "<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({
envContents: '<string>',
secretFiles: [{path: '<string>', contents: '<string>'}]
})
};
fetch('https://ascii.dev/api/box/v1/secrets', 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://ascii.dev/api/box/v1/secrets",
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([
'envContents' => '<string>',
'secretFiles' => [
[
'path' => '<string>',
'contents' => '<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://ascii.dev/api/box/v1/secrets"
payload := strings.NewReader("{\n \"envContents\": \"<string>\",\n \"secretFiles\": [\n {\n \"path\": \"<string>\",\n \"contents\": \"<string>\"\n }\n ]\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://ascii.dev/api/box/v1/secrets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"envContents\": \"<string>\",\n \"secretFiles\": [\n {\n \"path\": \"<string>\",\n \"contents\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ascii.dev/api/box/v1/secrets")
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 \"envContents\": \"<string>\",\n \"secretFiles\": [\n {\n \"path\": \"<string>\",\n \"contents\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"type": "secrets.updated",
"success": true,
"environmentId": "env_123",
"envContents": "OPENAI_API_KEY=sk-...\n",
"secretFiles": [],
"pushed": {
"updated": 2,
"failed": 0
}
}{
"ok": false,
"type": "box.error",
"status": 401,
"code": "unauthorized",
"message": "Unauthorized",
"error": {
"code": "unauthorized",
"message": "Unauthorized",
"status": 401
},
"requestId": "req_01HX..."
}