Skip to main content
POST
/
v1
/
secrets
JavaScript
import Runloop from '@runloop/api-client';

const client = new Runloop({
  bearerToken: 'My Bearer Token',
});

const secretView = await client.secrets.create({ name: 'name', value: 'value' });

console.log(secretView.id);
{
  "id": "<string>",
  "name": "<string>",
  "create_time_ms": 123,
  "update_time_ms": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Parameters required to create a new Secret.

name
string
required

The globally unique name for the Secret. Must be a valid environment variable name (alphanumeric and underscores only). Example: 'DATABASE_PASSWORD'

value
string
required

The value to store for this Secret. This will be encrypted at rest and made available as an environment variable in Devboxes. Example: 'my-secure-password'

Response

Secret created successfully. Returns the Secret with its value included.

A Secret represents a key-value pair that can be securely stored and used in Devboxes as environment variables.

id
string
required

The unique identifier of the Secret.

name
string
required

The globally unique name of the Secret. Used as the environment variable name in Devboxes.

create_time_ms
integer
required

Creation time of the Secret (Unix timestamp in milliseconds).

update_time_ms
integer
required

Last update time of the Secret (Unix timestamp in milliseconds).