diff --git a/openapi/spec.json b/openapi/spec.json index 893dcb1..def1f96 100644 --- a/openapi/spec.json +++ b/openapi/spec.json @@ -349,6 +349,21 @@ "type": "string", "description": "Filter search results to within a particular organization" }, + "OrgId": { + "type": "string", + "format": "uuid", + "description": "Identify the organization to list API keys for" + }, + "CreatedAfter": { + "type": "string", + "format": "date-time", + "description": "Include API keys created at or after this timestamp" + }, + "CreatedBefore": { + "type": "string", + "format": "date-time", + "description": "Include API keys created at or before this timestamp" + }, "Ids": { "anyOf": [ { @@ -970,6 +985,7 @@ "preprocessor", "classifier", "review", + "decision", "question", "log", null @@ -5339,7 +5355,6 @@ "type": "string", "format": "uuid" }, - "maxItems": 10000, "description": "Sorted ids of active projects in this project group" } }, @@ -6060,9 +6075,10 @@ "harness": { "type": "string", "enum": [ - "codex", "native", - "claude-code" + "codex", + "claude-code", + "pi" ], "description": "Required when saving a Loop automation. Currently only Codex is supported." }, @@ -10321,6 +10337,237 @@ "title": "topic_map" } ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "simulation" + ] + }, + "config": { + "anyOf": [ + { + "type": "object", + "properties": { + "initiator": { + "type": "string", + "enum": [ + "agent", + "simulated_user" + ], + "default": "agent", + "description": "Who speaks first in the conversation" + }, + "timeout_seconds": { + "type": "integer", + "minimum": 15, + "maximum": 3600, + "default": 600, + "description": "Maximum conversation duration in seconds" + }, + "modality": { + "type": "string", + "enum": [ + "voice" + ], + "default": "voice" + }, + "agent": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "livekit" + ] + }, + "server_url": { + "type": "string", + "minLength": 1, + "description": "The WebSocket URL of the LiveKit project hosting the agent" + }, + "agent_name": { + "type": "string", + "minLength": 1, + "description": "The name of the LiveKit agent to dispatch" + } + }, + "required": [ + "type", + "server_url", + "agent_name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "phone" + ] + }, + "phone_number": { + "type": "string", + "pattern": "^\\+[1-9]\\d{7,14}$" + } + }, + "required": [ + "type", + "phone_number" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "sip" + ] + }, + "uri": { + "type": "string", + "pattern": "^sips?:[^\\s]+$" + } + }, + "required": [ + "type", + "uri" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "agent" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "initiator": { + "type": "string", + "enum": [ + "agent", + "simulated_user" + ], + "default": "agent", + "description": "Who speaks first in the conversation" + }, + "timeout_seconds": { + "type": "integer", + "minimum": 15, + "maximum": 3600, + "default": 600, + "description": "Maximum conversation duration in seconds" + }, + "modality": { + "type": "string", + "enum": [ + "text" + ] + }, + "agent": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "livekit" + ] + }, + "server_url": { + "type": "string", + "minLength": 1, + "description": "The WebSocket URL of the LiveKit project hosting the agent" + }, + "agent_name": { + "type": "string", + "minLength": 1, + "description": "The name of the LiveKit agent to dispatch" + } + }, + "required": [ + "type", + "server_url", + "agent_name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "acp" + ] + }, + "command": { + "type": "string", + "minLength": 1, + "description": "Executable for the ACP agent subprocess, communicating over stdio" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "default": [], + "description": "Arguments passed to the executable without shell interpretation" + }, + "cwd": { + "type": "string", + "pattern": "^(?:\\/|[A-Za-z]:[\\\\/]|\\\\\\\\)", + "description": "Absolute working directory for the ACP session on the execution host" + }, + "permissions": { + "type": "string", + "enum": [ + "deny" + ], + "default": "deny", + "description": "Deny ACP permission requests; this does not sandbox the subprocess" + } + }, + "required": [ + "type", + "command", + "cwd" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "modality", + "agent" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "type", + "config" + ], + "additionalProperties": false, + "description": "A task function that runs a conversation between an agent and a simulated user.", + "title": "simulation" } ] }, @@ -10776,6 +11023,237 @@ } ] }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "simulation" + ] + }, + "config": { + "anyOf": [ + { + "type": "object", + "properties": { + "initiator": { + "type": "string", + "enum": [ + "agent", + "simulated_user" + ], + "default": "agent", + "description": "Who speaks first in the conversation" + }, + "timeout_seconds": { + "type": "integer", + "minimum": 15, + "maximum": 3600, + "default": 600, + "description": "Maximum conversation duration in seconds" + }, + "modality": { + "type": "string", + "enum": [ + "voice" + ], + "default": "voice" + }, + "agent": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "livekit" + ] + }, + "server_url": { + "type": "string", + "minLength": 1, + "description": "The WebSocket URL of the LiveKit project hosting the agent" + }, + "agent_name": { + "type": "string", + "minLength": 1, + "description": "The name of the LiveKit agent to dispatch" + } + }, + "required": [ + "type", + "server_url", + "agent_name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "phone" + ] + }, + "phone_number": { + "type": "string", + "pattern": "^\\+[1-9]\\d{7,14}$" + } + }, + "required": [ + "type", + "phone_number" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "sip" + ] + }, + "uri": { + "type": "string", + "pattern": "^sips?:[^\\s]+$" + } + }, + "required": [ + "type", + "uri" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "agent" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "initiator": { + "type": "string", + "enum": [ + "agent", + "simulated_user" + ], + "default": "agent", + "description": "Who speaks first in the conversation" + }, + "timeout_seconds": { + "type": "integer", + "minimum": 15, + "maximum": 3600, + "default": 600, + "description": "Maximum conversation duration in seconds" + }, + "modality": { + "type": "string", + "enum": [ + "text" + ] + }, + "agent": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "livekit" + ] + }, + "server_url": { + "type": "string", + "minLength": 1, + "description": "The WebSocket URL of the LiveKit project hosting the agent" + }, + "agent_name": { + "type": "string", + "minLength": 1, + "description": "The name of the LiveKit agent to dispatch" + } + }, + "required": [ + "type", + "server_url", + "agent_name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "acp" + ] + }, + "command": { + "type": "string", + "minLength": 1, + "description": "Executable for the ACP agent subprocess, communicating over stdio" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "default": [], + "description": "Arguments passed to the executable without shell interpretation" + }, + "cwd": { + "type": "string", + "pattern": "^(?:\\/|[A-Za-z]:[\\\\/]|\\\\\\\\)", + "description": "Absolute working directory for the ACP session on the execution host" + }, + "permissions": { + "type": "string", + "enum": [ + "deny" + ], + "default": "deny", + "description": "Deny ACP permission requests; this does not sandbox the subprocess" + } + }, + "required": [ + "type", + "command", + "cwd" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "modality", + "agent" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "type", + "config" + ], + "additionalProperties": false, + "description": "A task function that runs a conversation between an agent and a simulated user.", + "title": "simulation" + }, { "type": "null" } @@ -11030,6 +11508,13 @@ "options": { "type": "object", "properties": { + "filterScope": { + "type": "string", + "enum": [ + "span", + "trace" + ] + }, "spanType": { "type": "string", "nullable": true, @@ -11768,7 +12253,7 @@ "token_name": { "type": "string", "nullable": true, - "description": "Optional name of an initial service token to create for the new service account. This is a narrow compatibility carve-out only on PATCH /v1/organization/members. When this field is set, the request must be authenticated with a service token that has organization-owner permissions, not a user API key." + "description": "Optional name of an initial service token to create for the new service account. When set, authenticate with a UI session or service token, not a user API key. The caller must own the organization or the project group specified by invite_users.project_group_id." }, "token_expires_in_seconds": { "type": "integer", @@ -11818,6 +12303,12 @@ "type": "string", "nullable": true, "description": "Singular form of group_names" + }, + "project_group_id": { + "type": "string", + "nullable": true, + "format": "uuid", + "description": "Grants new service accounts read access to this project group. Required when a project-group Owner creates service accounts." } }, "description": "Users to invite to the organization" @@ -12462,6 +12953,150 @@ } } }, + "SimulatedUserVoiceConfig": { + "type": "object", + "properties": { + "voice_id": { + "type": "string", + "format": "uuid" + }, + "language": { + "type": "string", + "minLength": 1 + }, + "accent": { + "type": "string", + "minLength": 1 + }, + "speaking_rate": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true + } + }, + "required": [ + "voice_id" + ], + "additionalProperties": false + }, + "SimulatedUser": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the simulated user" + }, + "_xact_id": { + "type": "string", + "description": "Legacy transaction id. Not returned by simulated user CRUD." + }, + "project_id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the project that the simulated user belongs under" + }, + "org_id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the organization" + }, + "name": { + "type": "string", + "minLength": 1, + "description": "Name of the simulated user" + }, + "created": { + "type": "string", + "nullable": true, + "format": "date-time", + "description": "Date of simulated user creation" + }, + "instructions": { + "type": "string", + "minLength": 1, + "description": "The simulated user's role, scenario, and behavior" + }, + "goal": { + "type": "string", + "minLength": 1, + "description": "The simulated user's objective, used to decide when to end the conversation" + }, + "voice_config": { + "$ref": "#/components/schemas/SimulatedUserVoiceConfig" + } + }, + "required": [ + "id", + "project_id", + "org_id", + "name", + "instructions", + "voice_config" + ] + }, + "AppLimit": { + "type": "integer", + "nullable": true, + "minimum": 0, + "maximum": 1000, + "default": 100, + "description": "Limit the number of objects to return" + }, + "CreateSimulatedUser": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "Name of the simulated user" + }, + "instructions": { + "type": "string", + "minLength": 1, + "description": "The simulated user's role, scenario, and behavior" + }, + "goal": { + "type": "string", + "minLength": 1, + "description": "The simulated user's objective, used to decide when to end the conversation" + }, + "voice_config": { + "$ref": "#/components/schemas/SimulatedUserVoiceConfig" + } + }, + "required": [ + "name", + "instructions", + "voice_config" + ], + "additionalProperties": false + }, + "PatchSimulatedUser": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "Name of the simulated user" + }, + "instructions": { + "type": "string", + "minLength": 1, + "description": "The simulated user's role, scenario, and behavior" + }, + "goal": { + "type": "string", + "nullable": true, + "minLength": 1, + "description": "The simulated user's objective. Set to null to clear it." + }, + "voice_config": { + "$ref": "#/components/schemas/SimulatedUserVoiceConfig" + } + }, + "additionalProperties": false + }, "Environment": { "type": "object", "properties": { @@ -13773,6 +14408,36 @@ "in": "query", "allowReserved": true }, + "OrgId": { + "schema": { + "$ref": "#/components/schemas/OrgId" + }, + "required": false, + "description": "Identify the organization to list API keys for", + "name": "org_id", + "in": "query", + "allowReserved": true + }, + "CreatedAfter": { + "schema": { + "$ref": "#/components/schemas/CreatedAfter" + }, + "required": false, + "description": "Include API keys created at or after this timestamp", + "name": "created_after", + "in": "query", + "allowReserved": true + }, + "CreatedBefore": { + "schema": { + "$ref": "#/components/schemas/CreatedBefore" + }, + "required": false, + "description": "Include API keys created at or before this timestamp", + "name": "created_before", + "in": "query", + "allowReserved": true + }, "Ids": { "schema": { "$ref": "#/components/schemas/Ids" @@ -31322,6 +31987,212 @@ } } }, + "/v1/organization/api_keys": { + "get": { + "operationId": "getOrganizationApiKeys", + "tags": [ + "Organizations" + ], + "description": "List all API keys associated with users in an organization, sorted by creation date with the newest keys first. An organization-scoped API key determines the organization; otherwise, provide `org_id`. If `org_id` does not match the organization-scoped key's organization, or the caller is not an owner of the organization, no keys are returned. Responses include key metadata only; key secrets are never returned. To list service tokens, use `GET /v1/service_token`.", + "summary": "List organization API keys", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/AppLimitWithDefaultParam" + }, + { + "$ref": "#/components/parameters/StartingAfter" + }, + { + "$ref": "#/components/parameters/EndingBefore" + }, + { + "$ref": "#/components/parameters/Ids" + }, + { + "$ref": "#/components/parameters/ApiKeyName" + }, + { + "$ref": "#/components/parameters/OrgId" + }, + { + "$ref": "#/components/parameters/CreatedAfter" + }, + { + "$ref": "#/components/parameters/CreatedBefore" + } + ], + "responses": { + "200": { + "description": "Returns a list of api_key objects", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApiKey" + }, + "description": "A list of api_key objects" + } + }, + "required": [ + "objects" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "401": { + "description": "No valid API key provided", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "403": { + "description": "The API key doesn’t have permissions to perform the request", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "429": { + "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", + "headers": { + "Retry-After": { + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "500": { + "description": "Something went wrong on Braintrust's end. (These are rare.)", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + } + } + }, + "options": { + "operationId": "optionsOrganizationApiKeys", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/organization/api_keys`)", + "security": [], + "tags": [ + "CORS" + ], + "responses": { + "200": { + "description": "Response for CORS method", + "headers": { + "Access-Control-Allow-Credentials": { + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Headers": { + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Methods": { + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Origin": { + "schema": { + "type": "string" + } + }, + "Access-Control-Max-Age": { + "schema": { + "type": "string" + } + } + }, + "content": {} + }, + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + } + } + } + }, "/v1/api_key": { "get": { "operationId": "getApiKey", @@ -31824,7 +32695,7 @@ {} ], "operationId": "postServiceToken", - "description": "Create a new service token.\n\nWhen calling this endpoint, you must authenticate using a service token that has organization-owner permissions. User API keys cannot be used.", + "description": "Create a new service token.\n\nAuthenticate with a service token. A service token whose service account is an organization owner can create tokens for any service account. A service token whose service account holds the Owner role on a project group can create tokens for a service account in the same organization when the target account has a permission grant on a project group it owns. The calling service account must also hold all of the target account's permissions in the organization; otherwise the request returns 403. User API keys cannot be used.", "summary": "Create service_token", "requestBody": { "description": "Any desired information about the new service_token object", @@ -32104,12 +32975,859 @@ } }, "delete": { - "operationId": "deleteServiceToken", + "operationId": "deleteServiceToken", + "tags": [ + "ServiceTokens" + ], + "description": "Delete a single service_token", + "summary": "Delete single service_token", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "requestBody": { + "description": "Parameters which uniquely specify the service_token to delete", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteServiceToken" + } + } + } + }, + "responses": { + "200": { + "description": "Returns the deleted service_token object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceToken" + } + } + } + }, + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "401": { + "description": "No valid API key provided", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "403": { + "description": "The API key doesn’t have permissions to perform the request", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "429": { + "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", + "headers": { + "Retry-After": { + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "500": { + "description": "Something went wrong on Braintrust's end. (These are rare.)", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + } + } + }, + "get": { + "operationId": "getServiceToken", + "tags": [ + "ServiceTokens" + ], + "description": "List out all service tokens. They are sorted by creation date, with the most recently-created tokens coming first.\n\nTo create a service token, visit [**Settings > Service tokens**](https://www.braintrust.dev/app/~/configuration/org/service-tokens) as an organization owner or an Owner of an active project group in the organization, or call [`POST /v1/service_token`](https://www.braintrust.dev/docs/api-reference/servicetokens/create-service_token) with a service token. Results include only service tokens you can manage.", + "summary": "List service_tokens", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/AppLimitParam" + }, + { + "$ref": "#/components/parameters/StartingAfter" + }, + { + "$ref": "#/components/parameters/EndingBefore" + }, + { + "$ref": "#/components/parameters/Ids" + }, + { + "$ref": "#/components/parameters/ServiceTokenName" + }, + { + "$ref": "#/components/parameters/OrgName" + } + ], + "responses": { + "200": { + "description": "Returns a list of service_token objects", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceToken" + }, + "description": "A list of service_token objects" + } + }, + "required": [ + "objects" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "401": { + "description": "No valid API key provided", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "403": { + "description": "The API key doesn’t have permissions to perform the request", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "429": { + "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", + "headers": { + "Retry-After": { + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "500": { + "description": "Something went wrong on Braintrust's end. (These are rare.)", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + } + } + }, + "options": { + "operationId": "optionsServiceToken", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/service_token`)", + "security": [], + "tags": [ + "CORS" + ], + "responses": { + "200": { + "description": "Response for CORS method", + "headers": { + "Access-Control-Allow-Credentials": { + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Headers": { + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Methods": { + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Origin": { + "schema": { + "type": "string" + } + }, + "Access-Control-Max-Age": { + "schema": { + "type": "string" + } + } + }, + "content": {} + }, + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + } + } + } + }, + "/v1/service_token/{service_token_id}": { + "get": { + "operationId": "getServiceTokenId", + "tags": [ + "ServiceTokens" + ], + "description": "Get a service_token object by its id", + "summary": "Get service_token", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/ServiceTokenIdParam" + } + ], + "responses": { + "200": { + "description": "Returns the service_token object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceToken" + } + } + } + }, + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "401": { + "description": "No valid API key provided", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "403": { + "description": "The API key doesn’t have permissions to perform the request", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "429": { + "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", + "headers": { + "Retry-After": { + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "500": { + "description": "Something went wrong on Braintrust's end. (These are rare.)", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + } + } + }, + "delete": { + "operationId": "deleteServiceTokenId", + "tags": [ + "ServiceTokens" + ], + "description": "Delete a service_token object by its id", + "summary": "Delete service_token", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/ServiceTokenIdParam" + } + ], + "responses": { + "200": { + "description": "Returns the deleted service_token object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceToken" + } + } + } + }, + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "401": { + "description": "No valid API key provided", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "403": { + "description": "The API key doesn’t have permissions to perform the request", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "429": { + "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", + "headers": { + "Retry-After": { + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "500": { + "description": "Something went wrong on Braintrust's end. (These are rare.)", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + } + } + }, + "options": { + "operationId": "optionsServiceTokenId", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/service_token/{service_token_id}`)", + "security": [], + "tags": [ + "CORS" + ], + "parameters": [ + { + "$ref": "#/components/parameters/ServiceTokenIdParam" + } + ], + "responses": { + "200": { + "description": "Response for CORS method", + "headers": { + "Access-Control-Allow-Credentials": { + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Headers": { + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Methods": { + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Origin": { + "schema": { + "type": "string" + } + }, + "Access-Control-Max-Age": { + "schema": { + "type": "string" + } + } + }, + "content": {} + }, + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + } + } + } + }, + "/v1/ai_secret": { + "post": { + "tags": [ + "AiSecrets" + ], + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "operationId": "postAiSecret", + "description": "Create a new ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will return the existing ai_secret unmodified", + "summary": "Create ai_secret", + "requestBody": { + "description": "Any desired information about the new ai_secret object", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateAISecret" + } + } + } + }, + "responses": { + "200": { + "description": "Returns the new ai_secret object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AISecret" + } + } + } + }, + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "401": { + "description": "No valid API key provided", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "403": { + "description": "The API key doesn’t have permissions to perform the request", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "429": { + "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", + "headers": { + "Retry-After": { + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "500": { + "description": "Something went wrong on Braintrust's end. (These are rare.)", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + } + } + }, + "put": { + "tags": [ + "AiSecrets" + ], + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "operationId": "putAiSecret", + "description": "Create or replace ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will replace the existing ai_secret with the provided fields", + "summary": "Create or replace ai_secret", + "requestBody": { + "description": "Any desired information about the new ai_secret object", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateAISecret" + } + } + } + }, + "responses": { + "200": { + "description": "Returns the new ai_secret object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AISecret" + } + } + } + }, + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "401": { + "description": "No valid API key provided", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "403": { + "description": "The API key doesn’t have permissions to perform the request", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "429": { + "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", + "headers": { + "Retry-After": { + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "500": { + "description": "Something went wrong on Braintrust's end. (These are rare.)", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + } + } + }, + "delete": { + "operationId": "deleteAiSecret", "tags": [ - "ServiceTokens" + "AiSecrets" ], - "description": "Delete a single service_token", - "summary": "Delete single service_token", + "description": "Delete a single ai_secret", + "summary": "Delete single ai_secret", "security": [ { "bearerAuth": [] @@ -32117,23 +33835,23 @@ {} ], "requestBody": { - "description": "Parameters which uniquely specify the service_token to delete", + "description": "Parameters which uniquely specify the ai_secret to delete", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteServiceToken" + "$ref": "#/components/schemas/DeleteAISecret" } } } }, "responses": { "200": { - "description": "Returns the deleted service_token object", + "description": "Returns the deleted ai_secret object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ServiceToken" + "$ref": "#/components/schemas/AISecret" } } } @@ -32223,12 +33941,12 @@ } }, "get": { - "operationId": "getServiceToken", + "operationId": "getAiSecret", "tags": [ - "ServiceTokens" + "AiSecrets" ], - "description": "List out all service tokens. They are sorted by creation date, with the most recently-created tokens coming first.\n\nTo create a service token, visit [**Settings > Service tokens**](https://www.braintrust.dev/app/~/configuration/org/service-tokens) as an organization owner, or call [`POST /v1/service_token`](https://www.braintrust.dev/docs/api-reference/servicetokens/create-service_token) and authenticate with a service token that has organization-owner permissions.", - "summary": "List service_tokens", + "description": "List out all ai_secrets. The ai_secrets are sorted by creation date, with the most recently-created ai_secrets coming first", + "summary": "List ai_secrets", "security": [ { "bearerAuth": [] @@ -32249,15 +33967,18 @@ "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/ServiceTokenName" + "$ref": "#/components/parameters/AiSecretName" }, { "$ref": "#/components/parameters/OrgName" + }, + { + "$ref": "#/components/parameters/AISecretType" } ], "responses": { "200": { - "description": "Returns a list of service_token objects", + "description": "Returns a list of ai_secret objects", "content": { "application/json": { "schema": { @@ -32266,9 +33987,9 @@ "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/ServiceToken" + "$ref": "#/components/schemas/AISecret" }, - "description": "A list of service_token objects" + "description": "A list of ai_secret objects" } }, "required": [ @@ -32364,9 +34085,9 @@ } }, "options": { - "operationId": "optionsServiceToken", + "operationId": "optionsAiSecret", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/service_token`)", + "summary": "Enable CORS (`/v1/ai_secret`)", "security": [], "tags": [ "CORS" @@ -32421,14 +34142,14 @@ } } }, - "/v1/service_token/{service_token_id}": { + "/v1/ai_secret/{ai_secret_id}": { "get": { - "operationId": "getServiceTokenId", + "operationId": "getAiSecretId", "tags": [ - "ServiceTokens" + "AiSecrets" ], - "description": "Get a service_token object by its id", - "summary": "Get service_token", + "description": "Get an ai_secret object by its id", + "summary": "Get ai_secret", "security": [ { "bearerAuth": [] @@ -32437,16 +34158,140 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ServiceTokenIdParam" + "$ref": "#/components/parameters/AiSecretIdParam" } ], "responses": { "200": { - "description": "Returns the service_token object", + "description": "Returns the ai_secret object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ServiceToken" + "$ref": "#/components/schemas/AISecret" + } + } + } + }, + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "401": { + "description": "No valid API key provided", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "403": { + "description": "The API key doesn’t have permissions to perform the request", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "429": { + "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", + "headers": { + "Retry-After": { + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "500": { + "description": "Something went wrong on Braintrust's end. (These are rare.)", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + } + } + }, + "patch": { + "operationId": "patchAiSecretId", + "tags": [ + "AiSecrets" + ], + "description": "Partially update an ai_secret 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.", + "summary": "Partially update ai_secret", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/AiSecretIdParam" + } + ], + "requestBody": { + "description": "Fields to update", + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchAISecret" + } + } + } + }, + "responses": { + "200": { + "description": "Returns the ai_secret object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AISecret" } } } @@ -32536,12 +34381,12 @@ } }, "delete": { - "operationId": "deleteServiceTokenId", + "operationId": "deleteAiSecretId", "tags": [ - "ServiceTokens" + "AiSecrets" ], - "description": "Delete a service_token object by its id", - "summary": "Delete service_token", + "description": "Delete an ai_secret object by its id", + "summary": "Delete ai_secret", "security": [ { "bearerAuth": [] @@ -32550,16 +34395,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ServiceTokenIdParam" + "$ref": "#/components/parameters/AiSecretIdParam" } ], "responses": { "200": { - "description": "Returns the deleted service_token object", + "description": "Returns the deleted ai_secret object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ServiceToken" + "$ref": "#/components/schemas/AISecret" } } } @@ -32649,16 +34494,16 @@ } }, "options": { - "operationId": "optionsServiceTokenId", + "operationId": "optionsAiSecretId", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/service_token/{service_token_id}`)", + "summary": "Enable CORS (`/v1/ai_secret/{ai_secret_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/ServiceTokenIdParam" + "$ref": "#/components/parameters/AiSecretIdParam" } ], "responses": { @@ -32711,10 +34556,10 @@ } } }, - "/v1/ai_secret": { + "/v1/env_var": { "post": { "tags": [ - "AiSecrets" + "EnvVars" ], "security": [ { @@ -32722,27 +34567,71 @@ }, {} ], - "operationId": "postAiSecret", - "description": "Create a new ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will return the existing ai_secret unmodified", - "summary": "Create ai_secret", + "operationId": "postEnvVar", + "description": "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", + "summary": "Create env_var", "requestBody": { - "description": "Any desired information about the new ai_secret object", + "description": "Any desired information about the new env_var object", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateAISecret" + "type": "object", + "properties": { + "object_type": { + "type": "string", + "enum": [ + "organization", + "project", + "function", + "mcp_server" + ], + "description": "The type of the object the environment variable is scoped for" + }, + "object_id": { + "type": "string", + "format": "uuid", + "description": "The id of the object the environment variable is scoped for" + }, + "name": { + "type": "string", + "description": "The name of the environment variable" + }, + "value": { + "type": "string", + "nullable": true, + "description": "The value of the environment variable. Will be encrypted at rest." + }, + "metadata": { + "type": "object", + "nullable": true, + "additionalProperties": { + "nullable": true + }, + "description": "Optional metadata associated with the environment variable when managed via the function secrets API" + }, + "secret_type": { + "type": "string", + "nullable": true, + "description": "Optional classification for the secret (for example, the AI provider name)" + } + }, + "required": [ + "object_type", + "object_id", + "name" + ] } } } }, "responses": { "200": { - "description": "Returns the new ai_secret object", + "description": "Returns the new env_var object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AISecret" + "$ref": "#/components/schemas/EnvVar" } } } @@ -32833,154 +34722,79 @@ }, "put": { "tags": [ - "AiSecrets" - ], - "security": [ - { - "bearerAuth": [] - }, - {} - ], - "operationId": "putAiSecret", - "description": "Create or replace ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will replace the existing ai_secret with the provided fields", - "summary": "Create or replace ai_secret", - "requestBody": { - "description": "Any desired information about the new ai_secret object", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateAISecret" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the new ai_secret object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AISecret" - } - } - } - }, - "400": { - "description": "The request was unacceptable, often due to missing a required parameter", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "401": { - "description": "No valid API key provided", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "403": { - "description": "The API key doesn’t have permissions to perform the request", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "429": { - "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", - "headers": { - "Retry-After": { - "schema": { - "type": "string" - } - } - }, - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "500": { - "description": "Something went wrong on Braintrust's end. (These are rare.)", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - } - } - }, - "delete": { - "operationId": "deleteAiSecret", - "tags": [ - "AiSecrets" + "EnvVars" ], - "description": "Delete a single ai_secret", - "summary": "Delete single ai_secret", "security": [ { "bearerAuth": [] }, {} ], + "operationId": "putEnvVar", + "description": "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", + "summary": "Create or replace env_var", "requestBody": { - "description": "Parameters which uniquely specify the ai_secret to delete", + "description": "Any desired information about the new env_var object", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteAISecret" + "type": "object", + "properties": { + "object_type": { + "type": "string", + "enum": [ + "organization", + "project", + "function", + "mcp_server" + ], + "description": "The type of the object the environment variable is scoped for" + }, + "object_id": { + "type": "string", + "format": "uuid", + "description": "The id of the object the environment variable is scoped for" + }, + "name": { + "type": "string", + "description": "The name of the environment variable" + }, + "value": { + "type": "string", + "nullable": true, + "description": "The value of the environment variable. Will be encrypted at rest." + }, + "metadata": { + "type": "object", + "nullable": true, + "additionalProperties": { + "nullable": true + }, + "description": "Optional metadata associated with the environment variable when managed via the function secrets API" + }, + "secret_type": { + "type": "string", + "nullable": true, + "description": "Optional classification for the secret (for example, the AI provider name)" + } + }, + "required": [ + "object_type", + "object_id", + "name" + ] } } } }, "responses": { "200": { - "description": "Returns the deleted ai_secret object", + "description": "Returns the new env_var object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AISecret" + "$ref": "#/components/schemas/EnvVar" } } } @@ -33070,12 +34884,12 @@ } }, "get": { - "operationId": "getAiSecret", + "operationId": "getEnvVar", "tags": [ - "AiSecrets" + "EnvVars" ], - "description": "List out all ai_secrets. The ai_secrets are sorted by creation date, with the most recently-created ai_secrets coming first", - "summary": "List ai_secrets", + "description": "List out all env_vars. The env_vars are sorted by creation date, with the most recently-created env_vars coming first", + "summary": "List env_vars", "security": [ { "bearerAuth": [] @@ -33086,28 +34900,22 @@ { "$ref": "#/components/parameters/AppLimitParam" }, - { - "$ref": "#/components/parameters/StartingAfter" - }, - { - "$ref": "#/components/parameters/EndingBefore" - }, { "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/AiSecretName" + "$ref": "#/components/parameters/EnvVarName" }, { - "$ref": "#/components/parameters/OrgName" + "$ref": "#/components/parameters/EnvVarObjectType" }, { - "$ref": "#/components/parameters/AISecretType" + "$ref": "#/components/parameters/EnvVarObjectId" } ], "responses": { "200": { - "description": "Returns a list of ai_secret objects", + "description": "Returns a list of env_var objects", "content": { "application/json": { "schema": { @@ -33116,9 +34924,9 @@ "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/AISecret" + "$ref": "#/components/schemas/EnvVar" }, - "description": "A list of ai_secret objects" + "description": "A list of env_var objects" } }, "required": [ @@ -33214,9 +35022,9 @@ } }, "options": { - "operationId": "optionsAiSecret", + "operationId": "optionsEnvVar", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/ai_secret`)", + "summary": "Enable CORS (`/v1/env_var`)", "security": [], "tags": [ "CORS" @@ -33271,14 +35079,14 @@ } } }, - "/v1/ai_secret/{ai_secret_id}": { + "/v1/env_var/{env_var_id}": { "get": { - "operationId": "getAiSecretId", + "operationId": "getEnvVarId", "tags": [ - "AiSecrets" + "EnvVars" ], - "description": "Get an ai_secret object by its id", - "summary": "Get ai_secret", + "description": "Get an env_var object by its id", + "summary": "Get env_var", "security": [ { "bearerAuth": [] @@ -33287,16 +35095,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/AiSecretIdParam" + "$ref": "#/components/parameters/EnvVarIdParam" } ], "responses": { "200": { - "description": "Returns the ai_secret object", + "description": "Returns the env_var object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AISecret" + "$ref": "#/components/schemas/EnvVar" } } } @@ -33386,12 +35194,12 @@ } }, "patch": { - "operationId": "patchAiSecretId", + "operationId": "patchEnvVarId", "tags": [ - "AiSecrets" + "EnvVars" ], - "description": "Partially update an ai_secret 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.", - "summary": "Partially update ai_secret", + "description": "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.", + "summary": "Partially update env_var", "security": [ { "bearerAuth": [] @@ -33400,27 +35208,54 @@ ], "parameters": [ { - "$ref": "#/components/parameters/AiSecretIdParam" + "$ref": "#/components/parameters/EnvVarIdParam" } ], "requestBody": { "description": "Fields to update", - "required": false, + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchAISecret" + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the environment variable" + }, + "value": { + "type": "string", + "nullable": true, + "description": "The value of the environment variable. Will be encrypted at rest." + }, + "metadata": { + "type": "object", + "nullable": true, + "additionalProperties": { + "nullable": true + }, + "description": "Optional metadata associated with the environment variable when managed via the function secrets API" + }, + "secret_type": { + "type": "string", + "nullable": true, + "description": "Optional classification for the secret (for example, the AI provider name)" + } + }, + "required": [ + "name" + ] } } } }, "responses": { "200": { - "description": "Returns the ai_secret object", + "description": "Returns the env_var object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AISecret" + "$ref": "#/components/schemas/EnvVar" } } } @@ -33510,12 +35345,12 @@ } }, "delete": { - "operationId": "deleteAiSecretId", + "operationId": "deleteEnvVarId", "tags": [ - "AiSecrets" + "EnvVars" ], - "description": "Delete an ai_secret object by its id", - "summary": "Delete ai_secret", + "description": "Delete an env_var object by its id", + "summary": "Delete env_var", "security": [ { "bearerAuth": [] @@ -33524,16 +35359,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/AiSecretIdParam" + "$ref": "#/components/parameters/EnvVarIdParam" } ], "responses": { "200": { - "description": "Returns the deleted ai_secret object", + "description": "Returns the deleted env_var object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AISecret" + "$ref": "#/components/schemas/EnvVar" } } } @@ -33623,16 +35458,16 @@ } }, "options": { - "operationId": "optionsAiSecretId", + "operationId": "optionsEnvVarId", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/ai_secret/{ai_secret_id}`)", + "summary": "Enable CORS (`/v1/env_var/{env_var_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/AiSecretIdParam" + "$ref": "#/components/parameters/EnvVarIdParam" } ], "responses": { @@ -33685,10 +35520,10 @@ } } }, - "/v1/env_var": { + "/v1/mcp_server": { "post": { "tags": [ - "EnvVars" + "McpServers" ], "security": [ { @@ -33696,71 +35531,27 @@ }, {} ], - "operationId": "postEnvVar", - "description": "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", - "summary": "Create env_var", + "operationId": "postMcpServer", + "description": "Create a new mcp_server. If there is an existing mcp_server with the same name as the one specified in the request, will return the existing mcp_server unmodified", + "summary": "Create mcp_server", "requestBody": { - "description": "Any desired information about the new env_var object", + "description": "Any desired information about the new mcp_server object", "required": true, "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "object_type": { - "type": "string", - "enum": [ - "organization", - "project", - "function", - "mcp_server" - ], - "description": "The type of the object the environment variable is scoped for" - }, - "object_id": { - "type": "string", - "format": "uuid", - "description": "The id of the object the environment variable is scoped for" - }, - "name": { - "type": "string", - "description": "The name of the environment variable" - }, - "value": { - "type": "string", - "nullable": true, - "description": "The value of the environment variable. Will be encrypted at rest." - }, - "metadata": { - "type": "object", - "nullable": true, - "additionalProperties": { - "nullable": true - }, - "description": "Optional metadata associated with the environment variable when managed via the function secrets API" - }, - "secret_type": { - "type": "string", - "nullable": true, - "description": "Optional classification for the secret (for example, the AI provider name)" - } - }, - "required": [ - "object_type", - "object_id", - "name" - ] + "$ref": "#/components/schemas/CreateMCPServer" } } } }, "responses": { "200": { - "description": "Returns the new env_var object", + "description": "Returns the new mcp_server object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvVar" + "$ref": "#/components/schemas/MCPServer" } } } @@ -33851,7 +35642,7 @@ }, "put": { "tags": [ - "EnvVars" + "McpServers" ], "security": [ { @@ -33859,71 +35650,27 @@ }, {} ], - "operationId": "putEnvVar", - "description": "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", - "summary": "Create or replace env_var", + "operationId": "putMcpServer", + "description": "Create or replace mcp_server. If there is an existing mcp_server with the same name as the one specified in the request, will replace the existing mcp_server with the provided fields", + "summary": "Create or replace mcp_server", "requestBody": { - "description": "Any desired information about the new env_var object", + "description": "Any desired information about the new mcp_server object", "required": true, "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "object_type": { - "type": "string", - "enum": [ - "organization", - "project", - "function", - "mcp_server" - ], - "description": "The type of the object the environment variable is scoped for" - }, - "object_id": { - "type": "string", - "format": "uuid", - "description": "The id of the object the environment variable is scoped for" - }, - "name": { - "type": "string", - "description": "The name of the environment variable" - }, - "value": { - "type": "string", - "nullable": true, - "description": "The value of the environment variable. Will be encrypted at rest." - }, - "metadata": { - "type": "object", - "nullable": true, - "additionalProperties": { - "nullable": true - }, - "description": "Optional metadata associated with the environment variable when managed via the function secrets API" - }, - "secret_type": { - "type": "string", - "nullable": true, - "description": "Optional classification for the secret (for example, the AI provider name)" - } - }, - "required": [ - "object_type", - "object_id", - "name" - ] + "$ref": "#/components/schemas/CreateMCPServer" } } } }, "responses": { "200": { - "description": "Returns the new env_var object", + "description": "Returns the new mcp_server object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvVar" + "$ref": "#/components/schemas/MCPServer" } } } @@ -34013,12 +35760,12 @@ } }, "get": { - "operationId": "getEnvVar", + "operationId": "getMcpServer", "tags": [ - "EnvVars" + "McpServers" ], - "description": "List out all env_vars. The env_vars are sorted by creation date, with the most recently-created env_vars coming first", - "summary": "List env_vars", + "description": "List out all mcp_servers. The mcp_servers are sorted by creation date, with the most recently-created mcp_servers coming first", + "summary": "List mcp_servers", "security": [ { "bearerAuth": [] @@ -34030,21 +35777,24 @@ "$ref": "#/components/parameters/AppLimitParam" }, { - "$ref": "#/components/parameters/Ids" + "$ref": "#/components/parameters/StartingAfter" }, { - "$ref": "#/components/parameters/EnvVarName" + "$ref": "#/components/parameters/EndingBefore" }, { - "$ref": "#/components/parameters/EnvVarObjectType" + "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/EnvVarObjectId" + "$ref": "#/components/parameters/McpServerName" + }, + { + "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { - "description": "Returns a list of env_var objects", + "description": "Returns a list of mcp_server objects", "content": { "application/json": { "schema": { @@ -34053,9 +35803,9 @@ "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/EnvVar" + "$ref": "#/components/schemas/MCPServer" }, - "description": "A list of env_var objects" + "description": "A list of mcp_server objects" } }, "required": [ @@ -34151,9 +35901,9 @@ } }, "options": { - "operationId": "optionsEnvVar", + "operationId": "optionsMcpServer", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/env_var`)", + "summary": "Enable CORS (`/v1/mcp_server`)", "security": [], "tags": [ "CORS" @@ -34208,14 +35958,14 @@ } } }, - "/v1/env_var/{env_var_id}": { + "/v1/mcp_server/{mcp_server_id}": { "get": { - "operationId": "getEnvVarId", + "operationId": "getMcpServerId", "tags": [ - "EnvVars" + "McpServers" ], - "description": "Get an env_var object by its id", - "summary": "Get env_var", + "description": "Get a mcp_server object by its id", + "summary": "Get mcp_server", "security": [ { "bearerAuth": [] @@ -34224,16 +35974,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/EnvVarIdParam" + "$ref": "#/components/parameters/McpServerIdParam" } ], "responses": { "200": { - "description": "Returns the env_var object", + "description": "Returns the mcp_server object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvVar" + "$ref": "#/components/schemas/MCPServer" } } } @@ -34323,12 +36073,12 @@ } }, "patch": { - "operationId": "patchEnvVarId", + "operationId": "patchMcpServerId", "tags": [ - "EnvVars" + "McpServers" ], - "description": "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.", - "summary": "Partially update env_var", + "description": "Partially update a mcp_server 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.", + "summary": "Partially update mcp_server", "security": [ { "bearerAuth": [] @@ -34337,54 +36087,27 @@ ], "parameters": [ { - "$ref": "#/components/parameters/EnvVarIdParam" + "$ref": "#/components/parameters/McpServerIdParam" } ], "requestBody": { "description": "Fields to update", - "required": true, + "required": false, "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the environment variable" - }, - "value": { - "type": "string", - "nullable": true, - "description": "The value of the environment variable. Will be encrypted at rest." - }, - "metadata": { - "type": "object", - "nullable": true, - "additionalProperties": { - "nullable": true - }, - "description": "Optional metadata associated with the environment variable when managed via the function secrets API" - }, - "secret_type": { - "type": "string", - "nullable": true, - "description": "Optional classification for the secret (for example, the AI provider name)" - } - }, - "required": [ - "name" - ] + "$ref": "#/components/schemas/PatchMCPServer" } } } }, "responses": { "200": { - "description": "Returns the env_var object", + "description": "Returns the mcp_server object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvVar" + "$ref": "#/components/schemas/MCPServer" } } } @@ -34474,12 +36197,12 @@ } }, "delete": { - "operationId": "deleteEnvVarId", + "operationId": "deleteMcpServerId", "tags": [ - "EnvVars" + "McpServers" ], - "description": "Delete an env_var object by its id", - "summary": "Delete env_var", + "description": "Delete a mcp_server object by its id", + "summary": "Delete mcp_server", "security": [ { "bearerAuth": [] @@ -34488,16 +36211,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/EnvVarIdParam" + "$ref": "#/components/parameters/McpServerIdParam" } ], "responses": { "200": { - "description": "Returns the deleted env_var object", + "description": "Returns the deleted mcp_server object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvVar" + "$ref": "#/components/schemas/MCPServer" } } } @@ -34587,16 +36310,16 @@ } }, "options": { - "operationId": "optionsEnvVarId", + "operationId": "optionsMcpServerId", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/env_var/{env_var_id}`)", + "summary": "Enable CORS (`/v1/mcp_server/{mcp_server_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/EnvVarIdParam" + "$ref": "#/components/parameters/McpServerIdParam" } ], "responses": { @@ -34649,10 +36372,10 @@ } } }, - "/v1/mcp_server": { + "/v1/dataset_snapshot": { "post": { "tags": [ - "McpServers" + "DatasetSnapshots" ], "security": [ { @@ -34660,27 +36383,27 @@ }, {} ], - "operationId": "postMcpServer", - "description": "Create a new mcp_server. If there is an existing mcp_server with the same name as the one specified in the request, will return the existing mcp_server unmodified", - "summary": "Create mcp_server", + "operationId": "postDatasetSnapshot", + "description": "Create a new dataset_snapshot. If there is an existing dataset_snapshot with the same name as the one specified in the request, will return the existing dataset_snapshot unmodified", + "summary": "Create dataset_snapshot", "requestBody": { - "description": "Any desired information about the new mcp_server object", + "description": "Any desired information about the new dataset_snapshot object", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateMCPServer" + "$ref": "#/components/schemas/CreateDatasetSnapshot" } } } }, "responses": { "200": { - "description": "Returns the new mcp_server object", + "description": "Returns the new dataset_snapshot object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServer" + "$ref": "#/components/schemas/DatasetSnapshot" } } } @@ -34771,7 +36494,7 @@ }, "put": { "tags": [ - "McpServers" + "DatasetSnapshots" ], "security": [ { @@ -34779,27 +36502,27 @@ }, {} ], - "operationId": "putMcpServer", - "description": "Create or replace mcp_server. If there is an existing mcp_server with the same name as the one specified in the request, will replace the existing mcp_server with the provided fields", - "summary": "Create or replace mcp_server", + "operationId": "putDatasetSnapshot", + "description": "Create or replace dataset_snapshot. If there is an existing dataset_snapshot with the same name as the one specified in the request, will replace the existing dataset_snapshot with the provided fields", + "summary": "Create or replace dataset_snapshot", "requestBody": { - "description": "Any desired information about the new mcp_server object", + "description": "Any desired information about the new dataset_snapshot object", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateMCPServer" + "$ref": "#/components/schemas/CreateDatasetSnapshot" } } } }, "responses": { "200": { - "description": "Returns the new mcp_server object", + "description": "Returns the new dataset_snapshot object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServer" + "$ref": "#/components/schemas/DatasetSnapshot" } } } @@ -34889,12 +36612,12 @@ } }, "get": { - "operationId": "getMcpServer", + "operationId": "getDatasetSnapshot", "tags": [ - "McpServers" + "DatasetSnapshots" ], - "description": "List out all mcp_servers. The mcp_servers are sorted by creation date, with the most recently-created mcp_servers coming first", - "summary": "List mcp_servers", + "description": "List out all dataset_snapshots. The dataset_snapshots are sorted by creation date, with the most recently-created dataset_snapshots coming first", + "summary": "List dataset_snapshots", "security": [ { "bearerAuth": [] @@ -34915,7 +36638,7 @@ "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/McpServerName" + "$ref": "#/components/parameters/DatasetSnapshotName" }, { "$ref": "#/components/parameters/OrgName" @@ -34923,7 +36646,7 @@ ], "responses": { "200": { - "description": "Returns a list of mcp_server objects", + "description": "Returns a list of dataset_snapshot objects", "content": { "application/json": { "schema": { @@ -34932,9 +36655,9 @@ "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/MCPServer" + "$ref": "#/components/schemas/DatasetSnapshot" }, - "description": "A list of mcp_server objects" + "description": "A list of dataset_snapshot objects" } }, "required": [ @@ -35030,9 +36753,9 @@ } }, "options": { - "operationId": "optionsMcpServer", + "operationId": "optionsDatasetSnapshot", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/mcp_server`)", + "summary": "Enable CORS (`/v1/dataset_snapshot`)", "security": [], "tags": [ "CORS" @@ -35087,14 +36810,14 @@ } } }, - "/v1/mcp_server/{mcp_server_id}": { + "/v1/dataset_snapshot/{dataset_snapshot_id}": { "get": { - "operationId": "getMcpServerId", + "operationId": "getDatasetSnapshotId", "tags": [ - "McpServers" + "DatasetSnapshots" ], - "description": "Get a mcp_server object by its id", - "summary": "Get mcp_server", + "description": "Get a dataset_snapshot object by its id", + "summary": "Get dataset_snapshot", "security": [ { "bearerAuth": [] @@ -35103,16 +36826,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/McpServerIdParam" + "$ref": "#/components/parameters/DatasetSnapshotIdParam" } ], "responses": { "200": { - "description": "Returns the mcp_server object", + "description": "Returns the dataset_snapshot object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServer" + "$ref": "#/components/schemas/DatasetSnapshot" } } } @@ -35202,12 +36925,12 @@ } }, "patch": { - "operationId": "patchMcpServerId", + "operationId": "patchDatasetSnapshotId", "tags": [ - "McpServers" + "DatasetSnapshots" ], - "description": "Partially update a mcp_server 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.", - "summary": "Partially update mcp_server", + "description": "Partially update a dataset_snapshot 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.", + "summary": "Partially update dataset_snapshot", "security": [ { "bearerAuth": [] @@ -35216,7 +36939,7 @@ ], "parameters": [ { - "$ref": "#/components/parameters/McpServerIdParam" + "$ref": "#/components/parameters/DatasetSnapshotIdParam" } ], "requestBody": { @@ -35225,18 +36948,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchMCPServer" + "$ref": "#/components/schemas/PatchDatasetSnapshot" } } } }, "responses": { "200": { - "description": "Returns the mcp_server object", + "description": "Returns the dataset_snapshot object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServer" + "$ref": "#/components/schemas/DatasetSnapshot" } } } @@ -35326,12 +37049,12 @@ } }, "delete": { - "operationId": "deleteMcpServerId", + "operationId": "deleteDatasetSnapshotId", "tags": [ - "McpServers" + "DatasetSnapshots" ], - "description": "Delete a mcp_server object by its id", - "summary": "Delete mcp_server", + "description": "Delete a dataset_snapshot object by its id", + "summary": "Delete dataset_snapshot", "security": [ { "bearerAuth": [] @@ -35340,195 +37063,12 @@ ], "parameters": [ { - "$ref": "#/components/parameters/McpServerIdParam" - } - ], - "responses": { - "200": { - "description": "Returns the deleted mcp_server object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MCPServer" - } - } - } - }, - "400": { - "description": "The request was unacceptable, often due to missing a required parameter", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "401": { - "description": "No valid API key provided", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "403": { - "description": "The API key doesn’t have permissions to perform the request", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "429": { - "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", - "headers": { - "Retry-After": { - "schema": { - "type": "string" - } - } - }, - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "500": { - "description": "Something went wrong on Braintrust's end. (These are rare.)", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - } - } - }, - "options": { - "operationId": "optionsMcpServerId", - "description": "Enable CORS", - "summary": "Enable CORS (`/v1/mcp_server/{mcp_server_id}`)", - "security": [], - "tags": [ - "CORS" - ], - "parameters": [ - { - "$ref": "#/components/parameters/McpServerIdParam" - } - ], - "responses": { - "200": { - "description": "Response for CORS method", - "headers": { - "Access-Control-Allow-Credentials": { - "schema": { - "type": "string" - } - }, - "Access-Control-Allow-Headers": { - "schema": { - "type": "string" - } - }, - "Access-Control-Allow-Methods": { - "schema": { - "type": "string" - } - }, - "Access-Control-Allow-Origin": { - "schema": { - "type": "string" - } - }, - "Access-Control-Max-Age": { - "schema": { - "type": "string" - } - } - }, - "content": {} - }, - "400": { - "description": "The request was unacceptable, often due to missing a required parameter", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } + "$ref": "#/components/parameters/DatasetSnapshotIdParam" } - } - } - }, - "/v1/dataset_snapshot": { - "post": { - "tags": [ - "DatasetSnapshots" - ], - "security": [ - { - "bearerAuth": [] - }, - {} ], - "operationId": "postDatasetSnapshot", - "description": "Create a new dataset_snapshot. If there is an existing dataset_snapshot with the same name as the one specified in the request, will return the existing dataset_snapshot unmodified", - "summary": "Create dataset_snapshot", - "requestBody": { - "description": "Any desired information about the new dataset_snapshot object", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateDatasetSnapshot" - } - } - } - }, "responses": { "200": { - "description": "Returns the new dataset_snapshot object", + "description": "Returns the deleted dataset_snapshot object", "content": { "application/json": { "schema": { @@ -35621,9 +37161,76 @@ } } }, - "put": { + "options": { + "operationId": "optionsDatasetSnapshotId", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/dataset_snapshot/{dataset_snapshot_id}`)", + "security": [], "tags": [ - "DatasetSnapshots" + "CORS" + ], + "parameters": [ + { + "$ref": "#/components/parameters/DatasetSnapshotIdParam" + } + ], + "responses": { + "200": { + "description": "Response for CORS method", + "headers": { + "Access-Control-Allow-Credentials": { + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Headers": { + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Methods": { + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Origin": { + "schema": { + "type": "string" + } + }, + "Access-Control-Max-Age": { + "schema": { + "type": "string" + } + } + }, + "content": {} + }, + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } + } + } + } + }, + "/v1/project/{project_id}/simulated_user": { + "get": { + "operationId": "listSimulatedUsers", + "summary": "List simulated users", + "description": "List simulated users in a project, ordered by UUID. Requires project read permission.", + "tags": [ + "Simulated users" ], "security": [ { @@ -35631,27 +37238,79 @@ }, {} ], - "operationId": "putDatasetSnapshot", - "description": "Create or replace dataset_snapshot. If there is an existing dataset_snapshot with the same name as the one specified in the request, will replace the existing dataset_snapshot with the provided fields", - "summary": "Create or replace dataset_snapshot", - "requestBody": { - "description": "Any desired information about the new dataset_snapshot object", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateDatasetSnapshot" - } - } + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true, + "name": "project_id", + "in": "path" + }, + { + "schema": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "maxItems": 1000 + } + ] + }, + "required": false, + "name": "ids", + "in": "query" + }, + { + "schema": { + "type": "string" + }, + "required": false, + "name": "simulated_user_name", + "in": "query" + }, + { + "schema": { + "$ref": "#/components/schemas/AppLimit" + }, + "required": false, + "description": "Limit the number of objects to return", + "name": "limit", + "in": "query" + }, + { + "$ref": "#/components/parameters/StartingAfter" + }, + { + "$ref": "#/components/parameters/EndingBefore" } - }, + ], "responses": { "200": { - "description": "Returns the new dataset_snapshot object", + "description": "The matching simulated users", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DatasetSnapshot" + "type": "object", + "properties": { + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SimulatedUser" + } + } + }, + "required": [ + "objects" + ] } } } @@ -35740,13 +37399,13 @@ } } }, - "get": { - "operationId": "getDatasetSnapshot", + "post": { + "operationId": "createSimulatedUser", + "summary": "Create simulated user", + "description": "Create a simulated user with a new UUID. Display names may repeat. Requires project update permission.", "tags": [ - "DatasetSnapshots" + "Simulated users" ], - "description": "List out all dataset_snapshots. The dataset_snapshots are sorted by creation date, with the most recently-created dataset_snapshots coming first", - "summary": "List dataset_snapshots", "security": [ { "bearerAuth": [] @@ -35755,44 +37414,32 @@ ], "parameters": [ { - "$ref": "#/components/parameters/AppLimitParam" - }, - { - "$ref": "#/components/parameters/StartingAfter" - }, - { - "$ref": "#/components/parameters/EndingBefore" - }, - { - "$ref": "#/components/parameters/Ids" - }, - { - "$ref": "#/components/parameters/DatasetSnapshotName" - }, - { - "$ref": "#/components/parameters/OrgName" + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true, + "name": "project_id", + "in": "path" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSimulatedUser" + } + } + } + }, "responses": { "200": { - "description": "Returns a list of dataset_snapshot objects", + "description": "The simulated user, including its stable UUID", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "objects": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DatasetSnapshot" - }, - "description": "A list of dataset_snapshot objects" - } - }, - "required": [ - "objects" - ], - "additionalProperties": false + "$ref": "#/components/schemas/SimulatedUser" } } } @@ -35882,9 +37529,9 @@ } }, "options": { - "operationId": "optionsDatasetSnapshot", + "operationId": "optionsSimulatedUsers", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/dataset_snapshot`)", + "summary": "Enable CORS (`/v1/project/{project_id}/simulated_user`)", "security": [], "tags": [ "CORS" @@ -35939,14 +37586,14 @@ } } }, - "/v1/dataset_snapshot/{dataset_snapshot_id}": { + "/v1/project/{project_id}/simulated_user/{id}": { "get": { - "operationId": "getDatasetSnapshotId", + "operationId": "getSimulatedUser", + "summary": "Get simulated user", + "description": "Retrieve a simulated user by its UUID within the specified project. Requires project read permission.", "tags": [ - "DatasetSnapshots" + "Simulated users" ], - "description": "Get a dataset_snapshot object by its id", - "summary": "Get dataset_snapshot", "security": [ { "bearerAuth": [] @@ -35955,16 +37602,31 @@ ], "parameters": [ { - "$ref": "#/components/parameters/DatasetSnapshotIdParam" + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true, + "name": "project_id", + "in": "path" + }, + { + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true, + "name": "id", + "in": "path" } ], "responses": { "200": { - "description": "Returns the dataset_snapshot object", + "description": "The simulated user, including its stable UUID", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DatasetSnapshot" + "$ref": "#/components/schemas/SimulatedUser" } } } @@ -36054,12 +37716,12 @@ } }, "patch": { - "operationId": "patchDatasetSnapshotId", + "operationId": "patchSimulatedUser", + "summary": "Update simulated user", + "description": "Update an existing simulated user while preserving its UUID. Supplied voice_config replaces the entire voice configuration. Set goal to null to clear it. Requires project update permission and project read permission because the response includes the stored simulated user.", "tags": [ - "DatasetSnapshots" + "Simulated users" ], - "description": "Partially update a dataset_snapshot 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.", - "summary": "Partially update dataset_snapshot", "security": [ { "bearerAuth": [] @@ -36068,27 +37730,41 @@ ], "parameters": [ { - "$ref": "#/components/parameters/DatasetSnapshotIdParam" + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true, + "name": "project_id", + "in": "path" + }, + { + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true, + "name": "id", + "in": "path" } ], "requestBody": { - "description": "Fields to update", - "required": false, + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchDatasetSnapshot" + "$ref": "#/components/schemas/PatchSimulatedUser" } } } }, "responses": { "200": { - "description": "Returns the dataset_snapshot object", + "description": "The simulated user, including its stable UUID", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DatasetSnapshot" + "$ref": "#/components/schemas/SimulatedUser" } } } @@ -36178,12 +37854,12 @@ } }, "delete": { - "operationId": "deleteDatasetSnapshotId", + "operationId": "deleteSimulatedUser", + "summary": "Delete simulated user", + "description": "Delete an existing simulated user in the specified project. Requires project update permission and project read permission because the response includes the stored simulated user.", "tags": [ - "DatasetSnapshots" + "Simulated users" ], - "description": "Delete a dataset_snapshot object by its id", - "summary": "Delete dataset_snapshot", "security": [ { "bearerAuth": [] @@ -36192,16 +37868,31 @@ ], "parameters": [ { - "$ref": "#/components/parameters/DatasetSnapshotIdParam" + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true, + "name": "project_id", + "in": "path" + }, + { + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true, + "name": "id", + "in": "path" } ], "responses": { "200": { - "description": "Returns the deleted dataset_snapshot object", + "description": "The simulated user, including its stable UUID", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DatasetSnapshot" + "$ref": "#/components/schemas/SimulatedUser" } } } @@ -36291,18 +37982,13 @@ } }, "options": { - "operationId": "optionsDatasetSnapshotId", + "operationId": "optionsSimulatedUser", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/dataset_snapshot/{dataset_snapshot_id}`)", + "summary": "Enable CORS (`/v1/project/{project_id}/simulated_user/{id}`)", "security": [], "tags": [ "CORS" ], - "parameters": [ - { - "$ref": "#/components/parameters/DatasetSnapshotIdParam" - } - ], "responses": { "200": { "description": "Response for CORS method", diff --git a/openapi/spec.yaml b/openapi/spec.yaml index 274a938..1ad07f5 100644 --- a/openapi/spec.yaml +++ b/openapi/spec.yaml @@ -253,6 +253,18 @@ components: OrgName: type: string description: Filter search results to within a particular organization + OrgId: + type: string + format: uuid + description: Identify the organization to list API keys for + CreatedAfter: + type: string + format: date-time + description: Include API keys created at or after this timestamp + CreatedBefore: + type: string + format: date-time + description: Include API keys created at or before this timestamp Ids: anyOf: - type: string @@ -822,6 +834,7 @@ components: - preprocessor - classifier - review + - decision - question - log - null @@ -4726,7 +4739,6 @@ components: items: type: string format: uuid - maxItems: 10000 description: Sorted ids of active projects in this project group required: - id @@ -5318,9 +5330,10 @@ components: harness: type: string enum: - - codex - native + - codex - claude-code + - pi description: Required when saving a Loop automation. Currently only Codex is supported. model: @@ -8594,6 +8607,167 @@ components: - allOf: - $ref: "#/components/schemas/TopicMapData" - title: topic_map + - type: object + properties: + type: + type: string + enum: + - simulation + config: + anyOf: + - type: object + properties: + initiator: + type: string + enum: + - agent + - simulated_user + default: agent + description: Who speaks first in the conversation + timeout_seconds: + type: integer + minimum: 15 + maximum: 3600 + default: 600 + description: Maximum conversation duration in seconds + modality: + type: string + enum: + - voice + default: voice + agent: + oneOf: + - type: object + properties: + type: + type: string + enum: + - livekit + server_url: + type: string + minLength: 1 + description: The WebSocket URL of the LiveKit project hosting the agent + agent_name: + type: string + minLength: 1 + description: The name of the LiveKit agent to dispatch + required: + - type + - server_url + - agent_name + additionalProperties: false + - type: object + properties: + type: + type: string + enum: + - phone + phone_number: + type: string + pattern: ^\+[1-9]\d{7,14}$ + required: + - type + - phone_number + additionalProperties: false + - type: object + properties: + type: + type: string + enum: + - sip + uri: + type: string + pattern: ^sips?:[^\s]+$ + required: + - type + - uri + additionalProperties: false + required: + - agent + additionalProperties: false + - type: object + properties: + initiator: + type: string + enum: + - agent + - simulated_user + default: agent + description: Who speaks first in the conversation + timeout_seconds: + type: integer + minimum: 15 + maximum: 3600 + default: 600 + description: Maximum conversation duration in seconds + modality: + type: string + enum: + - text + agent: + oneOf: + - type: object + properties: + type: + type: string + enum: + - livekit + server_url: + type: string + minLength: 1 + description: The WebSocket URL of the LiveKit project hosting the agent + agent_name: + type: string + minLength: 1 + description: The name of the LiveKit agent to dispatch + required: + - type + - server_url + - agent_name + additionalProperties: false + - type: object + properties: + type: + type: string + enum: + - acp + command: + type: string + minLength: 1 + description: Executable for the ACP agent subprocess, communicating over stdio + args: + type: array + items: + type: string + default: [] + description: Arguments passed to the executable without shell interpretation + cwd: + type: string + pattern: ^(?:\/|[A-Za-z]:[\\/]|\\\\) + description: Absolute working directory for the ACP session on the execution + host + permissions: + type: string + enum: + - deny + default: deny + description: Deny ACP permission requests; this does not sandbox the subprocess + required: + - type + - command + - cwd + additionalProperties: false + required: + - modality + - agent + additionalProperties: false + required: + - type + - config + additionalProperties: false + description: A task function that runs a conversation between an agent and a + simulated user. + title: simulation Function: type: object properties: @@ -8908,6 +9082,167 @@ components: - allOf: - $ref: "#/components/schemas/TopicMapData" - title: topic_map + - type: object + properties: + type: + type: string + enum: + - simulation + config: + anyOf: + - type: object + properties: + initiator: + type: string + enum: + - agent + - simulated_user + default: agent + description: Who speaks first in the conversation + timeout_seconds: + type: integer + minimum: 15 + maximum: 3600 + default: 600 + description: Maximum conversation duration in seconds + modality: + type: string + enum: + - voice + default: voice + agent: + oneOf: + - type: object + properties: + type: + type: string + enum: + - livekit + server_url: + type: string + minLength: 1 + description: The WebSocket URL of the LiveKit project hosting the agent + agent_name: + type: string + minLength: 1 + description: The name of the LiveKit agent to dispatch + required: + - type + - server_url + - agent_name + additionalProperties: false + - type: object + properties: + type: + type: string + enum: + - phone + phone_number: + type: string + pattern: ^\+[1-9]\d{7,14}$ + required: + - type + - phone_number + additionalProperties: false + - type: object + properties: + type: + type: string + enum: + - sip + uri: + type: string + pattern: ^sips?:[^\s]+$ + required: + - type + - uri + additionalProperties: false + required: + - agent + additionalProperties: false + - type: object + properties: + initiator: + type: string + enum: + - agent + - simulated_user + default: agent + description: Who speaks first in the conversation + timeout_seconds: + type: integer + minimum: 15 + maximum: 3600 + default: 600 + description: Maximum conversation duration in seconds + modality: + type: string + enum: + - text + agent: + oneOf: + - type: object + properties: + type: + type: string + enum: + - livekit + server_url: + type: string + minLength: 1 + description: The WebSocket URL of the LiveKit project hosting the agent + agent_name: + type: string + minLength: 1 + description: The name of the LiveKit agent to dispatch + required: + - type + - server_url + - agent_name + additionalProperties: false + - type: object + properties: + type: + type: string + enum: + - acp + command: + type: string + minLength: 1 + description: Executable for the ACP agent subprocess, communicating over stdio + args: + type: array + items: + type: string + default: [] + description: Arguments passed to the executable without shell interpretation + cwd: + type: string + pattern: ^(?:\/|[A-Za-z]:[\\/]|\\\\) + description: Absolute working directory for the ACP session on the execution + host + permissions: + type: string + enum: + - deny + default: deny + description: Deny ACP permission requests; this does not sandbox the subprocess + required: + - type + - command + - cwd + additionalProperties: false + required: + - modality + - agent + additionalProperties: false + required: + - type + - config + additionalProperties: false + description: A task function that runs a conversation between an agent and a + simulated user. + title: simulation - type: "null" PatchFunction: type: object @@ -9097,6 +9432,11 @@ components: options: type: object properties: + filterScope: + type: string + enum: + - span + - trace spanType: type: string nullable: true @@ -9658,11 +9998,10 @@ components: type: string nullable: true description: Optional name of an initial service token to create for the new - service account. This is a narrow compatibility carve-out - only on PATCH /v1/organization/members. When this field is - set, the request must be authenticated with a service - token that has organization-owner permissions, not a user - API key. + service account. When set, authenticate with a UI session + or service token, not a user API key. The caller must own + the organization or the project group specified by + invite_users.project_group_id. token_expires_in_seconds: type: integer nullable: true @@ -9703,6 +10042,12 @@ components: type: string nullable: true description: Singular form of group_names + project_group_id: + type: string + nullable: true + format: uuid + description: Grants new service accounts read access to this project group. + Required when a project-group Owner creates service accounts. description: Users to invite to the organization remove_users: type: object @@ -10215,6 +10560,120 @@ components: type: string nullable: true description: Textual description of the dataset snapshot + SimulatedUserVoiceConfig: + type: object + properties: + voice_id: + type: string + format: uuid + language: + type: string + minLength: 1 + accent: + type: string + minLength: 1 + speaking_rate: + type: number + minimum: 0 + exclusiveMinimum: true + required: + - voice_id + additionalProperties: false + SimulatedUser: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the simulated user + _xact_id: + type: string + description: Legacy transaction id. Not returned by simulated user CRUD. + project_id: + type: string + format: uuid + description: Unique identifier for the project that the simulated user belongs + under + org_id: + type: string + format: uuid + description: Unique identifier for the organization + name: + type: string + minLength: 1 + description: Name of the simulated user + created: + type: string + nullable: true + format: date-time + description: Date of simulated user creation + instructions: + type: string + minLength: 1 + description: The simulated user's role, scenario, and behavior + goal: + type: string + minLength: 1 + description: The simulated user's objective, used to decide when to end the + conversation + voice_config: + $ref: "#/components/schemas/SimulatedUserVoiceConfig" + required: + - id + - project_id + - org_id + - name + - instructions + - voice_config + AppLimit: + type: integer + nullable: true + minimum: 0 + maximum: 1000 + default: 100 + description: Limit the number of objects to return + CreateSimulatedUser: + type: object + properties: + name: + type: string + minLength: 1 + description: Name of the simulated user + instructions: + type: string + minLength: 1 + description: The simulated user's role, scenario, and behavior + goal: + type: string + minLength: 1 + description: The simulated user's objective, used to decide when to end the + conversation + voice_config: + $ref: "#/components/schemas/SimulatedUserVoiceConfig" + required: + - name + - instructions + - voice_config + additionalProperties: false + PatchSimulatedUser: + type: object + properties: + name: + type: string + minLength: 1 + description: Name of the simulated user + instructions: + type: string + minLength: 1 + description: The simulated user's role, scenario, and behavior + goal: + type: string + nullable: true + minLength: 1 + description: The simulated user's objective. Set to null to clear it. + voice_config: + $ref: "#/components/schemas/SimulatedUserVoiceConfig" + additionalProperties: false Environment: type: object properties: @@ -11200,6 +11659,30 @@ components: name: org_name in: query allowReserved: true + OrgId: + schema: + $ref: "#/components/schemas/OrgId" + required: false + description: Identify the organization to list API keys for + name: org_id + in: query + allowReserved: true + CreatedAfter: + schema: + $ref: "#/components/schemas/CreatedAfter" + required: false + description: Include API keys created at or after this timestamp + name: created_after + in: query + allowReserved: true + CreatedBefore: + schema: + $ref: "#/components/schemas/CreatedBefore" + required: false + description: Include API keys created at or before this timestamp + name: created_before + in: query + allowReserved: true Ids: schema: $ref: "#/components/schemas/Ids" @@ -22213,30 +22696,31 @@ paths: application/json: schema: nullable: true - /v1/api_key: + /v1/organization/api_keys: get: - operationId: getApiKey + operationId: getOrganizationApiKeys tags: - - ApiKeys - description: >- - List out all API keys. They are sorted by creation date, with the most - recently-created keys coming first. - - - To create new API keys, visit [**Settings > API - keys**](https://www.braintrust.dev/app/~/configuration/org/api-keys) in - the Braintrust UI. - summary: List api_keys + - Organizations + description: List all API keys associated with users in an organization, sorted + by creation date with the newest keys first. An organization-scoped API + key determines the organization; otherwise, provide `org_id`. If + `org_id` does not match the organization-scoped key's organization, or + the caller is not an owner of the organization, no keys are returned. + Responses include key metadata only; key secrets are never returned. To + list service tokens, use `GET /v1/service_token`. + summary: List organization API keys security: - bearerAuth: [] - {} parameters: - - $ref: "#/components/parameters/AppLimitParam" + - $ref: "#/components/parameters/AppLimitWithDefaultParam" - $ref: "#/components/parameters/StartingAfter" - $ref: "#/components/parameters/EndingBefore" - $ref: "#/components/parameters/Ids" - $ref: "#/components/parameters/ApiKeyName" - - $ref: "#/components/parameters/OrgName" + - $ref: "#/components/parameters/OrgId" + - $ref: "#/components/parameters/CreatedAfter" + - $ref: "#/components/parameters/CreatedBefore" responses: "200": description: Returns a list of api_key objects @@ -22305,9 +22789,9 @@ paths: schema: nullable: true options: - operationId: optionsApiKey + operationId: optionsOrganizationApiKeys description: Enable CORS - summary: Enable CORS (`/v1/api_key`) + summary: Enable CORS (`/v1/organization/api_keys`) security: [] tags: - CORS @@ -22341,25 +22825,46 @@ paths: application/json: schema: nullable: true - /v1/api_key/{api_key_id}: + /v1/api_key: get: - operationId: getApiKeyId + operationId: getApiKey tags: - ApiKeys - description: Get an api_key object by its id - summary: Get api_key + description: >- + List out all API keys. They are sorted by creation date, with the most + recently-created keys coming first. + + + To create new API keys, visit [**Settings > API + keys**](https://www.braintrust.dev/app/~/configuration/org/api-keys) in + the Braintrust UI. + summary: List api_keys security: - bearerAuth: [] - {} parameters: - - $ref: "#/components/parameters/ApiKeyIdParam" + - $ref: "#/components/parameters/AppLimitParam" + - $ref: "#/components/parameters/StartingAfter" + - $ref: "#/components/parameters/EndingBefore" + - $ref: "#/components/parameters/Ids" + - $ref: "#/components/parameters/ApiKeyName" + - $ref: "#/components/parameters/OrgName" responses: "200": - description: Returns the api_key object + description: Returns a list of api_key objects content: application/json: schema: - $ref: "#/components/schemas/ApiKey" + type: object + properties: + objects: + type: array + items: + $ref: "#/components/schemas/ApiKey" + description: A list of api_key objects + required: + - objects + additionalProperties: false "400": description: The request was unacceptable, often due to missing a required parameter @@ -22411,12 +22916,50 @@ paths: application/json: schema: nullable: true - delete: - operationId: deleteApiKeyId + options: + operationId: optionsApiKey + description: Enable CORS + summary: Enable CORS (`/v1/api_key`) + security: [] + tags: + - CORS + responses: + "200": + description: Response for CORS method + headers: + Access-Control-Allow-Credentials: + schema: + type: string + Access-Control-Allow-Headers: + schema: + type: string + Access-Control-Allow-Methods: + schema: + type: string + Access-Control-Allow-Origin: + schema: + type: string + Access-Control-Max-Age: + schema: + type: string + content: {} + "400": + description: The request was unacceptable, often due to missing a required + parameter + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + /v1/api_key/{api_key_id}: + get: + operationId: getApiKeyId tags: - ApiKeys - description: Delete an api_key object by its id - summary: Delete api_key + description: Get an api_key object by its id + summary: Get api_key security: - bearerAuth: [] - {} @@ -22424,7 +22967,7 @@ paths: - $ref: "#/components/parameters/ApiKeyIdParam" responses: "200": - description: Returns the deleted api_key object + description: Returns the api_key object content: application/json: schema: @@ -22480,16 +23023,85 @@ paths: application/json: schema: nullable: true - options: - operationId: optionsApiKeyId - description: Enable CORS - summary: Enable CORS (`/v1/api_key/{api_key_id}`) - security: [] + delete: + operationId: deleteApiKeyId tags: - - CORS - parameters: - - $ref: "#/components/parameters/ApiKeyIdParam" - responses: + - ApiKeys + description: Delete an api_key object by its id + summary: Delete api_key + security: + - bearerAuth: [] + - {} + parameters: + - $ref: "#/components/parameters/ApiKeyIdParam" + responses: + "200": + description: Returns the deleted api_key object + content: + application/json: + schema: + $ref: "#/components/schemas/ApiKey" + "400": + description: The request was unacceptable, often due to missing a required + parameter + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "401": + description: No valid API key provided + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "403": + description: The API key doesn’t have permissions to perform the request + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "429": + description: Too many requests hit the API too quickly. We recommend an + exponential backoff of your requests + headers: + Retry-After: + schema: + type: string + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "500": + description: Something went wrong on Braintrust's end. (These are rare.) + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + options: + operationId: optionsApiKeyId + description: Enable CORS + summary: Enable CORS (`/v1/api_key/{api_key_id}`) + security: [] + tags: + - CORS + parameters: + - $ref: "#/components/parameters/ApiKeyIdParam" + responses: "200": description: Response for CORS method headers: @@ -22531,8 +23143,14 @@ paths: Create a new service token. - When calling this endpoint, you must authenticate using a service token - that has organization-owner permissions. User API keys cannot be used. + Authenticate with a service token. A service token whose service account + is an organization owner can create tokens for any service account. A + service token whose service account holds the Owner role on a project + group can create tokens for a service account in the same organization + when the target account has a permission grant on a project group it + owns. The calling service account must also hold all of the target + account's permissions in the organization; otherwise the request returns + 403. User API keys cannot be used. summary: Create service_token requestBody: description: Any desired information about the new service_token object @@ -22814,7 +23432,7 @@ paths: description: |- List out all service tokens. They are sorted by creation date, with the most recently-created tokens coming first. - To create a service token, visit [**Settings > Service tokens**](https://www.braintrust.dev/app/~/configuration/org/service-tokens) as an organization owner, or call [`POST /v1/service_token`](https://www.braintrust.dev/docs/api-reference/servicetokens/create-service_token) and authenticate with a service token that has organization-owner permissions. + To create a service token, visit [**Settings > Service tokens**](https://www.braintrust.dev/app/~/configuration/org/service-tokens) as an organization owner or an Owner of an active project group in the organization, or call [`POST /v1/service_token`](https://www.braintrust.dev/docs/api-reference/servicetokens/create-service_token) with a service token. Results include only service tokens you can manage. summary: List service_tokens security: - bearerAuth: [] @@ -25401,6 +26019,522 @@ paths: application/json: schema: nullable: true + /v1/project/{project_id}/simulated_user: + get: + operationId: listSimulatedUsers + summary: List simulated users + description: List simulated users in a project, ordered by UUID. Requires + project read permission. + tags: + - Simulated users + security: + - bearerAuth: [] + - {} + parameters: + - schema: + type: string + format: uuid + required: true + name: project_id + in: path + - schema: + anyOf: + - type: string + format: uuid + - type: array + items: + type: string + format: uuid + maxItems: 1000 + required: false + name: ids + in: query + - schema: + type: string + required: false + name: simulated_user_name + in: query + - schema: + $ref: "#/components/schemas/AppLimit" + required: false + description: Limit the number of objects to return + name: limit + in: query + - $ref: "#/components/parameters/StartingAfter" + - $ref: "#/components/parameters/EndingBefore" + responses: + "200": + description: The matching simulated users + content: + application/json: + schema: + type: object + properties: + objects: + type: array + items: + $ref: "#/components/schemas/SimulatedUser" + required: + - objects + "400": + description: The request was unacceptable, often due to missing a required + parameter + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "401": + description: No valid API key provided + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "403": + description: The API key doesn’t have permissions to perform the request + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "429": + description: Too many requests hit the API too quickly. We recommend an + exponential backoff of your requests + headers: + Retry-After: + schema: + type: string + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "500": + description: Something went wrong on Braintrust's end. (These are rare.) + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + post: + operationId: createSimulatedUser + summary: Create simulated user + description: Create a simulated user with a new UUID. Display names may repeat. + Requires project update permission. + tags: + - Simulated users + security: + - bearerAuth: [] + - {} + parameters: + - schema: + type: string + format: uuid + required: true + name: project_id + in: path + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateSimulatedUser" + responses: + "200": + description: The simulated user, including its stable UUID + content: + application/json: + schema: + $ref: "#/components/schemas/SimulatedUser" + "400": + description: The request was unacceptable, often due to missing a required + parameter + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "401": + description: No valid API key provided + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "403": + description: The API key doesn’t have permissions to perform the request + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "429": + description: Too many requests hit the API too quickly. We recommend an + exponential backoff of your requests + headers: + Retry-After: + schema: + type: string + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "500": + description: Something went wrong on Braintrust's end. (These are rare.) + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + options: + operationId: optionsSimulatedUsers + description: Enable CORS + summary: Enable CORS (`/v1/project/{project_id}/simulated_user`) + security: [] + tags: + - CORS + responses: + "200": + description: Response for CORS method + headers: + Access-Control-Allow-Credentials: + schema: + type: string + Access-Control-Allow-Headers: + schema: + type: string + Access-Control-Allow-Methods: + schema: + type: string + Access-Control-Allow-Origin: + schema: + type: string + Access-Control-Max-Age: + schema: + type: string + content: {} + "400": + description: The request was unacceptable, often due to missing a required + parameter + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + /v1/project/{project_id}/simulated_user/{id}: + get: + operationId: getSimulatedUser + summary: Get simulated user + description: Retrieve a simulated user by its UUID within the specified project. + Requires project read permission. + tags: + - Simulated users + security: + - bearerAuth: [] + - {} + parameters: + - schema: + type: string + format: uuid + required: true + name: project_id + in: path + - schema: + type: string + format: uuid + required: true + name: id + in: path + responses: + "200": + description: The simulated user, including its stable UUID + content: + application/json: + schema: + $ref: "#/components/schemas/SimulatedUser" + "400": + description: The request was unacceptable, often due to missing a required + parameter + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "401": + description: No valid API key provided + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "403": + description: The API key doesn’t have permissions to perform the request + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "429": + description: Too many requests hit the API too quickly. We recommend an + exponential backoff of your requests + headers: + Retry-After: + schema: + type: string + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "500": + description: Something went wrong on Braintrust's end. (These are rare.) + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + patch: + operationId: patchSimulatedUser + summary: Update simulated user + description: Update an existing simulated user while preserving its UUID. + Supplied voice_config replaces the entire voice configuration. Set goal + to null to clear it. Requires project update permission and project read + permission because the response includes the stored simulated user. + tags: + - Simulated users + security: + - bearerAuth: [] + - {} + parameters: + - schema: + type: string + format: uuid + required: true + name: project_id + in: path + - schema: + type: string + format: uuid + required: true + name: id + in: path + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PatchSimulatedUser" + responses: + "200": + description: The simulated user, including its stable UUID + content: + application/json: + schema: + $ref: "#/components/schemas/SimulatedUser" + "400": + description: The request was unacceptable, often due to missing a required + parameter + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "401": + description: No valid API key provided + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "403": + description: The API key doesn’t have permissions to perform the request + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "429": + description: Too many requests hit the API too quickly. We recommend an + exponential backoff of your requests + headers: + Retry-After: + schema: + type: string + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "500": + description: Something went wrong on Braintrust's end. (These are rare.) + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + delete: + operationId: deleteSimulatedUser + summary: Delete simulated user + description: Delete an existing simulated user in the specified project. + Requires project update permission and project read permission because + the response includes the stored simulated user. + tags: + - Simulated users + security: + - bearerAuth: [] + - {} + parameters: + - schema: + type: string + format: uuid + required: true + name: project_id + in: path + - schema: + type: string + format: uuid + required: true + name: id + in: path + responses: + "200": + description: The simulated user, including its stable UUID + content: + application/json: + schema: + $ref: "#/components/schemas/SimulatedUser" + "400": + description: The request was unacceptable, often due to missing a required + parameter + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "401": + description: No valid API key provided + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "403": + description: The API key doesn’t have permissions to perform the request + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "429": + description: Too many requests hit the API too quickly. We recommend an + exponential backoff of your requests + headers: + Retry-After: + schema: + type: string + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + "500": + description: Something went wrong on Braintrust's end. (These are rare.) + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true + options: + operationId: optionsSimulatedUser + description: Enable CORS + summary: Enable CORS (`/v1/project/{project_id}/simulated_user/{id}`) + security: [] + tags: + - CORS + responses: + "200": + description: Response for CORS method + headers: + Access-Control-Allow-Credentials: + schema: + type: string + Access-Control-Allow-Headers: + schema: + type: string + Access-Control-Allow-Methods: + schema: + type: string + Access-Control-Allow-Origin: + schema: + type: string + Access-Control-Max-Age: + schema: + type: string + content: {} + "400": + description: The request was unacceptable, often due to missing a required + parameter + content: + text/plain: + schema: + type: string + application/json: + schema: + nullable: true /environment: get: operationId: listEnvironments