v1/env_varList env_vars
List out all env_vars. The env_vars are sorted by creation date, with the most recently-created env_vars coming first
Authorization
AuthorizationRequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key] to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Query Parameters
limitinteger | null
Limit the number of objects to return
0idsAny properties in string, array<string>
Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times
env_var_namestring
Name of the env_var to search for
object_typestring
The type of the object the environment variable is scoped for
"organization" | "project" | "function"object_idstring
The id of the object the environment variable is scoped for
"uuid"Returns a list of env_var objects
v1/env_varCreate env_var
Create a new env_var. If there is an existing env_var with the same name as the one specified in the request, will return the existing env_var unmodified
Authorization
AuthorizationRequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key] to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Request Body
application/jsonOptionalAny desired information about the new env_var object
object_typeRequiredstring
The type of the object the environment variable is scoped for
"organization" | "project" | "function"object_idRequiredstring
The id of the object the environment variable is scoped for
"uuid"nameRequiredstring
The name of the environment variable
valuestring | null
The value of the environment variable. Will be encrypted at rest.
Returns the new env_var object
v1/env_varCreate or replace env_var
Create or replace env_var. If there is an existing env_var with the same name as the one specified in the request, will replace the existing env_var with the provided fields
Authorization
AuthorizationRequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key] to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Request Body
application/jsonOptionalAny desired information about the new env_var object
object_typeRequiredstring
The type of the object the environment variable is scoped for
"organization" | "project" | "function"object_idRequiredstring
The id of the object the environment variable is scoped for
"uuid"nameRequiredstring
The name of the environment variable
valuestring | null
The value of the environment variable. Will be encrypted at rest.
Returns the new env_var object
v1/env_var/{env_var_id}Get env_var
Get an env_var object by its id
Authorization
AuthorizationRequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key] to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Path Parameters
env_var_idRequiredstring
EnvVar id
"uuid"Returns the env_var object
v1/env_var/{env_var_id}Partially update env_var
Partially update an env_var object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
Authorization
AuthorizationRequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key] to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Request Body
application/jsonOptionalFields to update
nameRequiredstring
The name of the environment variable
valuestring | null
The value of the environment variable. Will be encrypted at rest.
Path Parameters
env_var_idRequiredstring
EnvVar id
"uuid"Returns the env_var object
v1/env_var/{env_var_id}Delete env_var
Delete an env_var object by its id
Authorization
AuthorizationRequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key] to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Path Parameters
env_var_idRequiredstring
EnvVar id
"uuid"Returns the deleted env_var object