Set a vault key
PUT
/vault/{name}
const url = 'http://127.0.0.1:7700/api/vault/FACTORY_API_KEY';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"value":"example-key-value"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url http://127.0.0.1:7700/api/vault/FACTORY_API_KEY \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "value": "example-key-value" }'Owner only. Sets or replaces one key in /etc/box/vault.env, which stays readable by root only. The
value is one line of up to 8192 characters. The log records that the name was set, never the value.
No route reads a value back. The box uses the new value straight away.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”name
required
string
Capital letters, digits and _, 2 to 64 characters, starting with a letter.
Example
FACTORY_API_KEYRequest Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
value
required
The key. Never shown again.
string
Example
{ "value": "example-key-value"}Responses
Section titled “Responses”The name and when it was set.
Media typeapplication/json
object
name
required
string
setAt
required
string format: date-time
Example generated
{ "name": "example", "setAt": "2026-04-15T12:00:00Z"}A bad name or value. The message never repeats the value.
Media typeapplication/json
object
error
required
What went wrong
string
Example generated
{ "error": "example"}The owner’s route, called by someone who is not the box’s own screen or a device paired as the owner.
Media typeapplication/json
object
error
required
What went wrong
string
Example
{ "error": "only the box's own screen or the owner's paired device can do this"}GurtOS is open source under the Apache License 2.0.Source code on GitHub.