curl --request PUT \
--url https://api.instabox.sh/v1/orgs/{id}/secrets/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "<string>",
"hosts": [
"<string>"
]
}
'import requests
url = "https://api.instabox.sh/v1/orgs/{id}/secrets/{name}"
payload = {
"value": "<string>",
"hosts": ["<string>"]
}
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: '<string>', hosts: ['<string>']})
};
fetch('https://api.instabox.sh/v1/orgs/{id}/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://api.instabox.sh/v1/orgs/{id}/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' => '<string>',
'hosts' => [
'<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.instabox.sh/v1/orgs/{id}/secrets/{name}"
payload := strings.NewReader("{\n \"value\": \"<string>\",\n \"hosts\": [\n \"<string>\"\n ]\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://api.instabox.sh/v1/orgs/{id}/secrets/{name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"<string>\",\n \"hosts\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instabox.sh/v1/orgs/{id}/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\": \"<string>\",\n \"hosts\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"orgId": "<string>",
"name": "<string>",
"delivery": "proxy",
"hosts": [
"<string>"
],
"version": 2,
"size": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"id": "<string>",
"orgId": "<string>",
"name": "<string>",
"delivery": "proxy",
"hosts": [
"<string>"
],
"version": 2,
"size": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"operationId": "<string>",
"reason": "missing_key",
"hint": "<string>",
"docs": "<string>",
"docs_url": "<string>",
"requiredScopes": [
"<string>"
],
"retryAfterSeconds": 2,
"at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"operationId": "<string>",
"reason": "missing_key",
"hint": "<string>",
"docs": "<string>",
"docs_url": "<string>",
"requiredScopes": [
"<string>"
],
"retryAfterSeconds": 2,
"at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"operationId": "<string>",
"reason": "missing_key",
"hint": "<string>",
"docs": "<string>",
"docs_url": "<string>",
"requiredScopes": [
"<string>"
],
"retryAfterSeconds": 2,
"at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"operationId": "<string>",
"reason": "missing_key",
"hint": "<string>",
"docs": "<string>",
"docs_url": "<string>",
"requiredScopes": [
"<string>"
],
"retryAfterSeconds": 2,
"at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"operationId": "<string>",
"reason": "missing_key",
"hint": "<string>",
"docs": "<string>",
"docs_url": "<string>",
"requiredScopes": [
"<string>"
],
"retryAfterSeconds": 2,
"at": "2023-11-07T05:31:56Z"
}
}Create or replace an org Secret.
The org’s owner or admin only; of API keys, only the workspace’s own key
can manage values or modes (workspace:admin), never a personal org’s key.
Send the value and explicit delivery mode on every replacement. The ID
stays stable and the version increases. Proxy delivery without hosts
allows every public HTTPS destination (["*"]); env delivery accepts no
host restriction. A mode change removes
incompatible grants and never converts proxy access into env access.
Names omitted from a request remain unchanged. No Idempotency-Key is
required. Quotas apply to the total items and raw value bytes per org.
curl --request PUT \
--url https://api.instabox.sh/v1/orgs/{id}/secrets/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "<string>",
"hosts": [
"<string>"
]
}
'import requests
url = "https://api.instabox.sh/v1/orgs/{id}/secrets/{name}"
payload = {
"value": "<string>",
"hosts": ["<string>"]
}
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: '<string>', hosts: ['<string>']})
};
fetch('https://api.instabox.sh/v1/orgs/{id}/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://api.instabox.sh/v1/orgs/{id}/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' => '<string>',
'hosts' => [
'<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.instabox.sh/v1/orgs/{id}/secrets/{name}"
payload := strings.NewReader("{\n \"value\": \"<string>\",\n \"hosts\": [\n \"<string>\"\n ]\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://api.instabox.sh/v1/orgs/{id}/secrets/{name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"<string>\",\n \"hosts\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instabox.sh/v1/orgs/{id}/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\": \"<string>\",\n \"hosts\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"orgId": "<string>",
"name": "<string>",
"delivery": "proxy",
"hosts": [
"<string>"
],
"version": 2,
"size": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"id": "<string>",
"orgId": "<string>",
"name": "<string>",
"delivery": "proxy",
"hosts": [
"<string>"
],
"version": 2,
"size": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"operationId": "<string>",
"reason": "missing_key",
"hint": "<string>",
"docs": "<string>",
"docs_url": "<string>",
"requiredScopes": [
"<string>"
],
"retryAfterSeconds": 2,
"at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"operationId": "<string>",
"reason": "missing_key",
"hint": "<string>",
"docs": "<string>",
"docs_url": "<string>",
"requiredScopes": [
"<string>"
],
"retryAfterSeconds": 2,
"at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"operationId": "<string>",
"reason": "missing_key",
"hint": "<string>",
"docs": "<string>",
"docs_url": "<string>",
"requiredScopes": [
"<string>"
],
"retryAfterSeconds": 2,
"at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"operationId": "<string>",
"reason": "missing_key",
"hint": "<string>",
"docs": "<string>",
"docs_url": "<string>",
"requiredScopes": [
"<string>"
],
"retryAfterSeconds": 2,
"at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"operationId": "<string>",
"reason": "missing_key",
"hint": "<string>",
"docs": "<string>",
"docs_url": "<string>",
"requiredScopes": [
"<string>"
],
"retryAfterSeconds": 2,
"at": "2023-11-07T05:31:56Z"
}
}Authorizations
Opaque instabox access token (1 hour). Refresh with /v1/auth/refresh (refresh token valid 30 days, rotates on use).
Path Parameters
Organization ID.
A unique environment variable name within an org. The names a sandbox's env reserves are reserved (shell variables such as PATH, HOME, BASH_ENV, ENV and IFS, session and trust-store variables, and INSTABOX_ and SSH_ prefixes). A Secret saved under a name before it was reserved is not delivered: the machine's guest status names it.
^[A-Za-z_][A-Za-z0-9_]{0,127}$Body
UTF-8 text without NUL, at most 65536 bytes. Empty values are valid. Proxy values must also be valid HTTP header values without CR or LF.
Proxy supplies an opaque sandbox-specific placeholder for substitution in ordinary HTTPS headers on allowed hosts (port 443). Env supplies the real value, including credentials needed by native database clients. Unsupported traffic never falls back from proxy to env.
proxy, env Exact ASCII DNS hostnames, normalized to lowercase without a trailing dot, or a standalone * for every public HTTPS destination. Omitted or empty for proxy delivery means ["*"]. No scheme, port, path, partial wildcard, IP literal, or local hostname. Destination checks also reject private and restricted resolved addresses. This scopes credential use, not all sandbox network access.
32253Response
Replaced; reconciliation is pending.
Org Secret metadata. Values, ciphertext and placeholders are never returned.
Stable identity retained by replacements; deletion and recreation makes a new ID.
A unique environment variable name within an org. The names a sandbox's env reserves are reserved (shell variables such as PATH, HOME, BASH_ENV, ENV and IFS, session and trust-store variables, and INSTABOX_ and SSH_ prefixes). A Secret saved under a name before it was reserved is not delivered: the machine's guest status names it.
^[A-Za-z_][A-Za-z0-9_]{0,127}$Proxy supplies an opaque sandbox-specific placeholder for substitution in ordinary HTTPS headers on allowed hosts (port 443). Env supplies the real value, including credentials needed by native database clients. Unsupported traffic never falls back from proxy to env.
proxy, env Exact ASCII DNS hostnames, normalized to lowercase without a trailing dot, or a standalone * for every public HTTPS destination. Omitted or empty for proxy delivery means ["*"]. No scheme, port, path, partial wildcard, IP literal, or local hostname. Destination checks also reject private and restricted resolved addresses. This scopes credential use, not all sandbox network access.
32253x >= 1Raw value size in bytes.
x >= 0Was this page helpful?