diff --git a/openapi/spec.json b/openapi/spec.json index 7f99fe0..750f8bc 100644 --- a/openapi/spec.json +++ b/openapi/spec.json @@ -74,11 +74,6 @@ "format": "uuid", "description": "User id" }, - "AgentIdParam": { - "type": "string", - "format": "uuid", - "description": "Agent id" - }, "ProjectAutomationIdParam": { "type": "string", "format": "uuid", @@ -177,10 +172,6 @@ "type": "string", "description": "Name of the group to search for" }, - "AgentName": { - "type": "string", - "description": "Name of the agent to search for" - }, "ProjectAutomationName": { "type": "string", "description": "Name of the project_automation to search for" @@ -396,8 +387,7 @@ "role", "org_member", "project_log", - "org_project", - "org_audit_logs" + "org_project" ], "description": "The object type that the ACL applies to" }, @@ -419,8 +409,7 @@ "role", "org_member", "project_log", - "org_project", - "org_audit_logs" + "org_project" ], "description": "The object type that the ACL applies to" }, @@ -466,8 +455,7 @@ "role", "org_member", "project_log", - "org_project", - "org_audit_logs" + "org_project" ], "description": "The object type that the ACL applies to" }, @@ -5084,121 +5072,6 @@ "id" ] }, - "Agent": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Unique identifier for the agent" - }, - "project_id": { - "type": "string", - "format": "uuid", - "description": "Unique identifier for the project that the agent belongs under" - }, - "user_id": { - "type": "string", - "format": "uuid" - }, - "created": { - "type": "string", - "nullable": true, - "format": "date-time", - "description": "Date of agent creation" - }, - "name": { - "type": "string", - "description": "Name of the agent. Within a project, agent names are unique" - }, - "slug": { - "type": "string", - "description": "Stable, URL-safe identifier for the agent, unique within its project." - }, - "kind": { - "type": "string", - "description": "Agent classification: 'custom' for customer-defined agents, 'loop' for built-in Loop agents." - }, - "description": { - "type": "string", - "nullable": true, - "description": "Textual description of the agent" - }, - "metadata": { - "type": "object", - "nullable": true, - "additionalProperties": { - "nullable": true - }, - "description": "User-controlled metadata about the agent" - } - }, - "required": [ - "id", - "project_id", - "user_id", - "name", - "slug", - "kind" - ], - "description": "An agent is a project-scoped durable object that identifies an AI agent or service emitting spans" - }, - "CreateAgent": { - "type": "object", - "properties": { - "project_id": { - "type": "string", - "format": "uuid", - "description": "Unique identifier for the project that the agent belongs under" - }, - "name": { - "type": "string", - "description": "Name of the agent. Within a project, agent names are unique" - }, - "description": { - "type": "string", - "nullable": true, - "description": "Textual description of the agent" - }, - "metadata": { - "type": "object", - "nullable": true, - "additionalProperties": { - "nullable": true - }, - "description": "User-controlled metadata about the agent" - } - }, - "required": [ - "project_id", - "name" - ], - "description": "An agent is a project-scoped durable object that identifies an AI agent or service emitting spans" - }, - "PatchAgent": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true, - "description": "Name of the agent. Within a project, agent names are unique" - }, - "description": { - "type": "string", - "nullable": true, - "description": "Textual description of the agent" - }, - "metadata": { - "type": "object", - "nullable": true, - "additionalProperties": { - "nullable": true - }, - "description": "User-controlled metadata about the agent" - } - }, - "description": "An agent is a project-scoped durable object that identifies an AI agent or service emitting spans" - }, "AutomationStatus": { "type": "string", "enum": [ @@ -5589,77 +5462,6 @@ "topic_map_functions" ] }, - "TopicDigestAutomationConfig": { - "type": "object", - "properties": { - "event_type": { - "type": "string", - "enum": [ - "topic_digest" - ], - "description": "The type of automation." - }, - "status": { - "$ref": "#/components/schemas/AutomationStatus" - }, - "window_seconds": { - "type": "integer", - "minimum": 3600, - "maximum": 2592000, - "default": 86400, - "description": "How much recent history to include in each digest" - }, - "scheduled_time_minutes_utc": { - "type": "integer", - "minimum": 0, - "maximum": 1439, - "description": "Minutes after midnight UTC when the digest should be sent" - }, - "action": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "slack" - ], - "description": "The type of action to take" - }, - "workspace_id": { - "type": "string", - "description": "The Slack workspace ID to post to" - }, - "channel": { - "type": "string", - "description": "The Slack channel ID to post to" - }, - "message_template": { - "type": "string", - "description": "Custom message template for the alert" - } - }, - "required": [ - "type", - "workspace_id", - "channel" - ], - "description": "The Slack action to take when the digest is sent" - }, - "topic_map_function_ids": { - "type": "array", - "items": { - "type": "string" - }, - "maxItems": 10, - "description": "Optional topic map function IDs to include in the digest" - } - }, - "required": [ - "event_type", - "scheduled_time_minutes_utc", - "action" - ] - }, "ProjectAutomation": { "type": "object", "properties": { @@ -5940,67 +5742,6 @@ "credentials" ] }, - { - "type": "object", - "properties": { - "event_type": { - "type": "string", - "enum": [ - "async_query" - ], - "description": "The type of automation." - }, - "status": { - "$ref": "#/components/schemas/AutomationStatus" - }, - "created_by_user_id": { - "type": "string", - "format": "uuid", - "description": "The user who submitted the async query" - }, - "object_type": { - "type": "string", - "enum": [ - "project_logs", - "experiment", - "dataset", - "playground_logs" - ], - "description": "The source object type for the async query" - }, - "object_id": { - "type": "string", - "description": "The source object ID for the async query" - }, - "query": { - "type": "string", - "description": "The SQL query to execute asynchronously" - }, - "format": { - "type": "string", - "enum": [ - "jsonl" - ], - "description": "The materialized result format" - }, - "batch_size": { - "type": "integer", - "nullable": true, - "minimum": 0, - "exclusiveMinimum": true, - "maximum": 100000, - "description": "The maximum number of result rows to write per async query batch" - } - }, - "required": [ - "event_type", - "created_by_user_id", - "object_type", - "object_id", - "query", - "format" - ] - }, { "type": "object", "properties": { @@ -6105,9 +5846,6 @@ }, { "$ref": "#/components/schemas/TopicAutomationConfig" - }, - { - "$ref": "#/components/schemas/TopicDigestAutomationConfig" } ], "description": "The configuration for the automation rule" @@ -6383,67 +6121,6 @@ "credentials" ] }, - { - "type": "object", - "properties": { - "event_type": { - "type": "string", - "enum": [ - "async_query" - ], - "description": "The type of automation." - }, - "status": { - "$ref": "#/components/schemas/AutomationStatus" - }, - "created_by_user_id": { - "type": "string", - "format": "uuid", - "description": "The user who submitted the async query" - }, - "object_type": { - "type": "string", - "enum": [ - "project_logs", - "experiment", - "dataset", - "playground_logs" - ], - "description": "The source object type for the async query" - }, - "object_id": { - "type": "string", - "description": "The source object ID for the async query" - }, - "query": { - "type": "string", - "description": "The SQL query to execute asynchronously" - }, - "format": { - "type": "string", - "enum": [ - "jsonl" - ], - "description": "The materialized result format" - }, - "batch_size": { - "type": "integer", - "nullable": true, - "minimum": 0, - "exclusiveMinimum": true, - "maximum": 100000, - "description": "The maximum number of result rows to write per async query batch" - } - }, - "required": [ - "event_type", - "created_by_user_id", - "object_type", - "object_id", - "query", - "format" - ] - }, { "type": "object", "properties": { @@ -6548,9 +6225,6 @@ }, { "$ref": "#/components/schemas/TopicAutomationConfig" - }, - { - "$ref": "#/components/schemas/TopicDigestAutomationConfig" } ], "description": "The configuration for the automation rule" @@ -6827,90 +6501,29 @@ "event_type": { "type": "string", "enum": [ - "async_query" + "retention" ], "description": "The type of automation." }, - "status": { - "$ref": "#/components/schemas/AutomationStatus" - }, - "created_by_user_id": { - "type": "string", - "format": "uuid", - "description": "The user who submitted the async query" - }, "object_type": { - "type": "string", - "enum": [ - "project_logs", - "experiment", - "dataset", - "playground_logs" - ], - "description": "The source object type for the async query" - }, - "object_id": { - "type": "string", - "description": "The source object ID for the async query" - }, - "query": { - "type": "string", - "description": "The SQL query to execute asynchronously" - }, - "format": { - "type": "string", - "enum": [ - "jsonl" - ], - "description": "The materialized result format" - }, - "batch_size": { - "type": "integer", - "nullable": true, - "minimum": 0, - "exclusiveMinimum": true, - "maximum": 100000, - "description": "The maximum number of result rows to write per async query batch" - } - }, - "required": [ - "event_type", - "created_by_user_id", - "object_type", - "object_id", - "query", - "format" - ] - }, - { - "type": "object", - "properties": { - "event_type": { - "type": "string", - "enum": [ - "retention" - ], - "description": "The type of automation." - }, - "object_type": { - "$ref": "#/components/schemas/RetentionObjectType" - }, - "retention_days": { - "type": "number", - "minimum": 0, - "description": "The number of days to retain the object" - } - }, - "required": [ - "event_type", - "object_type", - "retention_days" - ] - }, - { - "type": "object", - "properties": { - "event_type": { + "$ref": "#/components/schemas/RetentionObjectType" + }, + "retention_days": { + "type": "number", + "minimum": 0, + "description": "The number of days to retain the object" + } + }, + "required": [ + "event_type", + "object_type", + "retention_days" + ] + }, + { + "type": "object", + "properties": { + "event_type": { "type": "string", "enum": [ "environment_update" @@ -6987,9 +6600,6 @@ { "$ref": "#/components/schemas/TopicAutomationConfig" }, - { - "$ref": "#/components/schemas/TopicDigestAutomationConfig" - }, { "nullable": true } @@ -7158,7 +6768,7 @@ "type": "null" } ], - "description": "The scope at which to run the functions. Defaults to span-level execution." + "description": "The scope at which to run the functions. Defaults to span-level execution. Trace/group scope requires all functions to be facets." } }, "required": [ @@ -7166,48 +6776,6 @@ "scorers" ] }, - "ProjectScoreCondition": { - "type": "object", - "nullable": true, - "properties": { - "when": { - "type": "object", - "properties": { - "clauses": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - }, - "subspan_clauses": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - }, - "trace_clauses": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - } - } - }, - "behavior": { - "type": "string", - "enum": [ - "hidden" - ], - "default": "hidden" - } - }, - "required": [ - "when" - ] - }, "ProjectScoreConfig": { "type": "object", "nullable": true, @@ -7220,43 +6788,8 @@ "type": "string", "nullable": true }, - "visibility": { - "type": "object", - "nullable": true, - "properties": { - "users": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - }, - "groups": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - } - } - }, "online": { "$ref": "#/components/schemas/OnlineScoreConfig" - }, - "condition": { - "$ref": "#/components/schemas/ProjectScoreCondition" - }, - "object_types": { - "type": "array", - "nullable": true, - "items": { - "type": "string", - "enum": [ - "project_logs", - "dataset", - "experiment" - ] - } } } }, @@ -8413,14 +7946,6 @@ "distance_threshold": { "type": "number", "description": "Maximum distance to nearest centroid. If exceeded, returns no_match." - }, - "btql_filter": { - "type": "string", - "description": "Per-topic-map BTQL filter that was applied when this version was generated. Absent on versions generated before this was recorded." - }, - "automation_btql_filter": { - "type": "string", - "description": "Automation-level BTQL filter that was applied when this version was generated. Absent on versions generated before this was recorded." } }, "required": [ @@ -11714,15 +11239,6 @@ "name": "user_id", "in": "path" }, - "AgentIdParam": { - "schema": { - "$ref": "#/components/schemas/AgentIdParam" - }, - "required": true, - "description": "Agent id", - "name": "agent_id", - "in": "path" - }, "ProjectAutomationIdParam": { "schema": { "$ref": "#/components/schemas/ProjectAutomationIdParam" @@ -11919,16 +11435,6 @@ "in": "query", "allowReserved": true }, - "AgentName": { - "schema": { - "$ref": "#/components/schemas/AgentName" - }, - "required": false, - "description": "Name of the agent to search for", - "name": "agent_name", - "in": "query", - "allowReserved": true - }, "ProjectAutomationName": { "schema": { "$ref": "#/components/schemas/ProjectAutomationName" @@ -19706,6 +19212,125 @@ } } }, + "delete": { + "operationId": "deleteAcl", + "tags": [ + "Acls" + ], + "description": "Delete a single acl", + "summary": "Delete single acl", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "requestBody": { + "description": "Parameters which uniquely specify the acl to delete", + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AclItem" + } + } + } + }, + "responses": { + "200": { + "description": "Returns the deleted acl object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Acl" + } + } + } + }, + "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": "getAcl", "tags": [ @@ -20773,875 +20398,21 @@ "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/user/{user_id}": { - "get": { - "operationId": "getUserId", - "tags": [ - "Users" - ], - "description": "Get a user object by its id", - "summary": "Get user", - "security": [ - { - "bearerAuth": [] - }, - {} - ], - "parameters": [ - { - "$ref": "#/components/parameters/UserIdParam" - } - ], - "responses": { - "200": { - "description": "Returns the user object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - } - }, - "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": "optionsUserId", - "description": "Enable CORS", - "summary": "Enable CORS (`/v1/user/{user_id}`)", - "security": [], - "tags": [ - "CORS" - ], - "parameters": [ - { - "$ref": "#/components/parameters/UserIdParam" - } - ], - "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/agent": { - "post": { - "tags": [ - "Agents" - ], - "security": [ - { - "bearerAuth": [] - }, - {} - ], - "operationId": "postAgent", - "description": "Create a new agent. If there is an existing agent with the same name as the one specified in the request, will return the existing agent unmodified", - "summary": "Create agent", - "requestBody": { - "description": "Any desired information about the new agent object", - "required": false, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateAgent" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the new agent object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Agent" - } - } - } - }, - "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": [ - "Agents" - ], - "security": [ - { - "bearerAuth": [] - }, - {} - ], - "operationId": "putAgent", - "description": "Create or replace agent. If there is an existing agent with the same name as the one specified in the request, will replace the existing agent with the provided fields", - "summary": "Create or replace agent", - "requestBody": { - "description": "Any desired information about the new agent object", - "required": false, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateAgent" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the new agent object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Agent" - } - } - } - }, - "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": "getAgent", - "tags": [ - "Agents" - ], - "description": "List out all agents. The agents are sorted by creation date, with the most recently-created agents coming first", - "summary": "List agents", - "security": [ - { - "bearerAuth": [] - }, - {} - ], - "parameters": [ - { - "$ref": "#/components/parameters/AppLimitParam" - }, - { - "$ref": "#/components/parameters/StartingAfter" - }, - { - "$ref": "#/components/parameters/EndingBefore" - }, - { - "$ref": "#/components/parameters/Ids" - }, - { - "$ref": "#/components/parameters/AgentName" - }, - { - "$ref": "#/components/parameters/OrgName" - } - ], - "responses": { - "200": { - "description": "Returns a list of agent objects", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "objects": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Agent" - }, - "description": "A list of agent 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": "optionsAgent", - "description": "Enable CORS", - "summary": "Enable CORS (`/v1/agent`)", - "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/agent/{agent_id}": { - "get": { - "operationId": "getAgentId", - "tags": [ - "Agents" - ], - "description": "Get a agent object by its id", - "summary": "Get agent", - "security": [ - { - "bearerAuth": [] - }, - {} - ], - "parameters": [ - { - "$ref": "#/components/parameters/AgentIdParam" - } - ], - "responses": { - "200": { - "description": "Returns the agent object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Agent" - } - } - } - }, - "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": "patchAgentId", - "tags": [ - "Agents" - ], - "description": "Partially update a agent 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 agent", - "security": [ - { - "bearerAuth": [] - }, - {} - ], - "parameters": [ - { - "$ref": "#/components/parameters/AgentIdParam" - } - ], - "requestBody": { - "description": "Fields to update", - "required": false, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PatchAgent" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the agent object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Agent" - } - } - } - }, - "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": { + "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, - "application/json": { + "Access-Control-Max-Age": { "schema": { - "nullable": true + "type": "string" } } - } + }, + "content": {} }, - "500": { - "description": "Something went wrong on Braintrust's end. (These are rare.)", + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { @@ -21656,14 +20427,16 @@ } } } - }, - "delete": { - "operationId": "deleteAgentId", + } + }, + "/v1/user/{user_id}": { + "get": { + "operationId": "getUserId", "tags": [ - "Agents" + "Users" ], - "description": "Delete a agent object by its id", - "summary": "Delete agent", + "description": "Get a user object by its id", + "summary": "Get user", "security": [ { "bearerAuth": [] @@ -21672,16 +20445,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/AgentIdParam" + "$ref": "#/components/parameters/UserIdParam" } ], "responses": { "200": { - "description": "Returns the deleted agent object", + "description": "Returns the user object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Agent" + "$ref": "#/components/schemas/User" } } } @@ -21771,16 +20544,16 @@ } }, "options": { - "operationId": "optionsAgentId", + "operationId": "optionsUserId", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/agent/{agent_id}`)", + "summary": "Enable CORS (`/v1/user/{user_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/AgentIdParam" + "$ref": "#/components/parameters/UserIdParam" } ], "responses": { @@ -28552,6 +27325,125 @@ } } }, + "delete": { + "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": false, + "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": [ @@ -29280,6 +28172,125 @@ } } }, + "delete": { + "operationId": "deleteAiSecret", + "tags": [ + "AiSecrets" + ], + "description": "Delete a single ai_secret", + "summary": "Delete single ai_secret", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "requestBody": { + "description": "Parameters which uniquely specify the ai_secret to delete", + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteAISecret" + } + } + } + }, + "responses": { + "200": { + "description": "Returns the deleted 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 + } + } + } + } + } + }, "get": { "operationId": "getAiSecret", "tags": [ diff --git a/openapi/spec.yaml b/openapi/spec.yaml index 5082764..6be9bdd 100644 --- a/openapi/spec.yaml +++ b/openapi/spec.yaml @@ -64,10 +64,6 @@ components: type: string format: uuid description: User id - AgentIdParam: - type: string - format: uuid - description: Agent id ProjectAutomationIdParam: type: string format: uuid @@ -145,9 +141,6 @@ components: GroupName: type: string description: Name of the group to search for - AgentName: - type: string - description: Name of the agent to search for ProjectAutomationName: type: string description: Name of the project_automation to search for @@ -391,7 +384,6 @@ components: - org_member - project_log - org_project - - org_audit_logs description: The object type that the ACL applies to AclObjectId: type: string @@ -411,7 +403,6 @@ components: - org_member - project_log - org_project - - org_audit_logs description: The object type that the ACL applies to AclListOrgObjectId: type: string @@ -459,7 +450,6 @@ components: - org_member - project_log - org_project - - org_audit_logs description: The object type that the ACL applies to AclListRoleId: type: string @@ -4586,98 +4576,6 @@ components: description: Date of user creation required: - id - Agent: - type: object - properties: - id: - type: string - format: uuid - description: Unique identifier for the agent - project_id: - type: string - format: uuid - description: Unique identifier for the project that the agent belongs under - user_id: - type: string - format: uuid - created: - type: string - nullable: true - format: date-time - description: Date of agent creation - name: - type: string - description: Name of the agent. Within a project, agent names are unique - slug: - type: string - description: Stable, URL-safe identifier for the agent, unique within its project. - kind: - type: string - description: "Agent classification: 'custom' for customer-defined agents, 'loop' - for built-in Loop agents." - description: - type: string - nullable: true - description: Textual description of the agent - metadata: - type: object - nullable: true - additionalProperties: - nullable: true - description: User-controlled metadata about the agent - required: - - id - - project_id - - user_id - - name - - slug - - kind - description: An agent is a project-scoped durable object that identifies an AI - agent or service emitting spans - CreateAgent: - type: object - properties: - project_id: - type: string - format: uuid - description: Unique identifier for the project that the agent belongs under - name: - type: string - description: Name of the agent. Within a project, agent names are unique - description: - type: string - nullable: true - description: Textual description of the agent - metadata: - type: object - nullable: true - additionalProperties: - nullable: true - description: User-controlled metadata about the agent - required: - - project_id - - name - description: An agent is a project-scoped durable object that identifies an AI - agent or service emitting spans - PatchAgent: - type: object - properties: - name: - type: string - nullable: true - description: Name of the agent. Within a project, agent names are unique - description: - type: string - nullable: true - description: Textual description of the agent - metadata: - type: object - nullable: true - additionalProperties: - nullable: true - description: User-controlled metadata about the agent - description: An agent is a project-scoped durable object that identifies an AI - agent or service emitting spans AutomationStatus: type: string enum: @@ -4936,59 +4834,6 @@ components: - sampling_rate - facet_functions - topic_map_functions - TopicDigestAutomationConfig: - type: object - properties: - event_type: - type: string - enum: - - topic_digest - description: The type of automation. - status: - $ref: "#/components/schemas/AutomationStatus" - window_seconds: - type: integer - minimum: 3600 - maximum: 2592000 - default: 86400 - description: How much recent history to include in each digest - scheduled_time_minutes_utc: - type: integer - minimum: 0 - maximum: 1439 - description: Minutes after midnight UTC when the digest should be sent - action: - type: object - properties: - type: - type: string - enum: - - slack - description: The type of action to take - workspace_id: - type: string - description: The Slack workspace ID to post to - channel: - type: string - description: The Slack channel ID to post to - message_template: - type: string - description: Custom message template for the alert - required: - - type - - workspace_id - - channel - description: The Slack action to take when the digest is sent - topic_map_function_ids: - type: array - items: - type: string - maxItems: 10 - description: Optional topic map function IDs to include in the digest - required: - - event_type - - scheduled_time_minutes_utc - - action ProjectAutomation: type: object properties: @@ -5183,52 +5028,6 @@ components: - format - interval_seconds - credentials - - type: object - properties: - event_type: - type: string - enum: - - async_query - description: The type of automation. - status: - $ref: "#/components/schemas/AutomationStatus" - created_by_user_id: - type: string - format: uuid - description: The user who submitted the async query - object_type: - type: string - enum: - - project_logs - - experiment - - dataset - - playground_logs - description: The source object type for the async query - object_id: - type: string - description: The source object ID for the async query - query: - type: string - description: The SQL query to execute asynchronously - format: - type: string - enum: - - jsonl - description: The materialized result format - batch_size: - type: integer - nullable: true - minimum: 0 - exclusiveMinimum: true - maximum: 100000 - description: The maximum number of result rows to write per async query batch - required: - - event_type - - created_by_user_id - - object_type - - object_id - - query - - format - type: object properties: event_type: @@ -5298,7 +5097,6 @@ components: - event_type - action - $ref: "#/components/schemas/TopicAutomationConfig" - - $ref: "#/components/schemas/TopicDigestAutomationConfig" description: The configuration for the automation rule required: - id @@ -5485,52 +5283,6 @@ components: - format - interval_seconds - credentials - - type: object - properties: - event_type: - type: string - enum: - - async_query - description: The type of automation. - status: - $ref: "#/components/schemas/AutomationStatus" - created_by_user_id: - type: string - format: uuid - description: The user who submitted the async query - object_type: - type: string - enum: - - project_logs - - experiment - - dataset - - playground_logs - description: The source object type for the async query - object_id: - type: string - description: The source object ID for the async query - query: - type: string - description: The SQL query to execute asynchronously - format: - type: string - enum: - - jsonl - description: The materialized result format - batch_size: - type: integer - nullable: true - minimum: 0 - exclusiveMinimum: true - maximum: 100000 - description: The maximum number of result rows to write per async query batch - required: - - event_type - - created_by_user_id - - object_type - - object_id - - query - - format - type: object properties: event_type: @@ -5600,7 +5352,6 @@ components: - event_type - action - $ref: "#/components/schemas/TopicAutomationConfig" - - $ref: "#/components/schemas/TopicDigestAutomationConfig" description: The configuration for the automation rule required: - project_id @@ -5782,52 +5533,6 @@ components: - format - interval_seconds - credentials - - type: object - properties: - event_type: - type: string - enum: - - async_query - description: The type of automation. - status: - $ref: "#/components/schemas/AutomationStatus" - created_by_user_id: - type: string - format: uuid - description: The user who submitted the async query - object_type: - type: string - enum: - - project_logs - - experiment - - dataset - - playground_logs - description: The source object type for the async query - object_id: - type: string - description: The source object ID for the async query - query: - type: string - description: The SQL query to execute asynchronously - format: - type: string - enum: - - jsonl - description: The materialized result format - batch_size: - type: integer - nullable: true - minimum: 0 - exclusiveMinimum: true - maximum: 100000 - description: The maximum number of result rows to write per async query batch - required: - - event_type - - created_by_user_id - - object_type - - object_id - - query - - format - type: object properties: event_type: @@ -5897,7 +5602,6 @@ components: - event_type - action - $ref: "#/components/schemas/TopicAutomationConfig" - - $ref: "#/components/schemas/TopicDigestAutomationConfig" - nullable: true description: The configuration for the automation rule ProjectScoreCategory: @@ -6006,39 +5710,10 @@ components: - $ref: "#/components/schemas/GroupScope" - type: "null" description: The scope at which to run the functions. Defaults to span-level - execution. + execution. Trace/group scope requires all functions to be facets. required: - sampling_rate - scorers - ProjectScoreCondition: - type: object - nullable: true - properties: - when: - type: object - properties: - clauses: - type: array - nullable: true - items: - type: string - subspan_clauses: - type: array - nullable: true - items: - type: string - trace_clauses: - type: array - nullable: true - items: - type: string - behavior: - type: string - enum: - - hidden - default: hidden - required: - - when ProjectScoreConfig: type: object nullable: true @@ -6049,33 +5724,8 @@ components: destination: type: string nullable: true - visibility: - type: object - nullable: true - properties: - users: - type: array - nullable: true - items: - type: string - groups: - type: array - nullable: true - items: - type: string online: $ref: "#/components/schemas/OnlineScoreConfig" - condition: - $ref: "#/components/schemas/ProjectScoreCondition" - object_types: - type: array - nullable: true - items: - type: string - enum: - - project_logs - - dataset - - experiment ProjectScore: type: object properties: @@ -6910,14 +6560,6 @@ components: distance_threshold: type: number description: Maximum distance to nearest centroid. If exceeded, returns no_match. - btql_filter: - type: string - description: Per-topic-map BTQL filter that was applied when this version was - generated. Absent on versions generated before this was recorded. - automation_btql_filter: - type: string - description: Automation-level BTQL filter that was applied when this version was - generated. Absent on versions generated before this was recorded. required: - type - source_facet @@ -9347,13 +8989,6 @@ components: description: User id name: user_id in: path - AgentIdParam: - schema: - $ref: "#/components/schemas/AgentIdParam" - required: true - description: Agent id - name: agent_id - in: path ProjectAutomationIdParam: schema: $ref: "#/components/schemas/ProjectAutomationIdParam" @@ -9508,14 +9143,6 @@ components: name: group_name in: query allowReserved: true - AgentName: - schema: - $ref: "#/components/schemas/AgentName" - required: false - description: Name of the agent to search for - name: agent_name - in: query - allowReserved: true ProjectAutomationName: schema: $ref: "#/components/schemas/ProjectAutomationName" @@ -14491,31 +14118,105 @@ paths: application/json: schema: nullable: true - get: - operationId: getAcl + delete: + operationId: deleteAcl tags: - Acls - description: List out all acls. The acls are sorted by creation date, with the - most recently-created acls coming first - summary: List acls + description: Delete a single acl + summary: Delete single acl security: - bearerAuth: [] - {} - parameters: - - $ref: "#/components/parameters/AppLimitParam" - - $ref: "#/components/parameters/StartingAfter" - - $ref: "#/components/parameters/EndingBefore" - - $ref: "#/components/parameters/Ids" - - $ref: "#/components/parameters/AclObjectType" - - $ref: "#/components/parameters/AclObjectId" - - $ref: "#/components/parameters/AclListUserId" - - $ref: "#/components/parameters/AclListGroupId" - - $ref: "#/components/parameters/AclListPermission" - - $ref: "#/components/parameters/AclListRestrictObjectType" - - $ref: "#/components/parameters/AclListRoleId" + requestBody: + description: Parameters which uniquely specify the acl to delete + required: false + content: + application/json: + schema: + $ref: "#/components/schemas/AclItem" responses: "200": - description: Returns a list of acl objects + description: Returns the deleted acl object + content: + application/json: + schema: + $ref: "#/components/schemas/Acl" + "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: getAcl + tags: + - Acls + description: List out all acls. The acls are sorted by creation date, with the + most recently-created acls coming first + summary: List acls + security: + - bearerAuth: [] + - {} + parameters: + - $ref: "#/components/parameters/AppLimitParam" + - $ref: "#/components/parameters/StartingAfter" + - $ref: "#/components/parameters/EndingBefore" + - $ref: "#/components/parameters/Ids" + - $ref: "#/components/parameters/AclObjectType" + - $ref: "#/components/parameters/AclObjectId" + - $ref: "#/components/parameters/AclListUserId" + - $ref: "#/components/parameters/AclListGroupId" + - $ref: "#/components/parameters/AclListPermission" + - $ref: "#/components/parameters/AclListRestrictObjectType" + - $ref: "#/components/parameters/AclListRoleId" + responses: + "200": + description: Returns a list of acl objects content: application/json: schema: @@ -14982,518 +14683,10 @@ paths: 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/acl/acl/batch_update: - options: - operationId: optionsAclBatchUpdate - description: Enable CORS - summary: Enable CORS (`/v1/acl/acl/batch_update`) - 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/user: - get: - operationId: getUser - tags: - - Users - description: List out all users. The users are sorted by creation date, with the - most recently-created users coming first - summary: List users - security: - - bearerAuth: [] - - {} - parameters: - - $ref: "#/components/parameters/AppLimitParam" - - $ref: "#/components/parameters/StartingAfter" - - $ref: "#/components/parameters/EndingBefore" - - $ref: "#/components/parameters/Ids" - - $ref: "#/components/parameters/UserGivenName" - - $ref: "#/components/parameters/UserFamilyName" - - $ref: "#/components/parameters/UserEmail" - - $ref: "#/components/parameters/OrgName" - responses: - "200": - description: Returns a list of user objects - content: - application/json: - schema: - type: object - properties: - objects: - type: array - items: - $ref: "#/components/schemas/User" - description: A list of user 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: optionsUser - description: Enable CORS - summary: Enable CORS (`/v1/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/user/{user_id}: - get: - operationId: getUserId - tags: - - Users - description: Get a user object by its id - summary: Get user - security: - - bearerAuth: [] - - {} - parameters: - - $ref: "#/components/parameters/UserIdParam" - responses: - "200": - description: Returns the user object - content: - application/json: - schema: - $ref: "#/components/schemas/User" - "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: optionsUserId - description: Enable CORS - summary: Enable CORS (`/v1/user/{user_id}`) - security: [] - tags: - - CORS - parameters: - - $ref: "#/components/parameters/UserIdParam" - 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/agent: - post: - tags: - - Agents - security: - - bearerAuth: [] - - {} - operationId: postAgent - description: Create a new agent. If there is an existing agent with the same - name as the one specified in the request, will return the existing agent - unmodified - summary: Create agent - requestBody: - description: Any desired information about the new agent object - required: false - content: - application/json: - schema: - $ref: "#/components/schemas/CreateAgent" - responses: - "200": - description: Returns the new agent object - content: - application/json: - schema: - $ref: "#/components/schemas/Agent" - "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: - - Agents - security: - - bearerAuth: [] - - {} - operationId: putAgent - description: Create or replace agent. If there is an existing agent with the - same name as the one specified in the request, will replace the existing - agent with the provided fields - summary: Create or replace agent - requestBody: - description: Any desired information about the new agent object - required: false - content: - application/json: - schema: - $ref: "#/components/schemas/CreateAgent" - responses: - "200": - description: Returns the new agent object - content: - application/json: - schema: - $ref: "#/components/schemas/Agent" - "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: getAgent - tags: - - Agents - description: List out all agents. The agents are sorted by creation date, with - the most recently-created agents coming first - summary: List agents - security: - - bearerAuth: [] - - {} - parameters: - - $ref: "#/components/parameters/AppLimitParam" - - $ref: "#/components/parameters/StartingAfter" - - $ref: "#/components/parameters/EndingBefore" - - $ref: "#/components/parameters/Ids" - - $ref: "#/components/parameters/AgentName" - - $ref: "#/components/parameters/OrgName" - responses: - "200": - description: Returns a list of agent objects - content: - application/json: - schema: - type: object - properties: - objects: - type: array - items: - $ref: "#/components/schemas/Agent" - description: A list of agent 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: {} + "400": + description: The request was unacceptable, often due to missing a required + parameter content: text/plain: schema: @@ -15501,10 +14694,11 @@ paths: application/json: schema: nullable: true + /v1/acl/acl/batch_update: options: - operationId: optionsAgent + operationId: optionsAclBatchUpdate description: Enable CORS - summary: Enable CORS (`/v1/agent`) + summary: Enable CORS (`/v1/acl/acl/batch_update`) security: [] tags: - CORS @@ -15538,25 +14732,42 @@ paths: application/json: schema: nullable: true - /v1/agent/{agent_id}: + /v1/user: get: - operationId: getAgentId + operationId: getUser tags: - - Agents - description: Get a agent object by its id - summary: Get agent + - Users + description: List out all users. The users are sorted by creation date, with the + most recently-created users coming first + summary: List users security: - bearerAuth: [] - {} parameters: - - $ref: "#/components/parameters/AgentIdParam" + - $ref: "#/components/parameters/AppLimitParam" + - $ref: "#/components/parameters/StartingAfter" + - $ref: "#/components/parameters/EndingBefore" + - $ref: "#/components/parameters/Ids" + - $ref: "#/components/parameters/UserGivenName" + - $ref: "#/components/parameters/UserFamilyName" + - $ref: "#/components/parameters/UserEmail" + - $ref: "#/components/parameters/OrgName" responses: "200": - description: Returns the agent object + description: Returns a list of user objects content: application/json: schema: - $ref: "#/components/schemas/Agent" + type: object + properties: + objects: + type: array + items: + $ref: "#/components/schemas/User" + description: A list of user objects + required: + - objects + additionalProperties: false "400": description: The request was unacceptable, often due to missing a required parameter @@ -15608,78 +14819,36 @@ paths: application/json: schema: nullable: true - patch: - operationId: patchAgentId + options: + operationId: optionsUser + description: Enable CORS + summary: Enable CORS (`/v1/user`) + security: [] tags: - - Agents - description: Partially update a agent 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 agent - security: - - bearerAuth: [] - - {} - parameters: - - $ref: "#/components/parameters/AgentIdParam" - requestBody: - description: Fields to update - required: false - content: - application/json: - schema: - $ref: "#/components/schemas/PatchAgent" + - CORS responses: "200": - description: Returns the agent object - content: - application/json: - schema: - $ref: "#/components/schemas/Agent" - "400": - description: The request was unacceptable, often due to missing a required - parameter - content: - text/plain: + description: Response for CORS method + headers: + Access-Control-Allow-Credentials: schema: type: string - application/json: - schema: - nullable: true - "401": - description: No valid API key provided - content: - text/plain: + Access-Control-Allow-Headers: schema: type: string - application/json: - schema: - nullable: true - "403": - description: The API key doesn’t have permissions to perform the request - content: - text/plain: + Access-Control-Allow-Methods: 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: + Access-Control-Allow-Origin: schema: type: string - content: - text/plain: + Access-Control-Max-Age: schema: type: string - application/json: - schema: - nullable: true - "500": - description: Something went wrong on Braintrust's end. (These are rare.) + content: {} + "400": + description: The request was unacceptable, often due to missing a required + parameter content: text/plain: schema: @@ -15687,24 +14856,25 @@ paths: application/json: schema: nullable: true - delete: - operationId: deleteAgentId + /v1/user/{user_id}: + get: + operationId: getUserId tags: - - Agents - description: Delete a agent object by its id - summary: Delete agent + - Users + description: Get a user object by its id + summary: Get user security: - bearerAuth: [] - {} parameters: - - $ref: "#/components/parameters/AgentIdParam" + - $ref: "#/components/parameters/UserIdParam" responses: "200": - description: Returns the deleted agent object + description: Returns the user object content: application/json: schema: - $ref: "#/components/schemas/Agent" + $ref: "#/components/schemas/User" "400": description: The request was unacceptable, often due to missing a required parameter @@ -15757,14 +14927,14 @@ paths: schema: nullable: true options: - operationId: optionsAgentId + operationId: optionsUserId description: Enable CORS - summary: Enable CORS (`/v1/agent/{agent_id}`) + summary: Enable CORS (`/v1/user/{user_id}`) security: [] tags: - CORS parameters: - - $ref: "#/components/parameters/AgentIdParam" + - $ref: "#/components/parameters/UserIdParam" responses: "200": description: Response for CORS method @@ -19999,6 +19169,80 @@ paths: application/json: schema: nullable: true + delete: + 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: false + 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: @@ -20453,6 +19697,80 @@ paths: application/json: schema: nullable: true + delete: + operationId: deleteAiSecret + tags: + - AiSecrets + description: Delete a single ai_secret + summary: Delete single ai_secret + security: + - bearerAuth: [] + - {} + requestBody: + description: Parameters which uniquely specify the ai_secret to delete + required: false + content: + application/json: + schema: + $ref: "#/components/schemas/DeleteAISecret" + responses: + "200": + description: Returns the deleted 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 get: operationId: getAiSecret tags: