Skip to main content
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>"
    }
  ]
}
'
{
  "ok": true,
  "type": "secrets.updated",
  "success": true,
  "environmentId": "env_123",
  "envContents": "OPENAI_API_KEY=sk-...\n",
  "secretFiles": [],
  "pushed": {
    "updated": 2,
    "failed": 0
  }
}

Authorizations

Authorization
string
header
required

Box API key in the form box_.... Create and rotate keys in the Box dashboard or through the v1 API key endpoints.

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.

envContents
string

Full .env-style content to sync into Boxes. Send the complete desired file contents, not a patch.

secretFiles
object[]

Full list of secret files to keep configured. Send existing files again if they should remain.

Response

Updated secret setup metadata.

ok
boolean
required
Example:

true

type
string
required

Stable success envelope discriminator added by v1.

environmentId
string
required
envContents
string
required
secretFiles
object[]
required
success
boolean
pushed
object

Present on update; counts how many active Boxes received the new environment.