From f2882d90ef62db577903461ad040d391cdc1f4d6 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 3 Sep 2026 10:20:44 -0400 Subject: [PATCH] chore: update openapi spec https://github.com/braintrustdata/braintrust-openapi/commit/8d6e24ce78d8e33cbf9ba5f35d2fbc71749306d7 --- openapi/config.json | 4 +- openapi/spec.json | 5888 +++++++++++++---- py/src/braintrust/api/_generated/__init__.py | 4 +- py/src/braintrust/api/_generated/datasets.py | 12 +- .../braintrust/api/_generated/experiments.py | 12 +- .../api/_generated/models/__init__.py | 4 +- .../api/_generated/models/common.py | 4 +- .../api/_generated/models/datasets.py | 4 +- .../api/_generated/models/experiments.py | 4 +- .../api/_generated/models/projects.py | 14 +- py/src/braintrust/api/_generated/projects.py | 8 +- 11 files changed, 4618 insertions(+), 1340 deletions(-) diff --git a/openapi/config.json b/openapi/config.json index df785e65..8ce3da29 100644 --- a/openapi/config.json +++ b/openapi/config.json @@ -3,8 +3,8 @@ "spec": { "repository": "braintrustdata/braintrust-openapi", "path": "openapi/spec.json", - "commit": "9daf27f19d9e0340304d7a3e7d0edb28380b94c6", - "sha256": "5ec753c0263c0c44cd04f741edfc7e8bad491cc25a2113d029e84edc076520f0" + "commit": "8d6e24ce78d8e33cbf9ba5f35d2fbc71749306d7", + "sha256": "ebac33c1422e5673f875a254b3f7a13e4d8b5f5ab9b5095fd6b48e836613d507" }, "tools": { "datamodel-code-generator": "0.72.4", diff --git a/openapi/spec.json b/openapi/spec.json index 7f99fe09..20737576 100644 --- a/openapi/spec.json +++ b/openapi/spec.json @@ -64,6 +64,11 @@ "format": "uuid", "description": "Group id" }, + "ProjectGroupIdParam": { + "type": "string", + "format": "uuid", + "description": "ProjectGroup id" + }, "AclIdParam": { "type": "string", "format": "uuid", @@ -84,6 +89,11 @@ "format": "uuid", "description": "ProjectAutomation id" }, + "OrgAutomationIdParam": { + "type": "string", + "format": "uuid", + "description": "OrgAutomation id" + }, "ProjectScoreIdParam": { "type": "string", "format": "uuid", @@ -177,6 +187,10 @@ "type": "string", "description": "Name of the group to search for" }, + "ProjectGroupName": { + "type": "string", + "description": "Name of the project_group to search for" + }, "AgentName": { "type": "string", "description": "Name of the agent to search for" @@ -185,6 +199,10 @@ "type": "string", "description": "Name of the project_automation to search for" }, + "OrgAutomationName": { + "type": "string", + "description": "Name of the org_automation to search for" + }, "ProjectScoreName": { "type": "string", "description": "Name of the project_score to search for" @@ -397,7 +415,10 @@ "org_member", "project_log", "org_project", - "org_audit_logs" + "org_audit_logs", + "project_group", + "ai_secret", + "org_ai_secret" ], "description": "The object type that the ACL applies to" }, @@ -420,7 +441,10 @@ "org_member", "project_log", "org_project", - "org_audit_logs" + "org_audit_logs", + "project_group", + "ai_secret", + "org_ai_secret" ], "description": "The object type that the ACL applies to" }, @@ -467,7 +491,10 @@ "org_member", "project_log", "org_project", - "org_audit_logs" + "org_audit_logs", + "project_group", + "ai_secret", + "org_ai_secret" ], "description": "The object type that the ACL applies to" }, @@ -676,6 +703,16 @@ "nullable": true, "description": "If true, disable real-time queries for this project. This can improve query performance for high-volume logs." }, + "monitor_charts_use_metrics_start": { + "type": "boolean", + "nullable": true, + "description": "If true, use metrics.start rather than created for monitor chart time bucket dimensions." + }, + "blind_reviews": { + "type": "boolean", + "nullable": true, + "description": "If true, hide peer review scores, comments, and aggregate results from reviewers without project update permissions until they submit their own review." + }, "default_preprocessor": { "$ref": "#/components/schemas/NullableSavedFunctionId" } @@ -3249,6 +3286,13 @@ "enum": [ "ephemeral" ] + }, + "ttl": { + "type": "string", + "enum": [ + "5m", + "1h" + ] } }, "required": [ @@ -3281,6 +3325,13 @@ "enum": [ "ephemeral" ] + }, + "ttl": { + "type": "string", + "enum": [ + "5m", + "1h" + ] } }, "required": [ @@ -3337,6 +3388,27 @@ "enum": [ "image_url" ] + }, + "cache_control": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "ephemeral" + ] + }, + "ttl": { + "type": "string", + "enum": [ + "5m", + "1h" + ] + } + }, + "required": [ + "type" + ] } }, "required": [ @@ -3371,6 +3443,27 @@ "enum": [ "file" ] + }, + "cache_control": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "ephemeral" + ] + }, + "ttl": { + "type": "string", + "enum": [ + "5m", + "1h" + ] + } + }, + "required": [ + "type" + ] } }, "required": [ @@ -4133,6 +4226,10 @@ }, "position": { "type": "string" + }, + "endpoint_name": { + "type": "string", + "nullable": true } } }, @@ -4168,6 +4265,10 @@ "allow_no_match": { "type": "boolean", "description": "If true, adds a 'No match' option. When selected, no tag is deposited." + }, + "allow_skip": { + "type": "boolean", + "description": "If true, adds a 'Skip' option. When selected, the scorer returns null." } }, "required": [ @@ -4175,6 +4276,85 @@ "use_cot" ] }, + "PreprocessorId": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ] + }, + "id": { + "type": "string" + }, + "version": { + "type": "string", + "description": "The version of the function" + } + }, + "required": [ + "type", + "id" + ], + "title": "function" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "global" + ] + }, + "name": { + "type": "string" + }, + "function_type": { + "type": "string", + "enum": [ + "preprocessor" + ], + "default": "preprocessor", + "description": "The type of global function. Defaults to 'preprocessor'." + } + }, + "required": [ + "type", + "name" + ], + "title": "preprocessor_global" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "inline" + ] + }, + "code": { + "type": "string", + "minLength": 1, + "description": "The complete JavaScript preprocessor implementation, including its handler." + } + }, + "required": [ + "type", + "code" + ], + "title": "preprocessor_inline" + }, + { + "type": "null" + } + ], + "description": "For prompt-backed functions: the saved, global, or inline preprocessor to use for trace template variables. Set to null to disable preprocessing. If omitted, the traced project's default preprocessor will be used, falling back to the global 'thread' preprocessor." + }, "PromptDataNullish": { "type": "object", "nullable": true, @@ -4188,6 +4368,9 @@ "parser": { "$ref": "#/components/schemas/PromptParserNullish" }, + "preprocessor": { + "$ref": "#/components/schemas/PreprocessorId" + }, "tool_functions": { "type": "array", "nullable": true, @@ -4895,6 +5078,123 @@ } } }, + "ProjectGroup": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the project group" + }, + "org_id": { + "type": "string", + "format": "uuid", + "description": "Unique id for the organization that the project group belongs under\n\nIt is forbidden to change the org after creating a project group" + }, + "user_id": { + "type": "string", + "nullable": true, + "format": "uuid", + "description": "Identifies the user who created the project group" + }, + "created": { + "type": "string", + "nullable": true, + "format": "date-time", + "description": "Date of project group creation" + }, + "name": { + "type": "string", + "description": "Name of the project group" + }, + "description": { + "type": "string", + "nullable": true, + "description": "Textual description of the project group" + }, + "deleted_at": { + "type": "string", + "nullable": true, + "format": "date-time", + "description": "Date of project group deletion, or null if the project group is still active" + }, + "member_projects": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "maxItems": 10000, + "description": "Sorted ids of active projects in this project group" + } + }, + "required": [ + "id", + "org_id", + "name", + "member_projects" + ], + "description": "A project group is a collection of projects which can inherit access from project-group ACLs" + }, + "CreateProjectGroup": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "Name of the project group" + }, + "description": { + "type": "string", + "nullable": true, + "description": "Textual description of the project group" + }, + "org_name": { + "type": "string", + "nullable": true, + "description": "For nearly all users, this parameter should be unnecessary. But in the rare case that your API key belongs to multiple organizations, you may specify the name of the organization the project group belongs in." + } + }, + "required": [ + "name" + ] + }, + "PatchProjectGroup": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true, + "minLength": 1, + "description": "Name of the project group" + }, + "description": { + "type": "string", + "nullable": true, + "description": "Textual description of the project group" + }, + "add_member_projects": { + "type": "array", + "nullable": true, + "items": { + "type": "string", + "format": "uuid" + }, + "maxItems": 1000, + "description": "A list of project IDs to add to the project group" + }, + "remove_member_projects": { + "type": "array", + "nullable": true, + "items": { + "type": "string", + "format": "uuid" + }, + "maxItems": 1000, + "description": "A list of project IDs to remove from the project group" + } + } + }, "Acl": { "type": "object", "properties": { @@ -5294,6 +5594,367 @@ ], "description": "The object type that the retention policy applies to" }, + "WindowedAutomationConfig": { + "type": "object", + "properties": { + "event_type": { + "type": "string", + "enum": [ + "windowed" + ], + "description": "The type of automation." + }, + "product_origin": { + "type": "string", + "nullable": true, + "enum": [ + "patterns", + null + ], + "description": "The product surface that created and manages the automation" + }, + "status": { + "$ref": "#/components/schemas/AutomationStatus" + }, + "threshold": { + "type": "object", + "properties": { + "calculation": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "btql" + ] + }, + "btql_query": { + "type": "string", + "minLength": 1, + "description": "A project-scoped BTQL or SQL query without runtime-owned evaluation time bounds" + }, + "output": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "scalar" + ] + }, + "value_column": { + "type": "string", + "minLength": 1, + "description": "The numeric result column produced by the query" + } + }, + "required": [ + "type", + "value_column" + ] + } + }, + "required": [ + "type", + "btql_query", + "output" + ] + } + ], + "description": "The calculation evaluated for each window" + }, + "policy": { + "type": "object", + "properties": { + "condition": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "threshold" + ] + }, + "operator": { + "type": "string", + "enum": [ + "lt", + "lte", + "gt", + "gte", + "eq", + "neq" + ] + }, + "threshold": { + "type": "number" + } + }, + "required": [ + "type", + "operator", + "threshold" + ] + }, + "pending_seconds": { + "type": "integer", + "minimum": 0, + "maximum": 2592000, + "description": "How long the condition must remain breached before firing" + }, + "no_data_behavior": { + "type": "string", + "enum": [ + "keep_last", + "resolve", + "alert" + ], + "description": "How the lifecycle changes when the calculation returns no data" + }, + "renotify_interval_seconds": { + "type": "integer", + "nullable": true, + "minimum": 1, + "maximum": 2592000, + "description": "Optional reminder interval while the automation is firing" + }, + "notify_on_recovery": { + "type": "boolean", + "default": true, + "description": "Whether to deliver actions when a firing automation recovers" + } + }, + "required": [ + "condition", + "pending_seconds", + "no_data_behavior" + ], + "description": "The lifecycle policy applied to each calculation result" + } + }, + "required": [ + "calculation", + "policy" + ], + "description": "Optional calculation and lifecycle policy that gate scheduled delivery" + }, + "window": { + "type": "object", + "properties": { + "window_seconds": { + "type": "integer", + "minimum": 1, + "maximum": 2592000, + "description": "How much recent data each scheduled run covers" + }, + "schedule": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "interval" + ] + }, + "evaluation_interval_seconds": { + "type": "integer", + "minimum": 1, + "maximum": 2592000, + "description": "How often the automation runs" + } + }, + "required": [ + "type", + "evaluation_interval_seconds" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "cron" + ] + }, + "cron_expression": { + "type": "string", + "minLength": 1, + "description": "A standard five-field cron expression (minute hour day-of-month month day-of-week) controlling when the automation runs" + }, + "timezone": { + "type": "string", + "nullable": true, + "minLength": 1, + "description": "IANA timezone used to interpret the cron expression (defaults to UTC)" + } + }, + "required": [ + "type", + "cron_expression" + ] + } + ], + "description": "How often the windowed automation runs: at a fixed interval or on a cron schedule" + }, + "evaluation_delay_seconds": { + "type": "integer", + "minimum": 0, + "maximum": 2592000, + "description": "How far behind the present each evaluation window ends" + } + }, + "required": [ + "window_seconds", + "schedule", + "evaluation_delay_seconds" + ] + }, + "loop": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for the Loop agent" + }, + "include_trigger_input": { + "type": "boolean", + "default": false, + "description": "Whether to include the automation trigger payload as input" + }, + "agent_slug": { + "type": "string", + "minLength": 1, + "description": "The Loop agent to run" + }, + "auto_approve_tools": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "default": [], + "description": "Write tools that may run without interactive approval" + }, + "harness": { + "type": "string", + "enum": [ + "native", + "codex", + "claude-code" + ] + }, + "model": { + "type": "string", + "minLength": 1 + }, + "endpoint_name": { + "type": "string", + "minLength": 1 + }, + "reasoning_effort": { + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + }, + "required": [ + "prompt", + "agent_slug" + ], + "description": "Optional Loop agent to run for each triggered window" + }, + "actions": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "webhook" + ], + "description": "The type of action to take" + }, + "url": { + "type": "string", + "description": "The webhook URL to send the request to" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" + } + }, + "required": [ + "type", + "url" + ] + }, + { + "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" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Publish a Slack mrkdwn digest.\n\nInclude a complete \"*Pattern outcomes*\" section with one row for every selected Pattern from the run report, including created, updated, unchanged, failed, skipped, and newly inactive outcomes.\n\nUse this row format exactly:\n• — `outcome`\n\nIf a Pattern has no URL, use the plain title instead. Do not use GitHub Markdown tables or code-block tables, because links must remain clickable. Do not omit any selected Pattern. If there are no selected Patterns, say \"No pattern outcomes.\"\n\nAfter the outcome list, include a \"*Highlights*\" section with one very short paragraph, 2-3 sentences maximum. Summarize what changed or what broadly stands out from this run. Do not introduce new claims beyond the run report." + } + }, + "required": [ + "type", + "workspace_id", + "channel" + ] + } + ], + "description": "A delivery action available to an automation" + }, + "maxItems": 20, + "default": [], + "description": "Delivery actions exposed to Loop as tools, or run directly when Loop is not configured" + } + }, + "required": [ + "event_type", + "window" + ] + }, "TopicAutomationFacetModel": { "type": "string", "nullable": true, @@ -5533,7 +6194,7 @@ "type": "null" } ], - "description": "Execution scope for topic automation. Defaults to span-level execution." + "description": "Execution scope for topic automation." }, "data_scope": { "$ref": "#/components/schemas/TopicAutomationDataScope" @@ -5636,6 +6297,12 @@ "message_template": { "type": "string", "description": "Custom message template for the alert" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Publish a Slack mrkdwn digest.\n\nInclude a complete \"*Pattern outcomes*\" section with one row for every selected Pattern from the run report, including created, updated, unchanged, failed, skipped, and newly inactive outcomes.\n\nUse this row format exactly:\n• — `outcome`\n\nIf a Pattern has no URL, use the plain title instead. Do not use GitHub Markdown tables or code-block tables, because links must remain clickable. Do not omit any selected Pattern. If there are no selected Patterns, say \"No pattern outcomes.\"\n\nAfter the outcome list, include a \"*Highlights*\" section with one very short paragraph, 2-3 sentences maximum. Summarize what changed or what broadly stands out from this run. Do not introduce new claims beyond the run report." } }, "required": [ @@ -5706,6 +6373,9 @@ ], "description": "The type of automation." }, + "status": { + "$ref": "#/components/schemas/AutomationStatus" + }, "btql_filter": { "type": "string", "description": "BTQL filter to identify rows for the automation rule" @@ -5731,6 +6401,12 @@ "url": { "type": "string", "description": "The webhook URL to send the request to" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" } }, "required": [ @@ -5759,6 +6435,12 @@ "message_template": { "type": "string", "description": "Custom message template for the alert" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Publish a Slack mrkdwn digest.\n\nInclude a complete \"*Pattern outcomes*\" section with one row for every selected Pattern from the run report, including created, updated, unchanged, failed, skipped, and newly inactive outcomes.\n\nUse this row format exactly:\n• — `outcome`\n\nIf a Pattern has no URL, use the plain title instead. Do not use GitHub Markdown tables or code-block tables, because links must remain clickable. Do not omit any selected Pattern. If there are no selected Patterns, say \"No pattern outcomes.\"\n\nAfter the outcome list, include a \"*Highlights*\" section with one very short paragraph, 2-3 sentences maximum. Summarize what changed or what broadly stands out from this run. Do not introduce new claims beyond the run report." } }, "required": [ @@ -6015,7 +6697,7 @@ "$ref": "#/components/schemas/RetentionObjectType" }, "retention_days": { - "type": "number", + "type": "integer", "minimum": 0, "description": "The number of days to retain the object" } @@ -6036,6 +6718,9 @@ ], "description": "The type of automation." }, + "status": { + "$ref": "#/components/schemas/AutomationStatus" + }, "environment_filter": { "type": "array", "items": { @@ -6058,6 +6743,12 @@ "url": { "type": "string", "description": "The webhook URL to send the request to" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" } }, "required": [ @@ -6086,6 +6777,12 @@ "message_template": { "type": "string", "description": "Custom message template for the alert" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Publish a Slack mrkdwn digest.\n\nInclude a complete \"*Pattern outcomes*\" section with one row for every selected Pattern from the run report, including created, updated, unchanged, failed, skipped, and newly inactive outcomes.\n\nUse this row format exactly:\n• — `outcome`\n\nIf a Pattern has no URL, use the plain title instead. Do not use GitHub Markdown tables or code-block tables, because links must remain clickable. Do not omit any selected Pattern. If there are no selected Patterns, say \"No pattern outcomes.\"\n\nAfter the outcome list, include a \"*Highlights*\" section with one very short paragraph, 2-3 sentences maximum. Summarize what changed or what broadly stands out from this run. Do not introduce new claims beyond the run report." } }, "required": [ @@ -6103,6 +6800,9 @@ "action" ] }, + { + "$ref": "#/components/schemas/WindowedAutomationConfig" + }, { "$ref": "#/components/schemas/TopicAutomationConfig" }, @@ -6149,6 +6849,9 @@ ], "description": "The type of automation." }, + "status": { + "$ref": "#/components/schemas/AutomationStatus" + }, "btql_filter": { "type": "string", "description": "BTQL filter to identify rows for the automation rule" @@ -6174,6 +6877,12 @@ "url": { "type": "string", "description": "The webhook URL to send the request to" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" } }, "required": [ @@ -6202,6 +6911,12 @@ "message_template": { "type": "string", "description": "Custom message template for the alert" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Publish a Slack mrkdwn digest.\n\nInclude a complete \"*Pattern outcomes*\" section with one row for every selected Pattern from the run report, including created, updated, unchanged, failed, skipped, and newly inactive outcomes.\n\nUse this row format exactly:\n• — `outcome`\n\nIf a Pattern has no URL, use the plain title instead. Do not use GitHub Markdown tables or code-block tables, because links must remain clickable. Do not omit any selected Pattern. If there are no selected Patterns, say \"No pattern outcomes.\"\n\nAfter the outcome list, include a \"*Highlights*\" section with one very short paragraph, 2-3 sentences maximum. Summarize what changed or what broadly stands out from this run. Do not introduce new claims beyond the run report." } }, "required": [ @@ -6458,7 +7173,7 @@ "$ref": "#/components/schemas/RetentionObjectType" }, "retention_days": { - "type": "number", + "type": "integer", "minimum": 0, "description": "The number of days to retain the object" } @@ -6479,6 +7194,9 @@ ], "description": "The type of automation." }, + "status": { + "$ref": "#/components/schemas/AutomationStatus" + }, "environment_filter": { "type": "array", "items": { @@ -6501,6 +7219,12 @@ "url": { "type": "string", "description": "The webhook URL to send the request to" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" } }, "required": [ @@ -6529,6 +7253,12 @@ "message_template": { "type": "string", "description": "Custom message template for the alert" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Publish a Slack mrkdwn digest.\n\nInclude a complete \"*Pattern outcomes*\" section with one row for every selected Pattern from the run report, including created, updated, unchanged, failed, skipped, and newly inactive outcomes.\n\nUse this row format exactly:\n• — `outcome`\n\nIf a Pattern has no URL, use the plain title instead. Do not use GitHub Markdown tables or code-block tables, because links must remain clickable. Do not omit any selected Pattern. If there are no selected Patterns, say \"No pattern outcomes.\"\n\nAfter the outcome list, include a \"*Highlights*\" section with one very short paragraph, 2-3 sentences maximum. Summarize what changed or what broadly stands out from this run. Do not introduce new claims beyond the run report." } }, "required": [ @@ -6546,6 +7276,9 @@ "action" ] }, + { + "$ref": "#/components/schemas/WindowedAutomationConfig" + }, { "$ref": "#/components/schemas/TopicAutomationConfig" }, @@ -6587,6 +7320,9 @@ ], "description": "The type of automation." }, + "status": { + "$ref": "#/components/schemas/AutomationStatus" + }, "btql_filter": { "type": "string", "description": "BTQL filter to identify rows for the automation rule" @@ -6612,6 +7348,12 @@ "url": { "type": "string", "description": "The webhook URL to send the request to" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" } }, "required": [ @@ -6640,6 +7382,12 @@ "message_template": { "type": "string", "description": "Custom message template for the alert" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Publish a Slack mrkdwn digest.\n\nInclude a complete \"*Pattern outcomes*\" section with one row for every selected Pattern from the run report, including created, updated, unchanged, failed, skipped, and newly inactive outcomes.\n\nUse this row format exactly:\n• — `outcome`\n\nIf a Pattern has no URL, use the plain title instead. Do not use GitHub Markdown tables or code-block tables, because links must remain clickable. Do not omit any selected Pattern. If there are no selected Patterns, say \"No pattern outcomes.\"\n\nAfter the outcome list, include a \"*Highlights*\" section with one very short paragraph, 2-3 sentences maximum. Summarize what changed or what broadly stands out from this run. Do not introduce new claims beyond the run report." } }, "required": [ @@ -6896,7 +7644,7 @@ "$ref": "#/components/schemas/RetentionObjectType" }, "retention_days": { - "type": "number", + "type": "integer", "minimum": 0, "description": "The number of days to retain the object" } @@ -6917,6 +7665,9 @@ ], "description": "The type of automation." }, + "status": { + "$ref": "#/components/schemas/AutomationStatus" + }, "environment_filter": { "type": "array", "items": { @@ -6939,6 +7690,12 @@ "url": { "type": "string", "description": "The webhook URL to send the request to" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Instructions for Loop to format content sent to this destination" } }, "required": [ @@ -6967,6 +7724,12 @@ "message_template": { "type": "string", "description": "Custom message template for the alert" + }, + "formatting_prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "Publish a Slack mrkdwn digest.\n\nInclude a complete \"*Pattern outcomes*\" section with one row for every selected Pattern from the run report, including created, updated, unchanged, failed, skipped, and newly inactive outcomes.\n\nUse this row format exactly:\n• — `outcome`\n\nIf a Pattern has no URL, use the plain title instead. Do not use GitHub Markdown tables or code-block tables, because links must remain clickable. Do not omit any selected Pattern. If there are no selected Patterns, say \"No pattern outcomes.\"\n\nAfter the outcome list, include a \"*Highlights*\" section with one very short paragraph, 2-3 sentences maximum. Summarize what changed or what broadly stands out from this run. Do not introduce new claims beyond the run report." } }, "required": [ @@ -6984,6 +7747,9 @@ "action" ] }, + { + "$ref": "#/components/schemas/WindowedAutomationConfig" + }, { "$ref": "#/components/schemas/TopicAutomationConfig" }, @@ -6998,6 +7764,166 @@ } } }, + "OrgAutomation": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the project automation" + }, + "org_id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the organization that the org automation belongs under" + }, + "user_id": { + "type": "string", + "nullable": true, + "format": "uuid", + "description": "Identifies the user who created the project automation" + }, + "created": { + "type": "string", + "nullable": true, + "format": "date-time", + "description": "Date of project automation creation" + }, + "name": { + "type": "string", + "description": "Name of the project automation" + }, + "description": { + "type": "string", + "nullable": true, + "description": "Textual description of the project automation" + }, + "config": { + "type": "object", + "properties": { + "event_type": { + "type": "string", + "enum": [ + "retention" + ], + "description": "The type of automation." + }, + "object_type": { + "$ref": "#/components/schemas/RetentionObjectType" + }, + "retention_days": { + "type": "integer", + "minimum": 0, + "description": "The number of days to retain the object" + } + }, + "required": [ + "event_type", + "object_type", + "retention_days" + ], + "description": "The configuration for the org automation rule" + } + }, + "required": [ + "id", + "org_id", + "name", + "config" + ] + }, + "CreateOrgAutomation": { + "type": "object", + "properties": { + "org_id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the organization that the org automation belongs under" + }, + "name": { + "type": "string", + "description": "Name of the project automation" + }, + "description": { + "type": "string", + "nullable": true, + "description": "Textual description of the project automation" + }, + "config": { + "type": "object", + "properties": { + "event_type": { + "type": "string", + "enum": [ + "retention" + ], + "description": "The type of automation." + }, + "object_type": { + "$ref": "#/components/schemas/RetentionObjectType" + }, + "retention_days": { + "type": "integer", + "minimum": 0, + "description": "The number of days to retain the object" + } + }, + "required": [ + "event_type", + "object_type", + "retention_days" + ], + "description": "The configuration for the org automation rule" + } + }, + "required": [ + "org_id", + "name", + "config" + ] + }, + "PatchOrgAutomation": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true, + "description": "Name of the project automation" + }, + "description": { + "type": "string", + "nullable": true, + "description": "Textual description of the project automation" + }, + "config": { + "type": "object", + "nullable": true, + "properties": { + "event_type": { + "type": "string", + "enum": [ + "retention" + ], + "description": "The type of automation." + }, + "object_type": { + "$ref": "#/components/schemas/RetentionObjectType" + }, + "retention_days": { + "type": "integer", + "minimum": 0, + "description": "The number of days to retain the object" + } + }, + "required": [ + "event_type", + "object_type", + "retention_days" + ], + "description": "The configuration for the org automation rule" + } + } + }, "ProjectScoreCategory": { "type": "object", "properties": { @@ -7054,6 +7980,9 @@ "type": "object", "nullable": true, "properties": { + "status": { + "$ref": "#/components/schemas/AutomationStatus" + }, "sampling_rate": { "type": "number", "minimum": 0, @@ -8276,6 +9205,80 @@ "description": "This feature is preliminary and unsupported.", "title": "graph" }, + "FacetPreprocessorId": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ] + }, + "id": { + "type": "string" + }, + "version": { + "type": "string", + "description": "The version of the function" + } + }, + "required": [ + "type", + "id" + ], + "title": "function" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "global" + ] + }, + "name": { + "type": "string" + }, + "function_type": { + "$ref": "#/components/schemas/FunctionTypeEnum" + } + }, + "required": [ + "type", + "name" + ], + "title": "global" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "inline" + ] + }, + "code": { + "type": "string", + "minLength": 1, + "description": "The complete JavaScript preprocessor implementation, including its handler." + } + }, + "required": [ + "type", + "code" + ], + "title": "preprocessor_inline" + }, + { + "type": "null" + } + ], + "description": "The saved, global, or inline preprocessor to use for facet extraction. If not provided, the project default preprocessor will be used, falling back to the global 'thread' preprocessor." + }, "FacetData": { "type": "object", "properties": { @@ -8286,14 +9289,7 @@ ] }, "preprocessor": { - "allOf": [ - { - "$ref": "#/components/schemas/NullableSavedFunctionId" - }, - { - "description": "The preprocessor function to use for facet extraction. If not provided, the project default preprocessor will be used, falling back to the global 'thread' preprocessor." - } - ] + "$ref": "#/components/schemas/FacetPreprocessorId" }, "prompt": { "type": "string", @@ -8325,7 +9321,8 @@ "type": "string", "enum": [ "hdbscan", - "kmeans" + "kmeans", + "community" ] }, "dimension_reduction": { @@ -8382,7 +9379,64 @@ }, "source_facet": { "type": "string", - "description": "The facet field name to use as input for classification" + "description": "Materialized facet field name used when source_facet_function is absent" + }, + "source_facet_function": { + "allOf": [ + { + "$ref": "#/components/schemas/SavedFunctionId" + }, + { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ] + }, + "id": { + "type": "string" + }, + "version": { + "type": "string", + "description": "The version of the function" + } + }, + "required": [ + "type", + "id" + ], + "title": "function" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "global" + ] + }, + "name": { + "type": "string" + }, + "function_type": { + "$ref": "#/components/schemas/FunctionTypeEnum" + } + }, + "required": [ + "type", + "name" + ], + "title": "global" + } + ], + "description": "The stable function reference for the source facet" + } + ] }, "embedding_model": { "type": "string", @@ -8410,6 +9464,14 @@ "type": "boolean", "description": "Whether new topic generation should ignore the previously saved report during reconciliation. Defaults to false when omitted." }, + "reconcile_mode": { + "type": "string", + "enum": [ + "evolve", + "names_only" + ], + "description": "How reconciliation carries the previous map forward: \"evolve\" re-routes new samples into the previous topics before naming; \"names_only\" keeps the fresh clustering and carries only topic ids/names. Defaults to \"names_only\" when omitted." + }, "distance_threshold": { "type": "number", "description": "Maximum distance to nearest centroid. If exceeded, returns no_match." @@ -8439,14 +9501,7 @@ ] }, "preprocessor": { - "allOf": [ - { - "$ref": "#/components/schemas/NullableSavedFunctionId" - }, - { - "description": "The preprocessor function to use for facet extraction. If not provided, the project default preprocessor will be used, falling back to the global 'thread' preprocessor." - } - ] + "$ref": "#/components/schemas/FacetPreprocessorId" }, "facets": { "type": "array", @@ -9396,6 +10451,11 @@ }, "description": "Partial function definition to merge with the function being invoked. Fields are validated against the function type's schema at runtime. For facets: { preprocessor?, prompt?, model? }. For prompts: { model?, ... }." }, + "endpoint_name": { + "type": "string", + "nullable": true, + "description": "Name of the AI provider secret to pin this invocation to." + }, "version": { "type": "string", "description": "The version of the function" @@ -9665,6 +10725,28 @@ "value" ] }, + "pointSizeMetric": { + "type": "object", + "nullable": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "none", + "score", + "metric", + "metadata" + ] + }, + "value": { + "type": "string" + } + }, + "required": [ + "type", + "value" + ] + }, "xAxisAggregation": { "type": "string", "nullable": true, @@ -9785,12 +10867,27 @@ "type": "string", "description": "Name of the view" }, + "description": { + "type": "string", + "nullable": true, + "description": "Textual description of the view" + }, + "starred": { + "type": "boolean", + "description": "Whether the view is starred in its project" + }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of view creation" }, + "updated_at": { + "type": "string", + "nullable": true, + "format": "date-time", + "description": "Date of last view update" + }, "view_data": { "$ref": "#/components/schemas/ViewData" }, @@ -9857,6 +10954,11 @@ "type": "string", "description": "Name of the view" }, + "description": { + "type": "string", + "nullable": true, + "description": "Textual description of the view" + }, "view_data": { "$ref": "#/components/schemas/ViewData" }, @@ -9924,6 +11026,15 @@ "nullable": true, "description": "Name of the view" }, + "description": { + "type": "string", + "nullable": true, + "description": "Textual description of the view" + }, + "starred": { + "type": "boolean", + "description": "Whether the view is starred in its project" + }, "view_data": { "$ref": "#/components/schemas/ViewData" }, @@ -10095,7 +11206,7 @@ "id" ] }, - "description": "If service accounts with tokens were created, this will contain the added users with their API keys" + "description": "The users who were added by this request. api_key and token_name are only present for the inline service-account create-and-mint compatibility path." } }, "required": [ @@ -10140,14 +11251,21 @@ "token_name": { "type": "string", "nullable": true, - "description": "Optional name of an initial service token to create for the new service account. 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. 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." + }, + "token_expires_in_seconds": { + "type": "integer", + "nullable": true, + "minimum": 0, + "exclusiveMinimum": true, + "description": "Number of seconds from now after which the initial service token should expire. If omitted, the token never expires." } }, "required": [ "name" ] }, - "description": "Service accounts to create. Any caller permitted to add organization members can create service accounts (but not necessarily their associated tokens)." + "description": "Service accounts to create. PATCH /v1/organization/members is the compatibility layer that accepts both plain service-account creation and the narrower token_name create-and-mint carve-out." }, "send_invite_emails": { "type": "boolean", @@ -10271,6 +11389,12 @@ "nullable": true, "format": "uuid", "description": "Unique identifier for the organization" + }, + "expires_at": { + "type": "string", + "nullable": true, + "format": "date-time", + "description": "Date at which the API key expires. If null, the key never expires." } }, "required": [ @@ -10322,6 +11446,12 @@ "format": "uuid", "description": "Unique identifier for the organization" }, + "expires_at": { + "type": "string", + "nullable": true, + "format": "date-time", + "description": "Date and time at which the service token expires. If null, the token never expires." + }, "key": { "type": "string", "description": "The raw service token. It will only be exposed this one time" @@ -10376,6 +11506,12 @@ "nullable": true, "format": "uuid", "description": "Unique identifier for the organization" + }, + "expires_at": { + "type": "string", + "nullable": true, + "format": "date-time", + "description": "Date and time at which the service token expires. If null, the token never expires." } }, "required": [ @@ -11024,6 +12160,9 @@ "parser": { "$ref": "#/components/schemas/PromptParserNullish" }, + "preprocessor": { + "$ref": "#/components/schemas/PreprocessorId" + }, "tool_functions": { "type": "array", "nullable": true, @@ -11489,6 +12628,19 @@ ], "description": "Dataset rows", "title": "dataset_rows" + }, + { + "type": "object", + "properties": { + "experiment_name": { + "type": "string" + } + }, + "required": [ + "experiment_name" + ], + "description": "Experiment whose inputs and outputs should be used as dataset inputs and expected values", + "title": "experiment_name" } ], "description": "The dataset to use" @@ -11622,6 +12774,11 @@ } } } + }, + "endpoint_name": { + "type": "string", + "nullable": true, + "description": "Name of the AI provider secret to pin this run to." } }, "required": [ @@ -11696,6 +12853,15 @@ "name": "group_id", "in": "path" }, + "ProjectGroupIdParam": { + "schema": { + "$ref": "#/components/schemas/ProjectGroupIdParam" + }, + "required": true, + "description": "ProjectGroup id", + "name": "project_group_id", + "in": "path" + }, "AclIdParam": { "schema": { "$ref": "#/components/schemas/AclIdParam" @@ -11732,6 +12898,15 @@ "name": "project_automation_id", "in": "path" }, + "OrgAutomationIdParam": { + "schema": { + "$ref": "#/components/schemas/OrgAutomationIdParam" + }, + "required": true, + "description": "OrgAutomation id", + "name": "org_automation_id", + "in": "path" + }, "ProjectScoreIdParam": { "schema": { "$ref": "#/components/schemas/ProjectScoreIdParam" @@ -11919,6 +13094,16 @@ "in": "query", "allowReserved": true }, + "ProjectGroupName": { + "schema": { + "$ref": "#/components/schemas/ProjectGroupName" + }, + "required": false, + "description": "Name of the project_group to search for", + "name": "project_group_name", + "in": "query", + "allowReserved": true + }, "AgentName": { "schema": { "$ref": "#/components/schemas/AgentName" @@ -11939,6 +13124,16 @@ "in": "query", "allowReserved": true }, + "OrgAutomationName": { + "schema": { + "$ref": "#/components/schemas/OrgAutomationName" + }, + "required": false, + "description": "Name of the org_automation to search for", + "name": "org_automation_name", + "in": "query", + "allowReserved": true + }, "ProjectScoreName": { "schema": { "$ref": "#/components/schemas/ProjectScoreName" @@ -12386,7 +13581,7 @@ "summary": "Create project", "requestBody": { "description": "Any desired information about the new project object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -12631,72 +13826,1613 @@ } } }, - "options": { - "operationId": "optionsProject", - "description": "Enable CORS", - "summary": "Enable CORS (`/v1/project`)", - "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}": { - "get": { - "operationId": "getProjectId", + "options": { + "operationId": "optionsProject", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/project`)", + "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}": { + "get": { + "operationId": "getProjectId", + "tags": [ + "Projects" + ], + "description": "Get a project object by its id", + "summary": "Get project", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/ProjectIdParam" + } + ], + "responses": { + "200": { + "description": "Returns the project object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Project" + } + } + } + }, + "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": "patchProjectId", + "tags": [ + "Projects" + ], + "description": "Partially update a project 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 project", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/ProjectIdParam" + } + ], + "requestBody": { + "description": "Fields to update", + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchProject" + } + } + } + }, + "responses": { + "200": { + "description": "Returns the project object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Project" + } + } + } + }, + "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": "deleteProjectId", + "tags": [ + "Projects" + ], + "description": "Delete a project object by its id", + "summary": "Delete project", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/ProjectIdParam" + } + ], + "responses": { + "200": { + "description": "Returns the deleted project object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Project" + } + } + } + }, + "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": "optionsProjectId", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/project/{project_id}`)", + "security": [], + "tags": [ + "CORS" + ], + "parameters": [ + { + "$ref": "#/components/parameters/ProjectIdParam" + } + ], + "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_logs/{project_id}/insert": { + "post": { + "operationId": "postProjectLogsIdInsert", + "tags": [ + "Logs" + ], + "description": "Insert a set of events into the project logs", + "summary": "Insert project logs events", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/ProjectIdParam" + } + ], + "requestBody": { + "description": "An array of project logs events to insert", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsertProjectLogsEventRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Returns the inserted row ids", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsertEventsResponse" + } + } + } + }, + "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": "optionsProjectLogsIdInsert", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/project_logs/{project_id}/insert`)", + "security": [], + "tags": [ + "CORS" + ], + "parameters": [ + { + "$ref": "#/components/parameters/ProjectIdParam" + } + ], + "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_logs/{project_id}/fetch": { + "post": { + "operationId": "postProjectLogsIdFetch", + "tags": [ + "Logs" + ], + "description": "Fetch the events in a project logs. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint.", + "summary": "Fetch project logs (POST form)", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/ProjectIdParam" + } + ], + "requestBody": { + "description": "Filters for the fetch query", + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FetchEventsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Returns the fetched rows", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FetchProjectLogsEventsResponse" + } + } + } + }, + "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": "getProjectLogsIdFetch", + "tags": [ + "Logs" + ], + "description": "Fetch the events in a project logs. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint.", + "summary": "Fetch project logs (GET form)", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/ProjectIdParam" + }, + { + "$ref": "#/components/parameters/FetchLimitParam" + }, + { + "$ref": "#/components/parameters/MaxXactId" + }, + { + "$ref": "#/components/parameters/MaxRootSpanId" + }, + { + "$ref": "#/components/parameters/Version" + } + ], + "responses": { + "200": { + "description": "Returns the fetched rows", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FetchProjectLogsEventsResponse" + } + } + } + }, + "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": "optionsProjectLogsIdFetch", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/project_logs/{project_id}/fetch`)", + "security": [], + "tags": [ + "CORS" + ], + "parameters": [ + { + "$ref": "#/components/parameters/ProjectIdParam" + } + ], + "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_logs/{project_id}/feedback": { + "post": { + "operationId": "postProjectLogsIdFeedback", + "tags": [ + "Logs" + ], + "description": "Log feedback for a set of project logs events", + "summary": "Feedback for project logs events", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/ProjectIdParam" + } + ], + "requestBody": { + "description": "An array of feedback objects", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedbackProjectLogsEventRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Returns a success status", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedbackResponseSchema" + } + } + } + }, + "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": "optionsProjectLogsIdFeedback", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/project_logs/{project_id}/feedback`)", + "security": [], + "tags": [ + "CORS" + ], + "parameters": [ + { + "$ref": "#/components/parameters/ProjectIdParam" + } + ], + "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/experiment": { + "post": { + "tags": [ + "Experiments" + ], + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "operationId": "postExperiment", + "description": "Create a new experiment. If there is an existing experiment in the project with the same name as the one specified in the request, will return the existing experiment unmodified", + "summary": "Create experiment", + "requestBody": { + "description": "Any desired information about the new experiment object", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateExperiment" + } + } + } + }, + "responses": { + "200": { + "description": "Returns the new experiment object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Experiment" + } + } + } + }, + "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": "getExperiment", + "tags": [ + "Experiments" + ], + "description": "List out all experiments. The experiments are sorted by creation date, with the most recently-created experiments coming first", + "summary": "List experiments", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/AppLimitWithDefaultParam" + }, + { + "$ref": "#/components/parameters/StartingAfter" + }, + { + "$ref": "#/components/parameters/EndingBefore" + }, + { + "$ref": "#/components/parameters/Ids" + }, + { + "$ref": "#/components/parameters/ExperimentName" + }, + { + "$ref": "#/components/parameters/ProjectName" + }, + { + "$ref": "#/components/parameters/ProjectIdQuery" + }, + { + "$ref": "#/components/parameters/OrgName" + } + ], + "responses": { + "200": { + "description": "Returns a list of experiment objects", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Experiment" + }, + "description": "A list of experiment 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": "optionsExperiment", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/experiment`)", + "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/experiment/{experiment_id}": { + "get": { + "operationId": "getExperimentId", + "tags": [ + "Experiments" + ], + "description": "Get an experiment object by its id", + "summary": "Get experiment", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/ExperimentIdParam" + } + ], + "responses": { + "200": { + "description": "Returns the experiment object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Experiment" + } + } + } + }, + "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": "patchExperimentId", "tags": [ - "Projects" + "Experiments" ], - "description": "Get a project object by its id", - "summary": "Get project", + "description": "Partially update an experiment 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 experiment", "security": [ { "bearerAuth": [] @@ -12705,16 +15441,27 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ProjectIdParam" + "$ref": "#/components/parameters/ExperimentIdParam" } ], + "requestBody": { + "description": "Fields to update", + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchExperiment" + } + } + } + }, "responses": { "200": { - "description": "Returns the project object", + "description": "Returns the experiment object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Project" + "$ref": "#/components/schemas/Experiment" } } } @@ -12803,13 +15550,13 @@ } } }, - "patch": { - "operationId": "patchProjectId", + "delete": { + "operationId": "deleteExperimentId", "tags": [ - "Projects" + "Experiments" ], - "description": "Partially update a project 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 project", + "description": "Delete an experiment object by its id", + "summary": "Delete experiment", "security": [ { "bearerAuth": [] @@ -12818,27 +15565,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ProjectIdParam" + "$ref": "#/components/parameters/ExperimentIdParam" } ], - "requestBody": { - "description": "Fields to update", - "required": false, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PatchProject" - } - } - } - }, "responses": { "200": { - "description": "Returns the project object", + "description": "Returns the deleted experiment object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Project" + "$ref": "#/components/schemas/Experiment" } } } @@ -12927,13 +15663,77 @@ } } }, - "delete": { - "operationId": "deleteProjectId", + "options": { + "operationId": "optionsExperimentId", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/experiment/{experiment_id}`)", + "security": [], "tags": [ - "Projects" + "CORS" ], - "description": "Delete a project object by its id", - "summary": "Delete project", + "parameters": [ + { + "$ref": "#/components/parameters/ExperimentIdParam" + } + ], + "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/experiment/{experiment_id}/insert": { + "post": { + "operationId": "postExperimentIdInsert", + "tags": [ + "Experiments" + ], + "description": "Insert a set of events into the experiment", + "summary": "Insert experiment events", "security": [ { "bearerAuth": [] @@ -12942,16 +15742,27 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ProjectIdParam" + "$ref": "#/components/parameters/ExperimentIdParam" } ], + "requestBody": { + "description": "An array of experiment events to insert", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsertExperimentEventRequest" + } + } + } + }, "responses": { "200": { - "description": "Returns the deleted project object", + "description": "Returns the inserted row ids", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Project" + "$ref": "#/components/schemas/InsertEventsResponse" } } } @@ -13041,16 +15852,16 @@ } }, "options": { - "operationId": "optionsProjectId", + "operationId": "optionsExperimentIdInsert", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/project/{project_id}`)", + "summary": "Enable CORS (`/v1/experiment/{experiment_id}/insert`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/ProjectIdParam" + "$ref": "#/components/parameters/ExperimentIdParam" } ], "responses": { @@ -13103,14 +15914,14 @@ } } }, - "/v1/project_logs/{project_id}/insert": { + "/v1/experiment/{experiment_id}/fetch": { "post": { - "operationId": "postProjectLogsIdInsert", + "operationId": "postExperimentIdFetch", "tags": [ - "Logs" + "Experiments" ], - "description": "Insert a set of events into the project logs", - "summary": "Insert project logs events", + "description": "Fetch the events in an experiment. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint.", + "summary": "Fetch experiment (POST form)", "security": [ { "bearerAuth": [] @@ -13119,27 +15930,27 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ProjectIdParam" + "$ref": "#/components/parameters/ExperimentIdParam" } ], "requestBody": { - "description": "An array of project logs events to insert", + "description": "Filters for the fetch query", "required": false, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsertProjectLogsEventRequest" + "$ref": "#/components/schemas/FetchEventsRequest" } } } }, "responses": { "200": { - "description": "Returns the inserted row ids", + "description": "Returns the fetched rows", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsertEventsResponse" + "$ref": "#/components/schemas/FetchExperimentEventsResponse" } } } @@ -13228,77 +16039,13 @@ } } }, - "options": { - "operationId": "optionsProjectLogsIdInsert", - "description": "Enable CORS", - "summary": "Enable CORS (`/v1/project_logs/{project_id}/insert`)", - "security": [], - "tags": [ - "CORS" - ], - "parameters": [ - { - "$ref": "#/components/parameters/ProjectIdParam" - } - ], - "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_logs/{project_id}/fetch": { - "post": { - "operationId": "postProjectLogsIdFetch", + "get": { + "operationId": "getExperimentIdFetch", "tags": [ - "Logs" + "Experiments" ], - "description": "Fetch the events in a project logs. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint.", - "summary": "Fetch project logs (POST form)", + "description": "Fetch the events in an experiment. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint.", + "summary": "Fetch experiment (GET form)", "security": [ { "bearerAuth": [] @@ -13307,27 +16054,28 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ProjectIdParam" + "$ref": "#/components/parameters/ExperimentIdParam" + }, + { + "$ref": "#/components/parameters/FetchLimitParam" + }, + { + "$ref": "#/components/parameters/MaxXactId" + }, + { + "$ref": "#/components/parameters/MaxRootSpanId" + }, + { + "$ref": "#/components/parameters/Version" } ], - "requestBody": { - "description": "Filters for the fetch query", - "required": false, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FetchEventsRequest" - } - } - } - }, "responses": { "200": { "description": "Returns the fetched rows", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FetchProjectLogsEventsResponse" + "$ref": "#/components/schemas/FetchExperimentEventsResponse" } } } @@ -13416,13 +16164,77 @@ } } }, - "get": { - "operationId": "getProjectLogsIdFetch", + "options": { + "operationId": "optionsExperimentIdFetch", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/experiment/{experiment_id}/fetch`)", + "security": [], "tags": [ - "Logs" + "CORS" ], - "description": "Fetch the events in a project logs. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint.", - "summary": "Fetch project logs (GET form)", + "parameters": [ + { + "$ref": "#/components/parameters/ExperimentIdParam" + } + ], + "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/experiment/{experiment_id}/feedback": { + "post": { + "operationId": "postExperimentIdFeedback", + "tags": [ + "Experiments" + ], + "description": "Log feedback for a set of experiment events", + "summary": "Feedback for experiment events", "security": [ { "bearerAuth": [] @@ -13431,28 +16243,27 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ProjectIdParam" - }, - { - "$ref": "#/components/parameters/FetchLimitParam" - }, - { - "$ref": "#/components/parameters/MaxXactId" - }, - { - "$ref": "#/components/parameters/MaxRootSpanId" - }, - { - "$ref": "#/components/parameters/Version" + "$ref": "#/components/parameters/ExperimentIdParam" } ], + "requestBody": { + "description": "An array of feedback objects", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedbackExperimentEventRequest" + } + } + } + }, "responses": { "200": { - "description": "Returns the fetched rows", + "description": "Returns a success status", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FetchProjectLogsEventsResponse" + "$ref": "#/components/schemas/FeedbackResponseSchema" } } } @@ -13542,16 +16353,16 @@ } }, "options": { - "operationId": "optionsProjectLogsIdFetch", + "operationId": "optionsExperimentIdFeedback", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/project_logs/{project_id}/fetch`)", + "summary": "Enable CORS (`/v1/experiment/{experiment_id}/feedback`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/ProjectIdParam" + "$ref": "#/components/parameters/ExperimentIdParam" } ], "responses": { @@ -13604,43 +16415,37 @@ } } }, - "/v1/project_logs/{project_id}/feedback": { - "post": { - "operationId": "postProjectLogsIdFeedback", + "/v1/experiment/{experiment_id}/summarize": { + "get": { + "operationId": "getExperimentIdSummarize", "tags": [ - "Logs" + "Experiments" ], - "description": "Log feedback for a set of project logs events", - "summary": "Feedback for project logs events", + "description": "Summarize experiment", + "summary": "Summarize experiment", "security": [ { "bearerAuth": [] - }, - {} + } ], "parameters": [ { - "$ref": "#/components/parameters/ProjectIdParam" + "$ref": "#/components/parameters/ExperimentIdParam" + }, + { + "$ref": "#/components/parameters/SummarizeScores" + }, + { + "$ref": "#/components/parameters/ComparisonExperimentId" } ], - "requestBody": { - "description": "An array of feedback objects", - "required": false, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FeedbackProjectLogsEventRequest" - } - } - } - }, "responses": { "200": { - "description": "Returns a success status", + "description": "Experiment summary", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FeedbackResponseSchema" + "$ref": "#/components/schemas/SummarizeExperimentResponse" } } } @@ -13730,16 +16535,16 @@ } }, "options": { - "operationId": "optionsProjectLogsIdFeedback", + "operationId": "optionsExperimentIdSummarize", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/project_logs/{project_id}/feedback`)", + "summary": "Enable CORS (`/v1/experiment/{experiment_id}/summarize`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/ProjectIdParam" + "$ref": "#/components/parameters/ExperimentIdParam" } ], "responses": { @@ -13792,10 +16597,10 @@ } } }, - "/v1/experiment": { + "/v1/dataset": { "post": { "tags": [ - "Experiments" + "Datasets" ], "security": [ { @@ -13803,27 +16608,27 @@ }, {} ], - "operationId": "postExperiment", - "description": "Create a new experiment. If there is an existing experiment in the project with the same name as the one specified in the request, will return the existing experiment unmodified", - "summary": "Create experiment", + "operationId": "postDataset", + "description": "Create a new dataset. If there is an existing dataset in the project with the same name as the one specified in the request, will return the existing dataset unmodified", + "summary": "Create dataset", "requestBody": { - "description": "Any desired information about the new experiment object", - "required": false, + "description": "Any desired information about the new dataset object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateExperiment" + "$ref": "#/components/schemas/CreateDataset" } } } }, "responses": { "200": { - "description": "Returns the new experiment object", + "description": "Returns the new dataset object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Experiment" + "$ref": "#/components/schemas/Dataset" } } } @@ -13913,12 +16718,12 @@ } }, "get": { - "operationId": "getExperiment", + "operationId": "getDataset", "tags": [ - "Experiments" + "Datasets" ], - "description": "List out all experiments. The experiments are sorted by creation date, with the most recently-created experiments coming first", - "summary": "List experiments", + "description": "List out all datasets. The datasets are sorted by creation date, with the most recently-created datasets coming first", + "summary": "List datasets", "security": [ { "bearerAuth": [] @@ -13927,7 +16732,7 @@ ], "parameters": [ { - "$ref": "#/components/parameters/AppLimitWithDefaultParam" + "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" @@ -13939,7 +16744,7 @@ "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/ExperimentName" + "$ref": "#/components/parameters/DatasetName" }, { "$ref": "#/components/parameters/ProjectName" @@ -13953,7 +16758,7 @@ ], "responses": { "200": { - "description": "Returns a list of experiment objects", + "description": "Returns a list of dataset objects", "content": { "application/json": { "schema": { @@ -13962,9 +16767,9 @@ "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/Experiment" + "$ref": "#/components/schemas/Dataset" }, - "description": "A list of experiment objects" + "description": "A list of dataset objects" } }, "required": [ @@ -14060,9 +16865,9 @@ } }, "options": { - "operationId": "optionsExperiment", + "operationId": "optionsDataset", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/experiment`)", + "summary": "Enable CORS (`/v1/dataset`)", "security": [], "tags": [ "CORS" @@ -14117,14 +16922,14 @@ } } }, - "/v1/experiment/{experiment_id}": { + "/v1/dataset/{dataset_id}": { "get": { - "operationId": "getExperimentId", + "operationId": "getDatasetId", "tags": [ - "Experiments" + "Datasets" ], - "description": "Get an experiment object by its id", - "summary": "Get experiment", + "description": "Get a dataset object by its id", + "summary": "Get dataset", "security": [ { "bearerAuth": [] @@ -14133,16 +16938,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ExperimentIdParam" + "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { "200": { - "description": "Returns the experiment object", + "description": "Returns the dataset object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Experiment" + "$ref": "#/components/schemas/Dataset" } } } @@ -14232,12 +17037,12 @@ } }, "patch": { - "operationId": "patchExperimentId", + "operationId": "patchDatasetId", "tags": [ - "Experiments" + "Datasets" ], - "description": "Partially update an experiment 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 experiment", + "description": "Partially update a dataset 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", "security": [ { "bearerAuth": [] @@ -14246,7 +17051,7 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ExperimentIdParam" + "$ref": "#/components/parameters/DatasetIdParam" } ], "requestBody": { @@ -14255,18 +17060,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchExperiment" + "$ref": "#/components/schemas/PatchDataset" } } } }, "responses": { "200": { - "description": "Returns the experiment object", + "description": "Returns the dataset object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Experiment" + "$ref": "#/components/schemas/Dataset" } } } @@ -14356,12 +17161,12 @@ } }, "delete": { - "operationId": "deleteExperimentId", + "operationId": "deleteDatasetId", "tags": [ - "Experiments" + "Datasets" ], - "description": "Delete an experiment object by its id", - "summary": "Delete experiment", + "description": "Delete a dataset object by its id", + "summary": "Delete dataset", "security": [ { "bearerAuth": [] @@ -14370,16 +17175,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ExperimentIdParam" + "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { "200": { - "description": "Returns the deleted experiment object", + "description": "Returns the deleted dataset object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Experiment" + "$ref": "#/components/schemas/Dataset" } } } @@ -14469,16 +17274,16 @@ } }, "options": { - "operationId": "optionsExperimentId", + "operationId": "optionsDatasetId", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/experiment/{experiment_id}`)", + "summary": "Enable CORS (`/v1/dataset/{dataset_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/ExperimentIdParam" + "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { @@ -14531,14 +17336,14 @@ } } }, - "/v1/experiment/{experiment_id}/insert": { + "/v1/dataset/{dataset_id}/insert": { "post": { - "operationId": "postExperimentIdInsert", + "operationId": "postDatasetIdInsert", "tags": [ - "Experiments" + "Datasets" ], - "description": "Insert a set of events into the experiment", - "summary": "Insert experiment events", + "description": "Insert a set of events into the dataset", + "summary": "Insert dataset events", "security": [ { "bearerAuth": [] @@ -14547,16 +17352,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ExperimentIdParam" + "$ref": "#/components/parameters/DatasetIdParam" } ], "requestBody": { - "description": "An array of experiment events to insert", - "required": false, + "description": "An array of dataset events to insert", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsertExperimentEventRequest" + "$ref": "#/components/schemas/InsertDatasetEventRequest" } } } @@ -14657,16 +17462,16 @@ } }, "options": { - "operationId": "optionsExperimentIdInsert", + "operationId": "optionsDatasetIdInsert", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/experiment/{experiment_id}/insert`)", + "summary": "Enable CORS (`/v1/dataset/{dataset_id}/insert`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/ExperimentIdParam" + "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { @@ -14719,14 +17524,14 @@ } } }, - "/v1/experiment/{experiment_id}/fetch": { + "/v1/dataset/{dataset_id}/fetch": { "post": { - "operationId": "postExperimentIdFetch", + "operationId": "postDatasetIdFetch", "tags": [ - "Experiments" + "Datasets" ], - "description": "Fetch the events in an experiment. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint.", - "summary": "Fetch experiment (POST form)", + "description": "Fetch the events in a dataset. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint.", + "summary": "Fetch dataset (POST form)", "security": [ { "bearerAuth": [] @@ -14735,7 +17540,7 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ExperimentIdParam" + "$ref": "#/components/parameters/DatasetIdParam" } ], "requestBody": { @@ -14755,7 +17560,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FetchExperimentEventsResponse" + "$ref": "#/components/schemas/FetchDatasetEventsResponse" } } } @@ -14845,12 +17650,12 @@ } }, "get": { - "operationId": "getExperimentIdFetch", + "operationId": "getDatasetIdFetch", "tags": [ - "Experiments" + "Datasets" ], - "description": "Fetch the events in an experiment. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint.", - "summary": "Fetch experiment (GET form)", + "description": "Fetch the events in a dataset. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint.", + "summary": "Fetch dataset (GET form)", "security": [ { "bearerAuth": [] @@ -14859,7 +17664,7 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ExperimentIdParam" + "$ref": "#/components/parameters/DatasetIdParam" }, { "$ref": "#/components/parameters/FetchLimitParam" @@ -14880,7 +17685,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FetchExperimentEventsResponse" + "$ref": "#/components/schemas/FetchDatasetEventsResponse" } } } @@ -14970,16 +17775,16 @@ } }, "options": { - "operationId": "optionsExperimentIdFetch", + "operationId": "optionsDatasetIdFetch", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/experiment/{experiment_id}/fetch`)", + "summary": "Enable CORS (`/v1/dataset/{dataset_id}/fetch`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/ExperimentIdParam" + "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { @@ -15032,14 +17837,14 @@ } } }, - "/v1/experiment/{experiment_id}/feedback": { + "/v1/dataset/{dataset_id}/feedback": { "post": { - "operationId": "postExperimentIdFeedback", + "operationId": "postDatasetIdFeedback", "tags": [ - "Experiments" + "Datasets" ], - "description": "Log feedback for a set of experiment events", - "summary": "Feedback for experiment events", + "description": "Log feedback for a set of dataset events", + "summary": "Feedback for dataset events", "security": [ { "bearerAuth": [] @@ -15048,16 +17853,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ExperimentIdParam" + "$ref": "#/components/parameters/DatasetIdParam" } ], "requestBody": { "description": "An array of feedback objects", - "required": false, + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FeedbackExperimentEventRequest" + "$ref": "#/components/schemas/FeedbackDatasetEventRequest" } } } @@ -15158,16 +17963,16 @@ } }, "options": { - "operationId": "optionsExperimentIdFeedback", + "operationId": "optionsDatasetIdFeedback", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/experiment/{experiment_id}/feedback`)", + "summary": "Enable CORS (`/v1/dataset/{dataset_id}/feedback`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/ExperimentIdParam" + "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { @@ -15220,14 +18025,14 @@ } } }, - "/v1/experiment/{experiment_id}/summarize": { + "/v1/dataset/{dataset_id}/summarize": { "get": { - "operationId": "getExperimentIdSummarize", + "operationId": "getDatasetIdSummarize", "tags": [ - "Experiments" + "Datasets" ], - "description": "Summarize experiment", - "summary": "Summarize experiment", + "description": "Summarize dataset", + "summary": "Summarize dataset", "security": [ { "bearerAuth": [] @@ -15235,22 +18040,19 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ExperimentIdParam" - }, - { - "$ref": "#/components/parameters/SummarizeScores" + "$ref": "#/components/parameters/DatasetIdParam" }, { - "$ref": "#/components/parameters/ComparisonExperimentId" + "$ref": "#/components/parameters/SummarizeData" } ], "responses": { "200": { - "description": "Experiment summary", + "description": "Dataset summary", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SummarizeExperimentResponse" + "$ref": "#/components/schemas/SummarizeDatasetResponse" } } } @@ -15340,16 +18142,16 @@ } }, "options": { - "operationId": "optionsExperimentIdSummarize", + "operationId": "optionsDatasetIdSummarize", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/experiment/{experiment_id}/summarize`)", + "summary": "Enable CORS (`/v1/dataset/{dataset_id}/summarize`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/ExperimentIdParam" + "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { @@ -15402,10 +18204,10 @@ } } }, - "/v1/dataset": { + "/v1/prompt": { "post": { "tags": [ - "Datasets" + "Prompts" ], "security": [ { @@ -15413,27 +18215,146 @@ }, {} ], - "operationId": "postDataset", - "description": "Create a new dataset. If there is an existing dataset in the project with the same name as the one specified in the request, will return the existing dataset unmodified", - "summary": "Create dataset", + "operationId": "postPrompt", + "description": "Create a new prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will return the existing prompt unmodified", + "summary": "Create prompt", "requestBody": { - "description": "Any desired information about the new dataset object", - "required": false, + "description": "Any desired information about the new prompt object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateDataset" + "$ref": "#/components/schemas/CreatePrompt" } } } }, "responses": { "200": { - "description": "Returns the new dataset object", + "description": "Returns the new prompt object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/Prompt" + } + } + } + }, + "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": [ + "Prompts" + ], + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "operationId": "putPrompt", + "description": "Create or replace prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will replace the existing prompt with the provided fields", + "summary": "Create or replace prompt", + "requestBody": { + "description": "Any desired information about the new prompt object", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePrompt" + } + } + } + }, + "responses": { + "200": { + "description": "Returns the new prompt object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Prompt" } } } @@ -15523,12 +18444,12 @@ } }, "get": { - "operationId": "getDataset", + "operationId": "getPrompt", "tags": [ - "Datasets" + "Prompts" ], - "description": "List out all datasets. The datasets are sorted by creation date, with the most recently-created datasets coming first", - "summary": "List datasets", + "description": "List out all prompts. The prompts are sorted by creation date, with the most recently-created prompts coming first", + "summary": "List prompts", "security": [ { "bearerAuth": [] @@ -15549,7 +18470,7 @@ "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/DatasetName" + "$ref": "#/components/parameters/PromptName" }, { "$ref": "#/components/parameters/ProjectName" @@ -15557,13 +18478,22 @@ { "$ref": "#/components/parameters/ProjectIdQuery" }, + { + "$ref": "#/components/parameters/Slug" + }, + { + "$ref": "#/components/parameters/PromptVersion" + }, + { + "$ref": "#/components/parameters/PromptEnvironment" + }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { - "description": "Returns a list of dataset objects", + "description": "Returns a list of prompt objects", "content": { "application/json": { "schema": { @@ -15572,9 +18502,9 @@ "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/Prompt" }, - "description": "A list of dataset objects" + "description": "A list of prompt objects" } }, "required": [ @@ -15670,9 +18600,9 @@ } }, "options": { - "operationId": "optionsDataset", + "operationId": "optionsPrompt", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/dataset`)", + "summary": "Enable CORS (`/v1/prompt`)", "security": [], "tags": [ "CORS" @@ -15727,14 +18657,14 @@ } } }, - "/v1/dataset/{dataset_id}": { + "/v1/prompt/{prompt_id}": { "get": { - "operationId": "getDatasetId", + "operationId": "getPromptId", "tags": [ - "Datasets" + "Prompts" ], - "description": "Get a dataset object by its id", - "summary": "Get dataset", + "description": "Get a prompt object by its id", + "summary": "Get prompt", "security": [ { "bearerAuth": [] @@ -15743,16 +18673,22 @@ ], "parameters": [ { - "$ref": "#/components/parameters/DatasetIdParam" + "$ref": "#/components/parameters/PromptIdParam" + }, + { + "$ref": "#/components/parameters/PromptVersion" + }, + { + "$ref": "#/components/parameters/PromptEnvironment" } ], "responses": { "200": { - "description": "Returns the dataset object", + "description": "Returns the prompt object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/Prompt" } } } @@ -15842,12 +18778,12 @@ } }, "patch": { - "operationId": "patchDatasetId", + "operationId": "patchPromptId", "tags": [ - "Datasets" + "Prompts" ], - "description": "Partially update a dataset 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", + "description": "Partially update a prompt 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 prompt", "security": [ { "bearerAuth": [] @@ -15856,7 +18792,7 @@ ], "parameters": [ { - "$ref": "#/components/parameters/DatasetIdParam" + "$ref": "#/components/parameters/PromptIdParam" } ], "requestBody": { @@ -15865,18 +18801,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchDataset" + "$ref": "#/components/schemas/PatchPrompt" } } } }, "responses": { "200": { - "description": "Returns the dataset object", + "description": "Returns the prompt object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/Prompt" } } } @@ -15966,12 +18902,12 @@ } }, "delete": { - "operationId": "deleteDatasetId", + "operationId": "deletePromptId", "tags": [ - "Datasets" + "Prompts" ], - "description": "Delete a dataset object by its id", - "summary": "Delete dataset", + "description": "Delete a prompt object by its id", + "summary": "Delete prompt", "security": [ { "bearerAuth": [] @@ -15980,16 +18916,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/DatasetIdParam" + "$ref": "#/components/parameters/PromptIdParam" } ], "responses": { "200": { - "description": "Returns the deleted dataset object", + "description": "Returns the deleted prompt object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/Prompt" } } } @@ -16079,16 +19015,16 @@ } }, "options": { - "operationId": "optionsDatasetId", + "operationId": "optionsPromptId", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/dataset/{dataset_id}`)", + "summary": "Enable CORS (`/v1/prompt/{prompt_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/DatasetIdParam" + "$ref": "#/components/parameters/PromptIdParam" } ], "responses": { @@ -16141,43 +19077,38 @@ } } }, - "/v1/dataset/{dataset_id}/insert": { + "/v1/role": { "post": { - "operationId": "postDatasetIdInsert", "tags": [ - "Datasets" + "Roles" ], - "description": "Insert a set of events into the dataset", - "summary": "Insert dataset events", "security": [ { "bearerAuth": [] }, {} ], - "parameters": [ - { - "$ref": "#/components/parameters/DatasetIdParam" - } - ], + "operationId": "postRole", + "description": "Create a new role. If there is an existing role with the same name as the one specified in the request, will return the existing role unmodified", + "summary": "Create role", "requestBody": { - "description": "An array of dataset events to insert", - "required": false, + "description": "Any desired information about the new role object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsertDatasetEventRequest" + "$ref": "#/components/schemas/CreateRole" } } } }, "responses": { "200": { - "description": "Returns the inserted row ids", + "description": "Returns the new role object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsertEventsResponse" + "$ref": "#/components/schemas/Role" } } } @@ -16266,106 +19197,37 @@ } } }, - "options": { - "operationId": "optionsDatasetIdInsert", - "description": "Enable CORS", - "summary": "Enable CORS (`/v1/dataset/{dataset_id}/insert`)", - "security": [], - "tags": [ - "CORS" - ], - "parameters": [ - { - "$ref": "#/components/parameters/DatasetIdParam" - } - ], - "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/dataset/{dataset_id}/fetch": { - "post": { - "operationId": "postDatasetIdFetch", + "put": { "tags": [ - "Datasets" + "Roles" ], - "description": "Fetch the events in a dataset. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint.", - "summary": "Fetch dataset (POST form)", "security": [ { "bearerAuth": [] }, {} ], - "parameters": [ - { - "$ref": "#/components/parameters/DatasetIdParam" - } - ], + "operationId": "putRole", + "description": "Create or replace role. If there is an existing role with the same name as the one specified in the request, will replace the existing role with the provided fields", + "summary": "Create or replace role", "requestBody": { - "description": "Filters for the fetch query", - "required": false, + "description": "Any desired information about the new role object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FetchEventsRequest" + "$ref": "#/components/schemas/CreateRole" } } } }, "responses": { "200": { - "description": "Returns the fetched rows", + "description": "Returns the new role object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FetchDatasetEventsResponse" + "$ref": "#/components/schemas/Role" } } } @@ -16455,12 +19317,12 @@ } }, "get": { - "operationId": "getDatasetIdFetch", + "operationId": "getRole", "tags": [ - "Datasets" + "Roles" ], - "description": "Fetch the events in a dataset. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint.", - "summary": "Fetch dataset (GET form)", + "description": "List out all roles. The roles are sorted by creation date, with the most recently-created roles coming first", + "summary": "List roles", "security": [ { "bearerAuth": [] @@ -16469,28 +19331,44 @@ ], "parameters": [ { - "$ref": "#/components/parameters/DatasetIdParam" + "$ref": "#/components/parameters/AppLimitParam" }, { - "$ref": "#/components/parameters/FetchLimitParam" + "$ref": "#/components/parameters/StartingAfter" }, { - "$ref": "#/components/parameters/MaxXactId" + "$ref": "#/components/parameters/EndingBefore" }, { - "$ref": "#/components/parameters/MaxRootSpanId" + "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/Version" + "$ref": "#/components/parameters/RoleName" + }, + { + "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { - "description": "Returns the fetched rows", + "description": "Returns a list of role objects", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FetchDatasetEventsResponse" + "type": "object", + "properties": { + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Role" + }, + "description": "A list of role objects" + } + }, + "required": [ + "objects" + ], + "additionalProperties": false } } } @@ -16580,18 +19458,13 @@ } }, "options": { - "operationId": "optionsDatasetIdFetch", + "operationId": "optionsRole", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/dataset/{dataset_id}/fetch`)", + "summary": "Enable CORS (`/v1/role`)", "security": [], "tags": [ "CORS" ], - "parameters": [ - { - "$ref": "#/components/parameters/DatasetIdParam" - } - ], "responses": { "200": { "description": "Response for CORS method", @@ -16642,14 +19515,14 @@ } } }, - "/v1/dataset/{dataset_id}/feedback": { - "post": { - "operationId": "postDatasetIdFeedback", + "/v1/role/{role_id}": { + "get": { + "operationId": "getRoleId", "tags": [ - "Datasets" + "Roles" ], - "description": "Log feedback for a set of dataset events", - "summary": "Feedback for dataset events", + "description": "Get a role object by its id", + "summary": "Get role", "security": [ { "bearerAuth": [] @@ -16658,27 +19531,140 @@ ], "parameters": [ { - "$ref": "#/components/parameters/DatasetIdParam" + "$ref": "#/components/parameters/RoleIdParam" + } + ], + "responses": { + "200": { + "description": "Returns the role object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Role" + } + } + } + }, + "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": "patchRoleId", + "tags": [ + "Roles" + ], + "description": "Partially update a role 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 role", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/RoleIdParam" } ], "requestBody": { - "description": "An array of feedback objects", + "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FeedbackDatasetEventRequest" + "$ref": "#/components/schemas/PatchRole" } } } }, "responses": { "200": { - "description": "Returns a success status", + "description": "Returns the role object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FeedbackResponseSchema" + "$ref": "#/components/schemas/Role" } } } @@ -16767,97 +19753,31 @@ } } }, - "options": { - "operationId": "optionsDatasetIdFeedback", - "description": "Enable CORS", - "summary": "Enable CORS (`/v1/dataset/{dataset_id}/feedback`)", - "security": [], - "tags": [ - "CORS" - ], - "parameters": [ - { - "$ref": "#/components/parameters/DatasetIdParam" - } - ], - "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/dataset/{dataset_id}/summarize": { - "get": { - "operationId": "getDatasetIdSummarize", + "delete": { + "operationId": "deleteRoleId", "tags": [ - "Datasets" + "Roles" ], - "description": "Summarize dataset", - "summary": "Summarize dataset", + "description": "Delete a role object by its id", + "summary": "Delete role", "security": [ { "bearerAuth": [] - } + }, + {} ], "parameters": [ { - "$ref": "#/components/parameters/DatasetIdParam" - }, - { - "$ref": "#/components/parameters/SummarizeData" + "$ref": "#/components/parameters/RoleIdParam" } ], "responses": { "200": { - "description": "Dataset summary", + "description": "Returns the deleted role object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SummarizeDatasetResponse" + "$ref": "#/components/schemas/Role" } } } @@ -16947,16 +19867,16 @@ } }, "options": { - "operationId": "optionsDatasetIdSummarize", + "operationId": "optionsRoleId", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/dataset/{dataset_id}/summarize`)", + "summary": "Enable CORS (`/v1/role/{role_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/DatasetIdParam" + "$ref": "#/components/parameters/RoleIdParam" } ], "responses": { @@ -17009,10 +19929,10 @@ } } }, - "/v1/prompt": { + "/v1/group": { "post": { "tags": [ - "Prompts" + "Groups" ], "security": [ { @@ -17020,27 +19940,27 @@ }, {} ], - "operationId": "postPrompt", - "description": "Create a new prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will return the existing prompt unmodified", - "summary": "Create prompt", + "operationId": "postGroup", + "description": "Create a new group. If there is an existing group with the same name as the one specified in the request, will return the existing group unmodified", + "summary": "Create group", "requestBody": { - "description": "Any desired information about the new prompt object", - "required": false, + "description": "Any desired information about the new group object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreatePrompt" + "$ref": "#/components/schemas/CreateGroup" } } } }, "responses": { "200": { - "description": "Returns the new prompt object", + "description": "Returns the new group object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Prompt" + "$ref": "#/components/schemas/Group" } } } @@ -17131,7 +20051,7 @@ }, "put": { "tags": [ - "Prompts" + "Groups" ], "security": [ { @@ -17139,27 +20059,27 @@ }, {} ], - "operationId": "putPrompt", - "description": "Create or replace prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will replace the existing prompt with the provided fields", - "summary": "Create or replace prompt", + "operationId": "putGroup", + "description": "Create or replace group. If there is an existing group with the same name as the one specified in the request, will replace the existing group with the provided fields", + "summary": "Create or replace group", "requestBody": { - "description": "Any desired information about the new prompt object", - "required": false, + "description": "Any desired information about the new group object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreatePrompt" + "$ref": "#/components/schemas/CreateGroup" } } } }, "responses": { "200": { - "description": "Returns the new prompt object", + "description": "Returns the new group object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Prompt" + "$ref": "#/components/schemas/Group" } } } @@ -17249,12 +20169,12 @@ } }, "get": { - "operationId": "getPrompt", + "operationId": "getGroup", "tags": [ - "Prompts" + "Groups" ], - "description": "List out all prompts. The prompts are sorted by creation date, with the most recently-created prompts coming first", - "summary": "List prompts", + "description": "List out all groups. The groups are sorted by creation date, with the most recently-created groups coming first", + "summary": "List groups", "security": [ { "bearerAuth": [] @@ -17275,22 +20195,7 @@ "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/PromptName" - }, - { - "$ref": "#/components/parameters/ProjectName" - }, - { - "$ref": "#/components/parameters/ProjectIdQuery" - }, - { - "$ref": "#/components/parameters/Slug" - }, - { - "$ref": "#/components/parameters/PromptVersion" - }, - { - "$ref": "#/components/parameters/PromptEnvironment" + "$ref": "#/components/parameters/GroupName" }, { "$ref": "#/components/parameters/OrgName" @@ -17298,7 +20203,7 @@ ], "responses": { "200": { - "description": "Returns a list of prompt objects", + "description": "Returns a list of group objects", "content": { "application/json": { "schema": { @@ -17307,9 +20212,9 @@ "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/Prompt" + "$ref": "#/components/schemas/Group" }, - "description": "A list of prompt objects" + "description": "A list of group objects" } }, "required": [ @@ -17405,9 +20310,9 @@ } }, "options": { - "operationId": "optionsPrompt", + "operationId": "optionsGroup", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/prompt`)", + "summary": "Enable CORS (`/v1/group`)", "security": [], "tags": [ "CORS" @@ -17462,14 +20367,14 @@ } } }, - "/v1/prompt/{prompt_id}": { + "/v1/group/{group_id}": { "get": { - "operationId": "getPromptId", + "operationId": "getGroupId", "tags": [ - "Prompts" + "Groups" ], - "description": "Get a prompt object by its id", - "summary": "Get prompt", + "description": "Get a group object by its id", + "summary": "Get group", "security": [ { "bearerAuth": [] @@ -17478,22 +20383,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/PromptIdParam" - }, - { - "$ref": "#/components/parameters/PromptVersion" - }, - { - "$ref": "#/components/parameters/PromptEnvironment" + "$ref": "#/components/parameters/GroupIdParam" } ], "responses": { "200": { - "description": "Returns the prompt object", + "description": "Returns the group object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Prompt" + "$ref": "#/components/schemas/Group" } } } @@ -17583,12 +20482,12 @@ } }, "patch": { - "operationId": "patchPromptId", + "operationId": "patchGroupId", "tags": [ - "Prompts" + "Groups" ], - "description": "Partially update a prompt 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 prompt", + "description": "Partially update a group 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 group", "security": [ { "bearerAuth": [] @@ -17597,7 +20496,7 @@ ], "parameters": [ { - "$ref": "#/components/parameters/PromptIdParam" + "$ref": "#/components/parameters/GroupIdParam" } ], "requestBody": { @@ -17606,18 +20505,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchPrompt" + "$ref": "#/components/schemas/PatchGroup" } } } }, "responses": { "200": { - "description": "Returns the prompt object", + "description": "Returns the group object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Prompt" + "$ref": "#/components/schemas/Group" } } } @@ -17707,12 +20606,12 @@ } }, "delete": { - "operationId": "deletePromptId", + "operationId": "deleteGroupId", "tags": [ - "Prompts" + "Groups" ], - "description": "Delete a prompt object by its id", - "summary": "Delete prompt", + "description": "Delete a group object by its id", + "summary": "Delete group", "security": [ { "bearerAuth": [] @@ -17721,16 +20620,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/PromptIdParam" + "$ref": "#/components/parameters/GroupIdParam" } ], "responses": { "200": { - "description": "Returns the deleted prompt object", + "description": "Returns the deleted group object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Prompt" + "$ref": "#/components/schemas/Group" } } } @@ -17820,16 +20719,16 @@ } }, "options": { - "operationId": "optionsPromptId", + "operationId": "optionsGroupId", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/prompt/{prompt_id}`)", + "summary": "Enable CORS (`/v1/group/{group_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/PromptIdParam" + "$ref": "#/components/parameters/GroupIdParam" } ], "responses": { @@ -17882,10 +20781,10 @@ } } }, - "/v1/role": { + "/v1/project_group": { "post": { "tags": [ - "Roles" + "ProjectGroups" ], "security": [ { @@ -17893,27 +20792,27 @@ }, {} ], - "operationId": "postRole", - "description": "Create a new role. If there is an existing role with the same name as the one specified in the request, will return the existing role unmodified", - "summary": "Create role", + "operationId": "postProjectGroup", + "description": "Create a new project_group. If there is an existing project_group with the same name as the one specified in the request, will return the existing project_group unmodified", + "summary": "Create project_group", "requestBody": { - "description": "Any desired information about the new role object", - "required": false, + "description": "Any desired information about the new project_group object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateRole" + "$ref": "#/components/schemas/CreateProjectGroup" } } } }, "responses": { "200": { - "description": "Returns the new role object", + "description": "Returns the new project_group object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Role" + "$ref": "#/components/schemas/ProjectGroup" } } } @@ -18004,7 +20903,7 @@ }, "put": { "tags": [ - "Roles" + "ProjectGroups" ], "security": [ { @@ -18012,27 +20911,27 @@ }, {} ], - "operationId": "putRole", - "description": "Create or replace role. If there is an existing role with the same name as the one specified in the request, will replace the existing role with the provided fields", - "summary": "Create or replace role", + "operationId": "putProjectGroup", + "description": "Create or replace project_group. If there is an existing project_group with the same name as the one specified in the request, will replace the existing project_group with the provided fields", + "summary": "Create or replace project_group", "requestBody": { - "description": "Any desired information about the new role object", - "required": false, + "description": "Any desired information about the new project_group object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateRole" + "$ref": "#/components/schemas/CreateProjectGroup" } } } }, "responses": { "200": { - "description": "Returns the new role object", + "description": "Returns the new project_group object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Role" + "$ref": "#/components/schemas/ProjectGroup" } } } @@ -18122,12 +21021,12 @@ } }, "get": { - "operationId": "getRole", + "operationId": "getProjectGroup", "tags": [ - "Roles" + "ProjectGroups" ], - "description": "List out all roles. The roles are sorted by creation date, with the most recently-created roles coming first", - "summary": "List roles", + "description": "List out all project_groups. The project_groups are sorted by creation date, with the most recently-created project_groups coming first", + "summary": "List project_groups", "security": [ { "bearerAuth": [] @@ -18148,7 +21047,7 @@ "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/RoleName" + "$ref": "#/components/parameters/ProjectGroupName" }, { "$ref": "#/components/parameters/OrgName" @@ -18156,7 +21055,7 @@ ], "responses": { "200": { - "description": "Returns a list of role objects", + "description": "Returns a list of project_group objects", "content": { "application/json": { "schema": { @@ -18165,9 +21064,9 @@ "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/Role" + "$ref": "#/components/schemas/ProjectGroup" }, - "description": "A list of role objects" + "description": "A list of project_group objects" } }, "required": [ @@ -18263,9 +21162,9 @@ } }, "options": { - "operationId": "optionsRole", + "operationId": "optionsProjectGroup", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/role`)", + "summary": "Enable CORS (`/v1/project_group`)", "security": [], "tags": [ "CORS" @@ -18320,14 +21219,14 @@ } } }, - "/v1/role/{role_id}": { + "/v1/project_group/{project_group_id}": { "get": { - "operationId": "getRoleId", + "operationId": "getProjectGroupId", "tags": [ - "Roles" + "ProjectGroups" ], - "description": "Get a role object by its id", - "summary": "Get role", + "description": "Get a project_group object by its id", + "summary": "Get project_group", "security": [ { "bearerAuth": [] @@ -18336,16 +21235,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/RoleIdParam" + "$ref": "#/components/parameters/ProjectGroupIdParam" } ], "responses": { "200": { - "description": "Returns the role object", + "description": "Returns the project_group object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Role" + "$ref": "#/components/schemas/ProjectGroup" } } } @@ -18435,12 +21334,12 @@ } }, "patch": { - "operationId": "patchRoleId", + "operationId": "patchProjectGroupId", "tags": [ - "Roles" + "ProjectGroups" ], - "description": "Partially update a role 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 role", + "description": "Partially update a project_group 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 project_group", "security": [ { "bearerAuth": [] @@ -18449,7 +21348,7 @@ ], "parameters": [ { - "$ref": "#/components/parameters/RoleIdParam" + "$ref": "#/components/parameters/ProjectGroupIdParam" } ], "requestBody": { @@ -18458,18 +21357,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchRole" + "$ref": "#/components/schemas/PatchProjectGroup" } } } }, "responses": { "200": { - "description": "Returns the role object", + "description": "Returns the project_group object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Role" + "$ref": "#/components/schemas/ProjectGroup" } } } @@ -18559,12 +21458,12 @@ } }, "delete": { - "operationId": "deleteRoleId", + "operationId": "deleteProjectGroupId", "tags": [ - "Roles" + "ProjectGroups" ], - "description": "Delete a role object by its id", - "summary": "Delete role", + "description": "Delete a project_group object by its id", + "summary": "Delete project_group", "security": [ { "bearerAuth": [] @@ -18573,16 +21472,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/RoleIdParam" + "$ref": "#/components/parameters/ProjectGroupIdParam" } ], "responses": { "200": { - "description": "Returns the deleted role object", + "description": "Returns the deleted project_group object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Role" + "$ref": "#/components/schemas/ProjectGroup" } } } @@ -18672,16 +21571,16 @@ } }, "options": { - "operationId": "optionsRoleId", + "operationId": "optionsProjectGroupId", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/role/{role_id}`)", + "summary": "Enable CORS (`/v1/project_group/{project_group_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/RoleIdParam" + "$ref": "#/components/parameters/ProjectGroupIdParam" } ], "responses": { @@ -18734,10 +21633,10 @@ } } }, - "/v1/group": { + "/v1/acl": { "post": { "tags": [ - "Groups" + "Acls" ], "security": [ { @@ -18745,27 +21644,27 @@ }, {} ], - "operationId": "postGroup", - "description": "Create a new group. If there is an existing group with the same name as the one specified in the request, will return the existing group unmodified", - "summary": "Create group", + "operationId": "postAcl", + "description": "Create a new acl. If there is an existing acl with the same contents as the one specified in the request, will return the existing acl unmodified", + "summary": "Create acl", "requestBody": { - "description": "Any desired information about the new group object", - "required": false, + "description": "Any desired information about the new acl object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateGroup" + "$ref": "#/components/schemas/AclItem" } } } }, "responses": { "200": { - "description": "Returns the new group object", + "description": "Returns the new acl object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Group" + "$ref": "#/components/schemas/Acl" } } } @@ -18854,37 +21753,37 @@ } } }, - "put": { + "delete": { + "operationId": "deleteAcl", "tags": [ - "Groups" + "Acls" ], + "description": "Delete a single acl", + "summary": "Delete single acl", "security": [ { "bearerAuth": [] }, {} ], - "operationId": "putGroup", - "description": "Create or replace group. If there is an existing group with the same name as the one specified in the request, will replace the existing group with the provided fields", - "summary": "Create or replace group", "requestBody": { - "description": "Any desired information about the new group object", - "required": false, + "description": "Parameters which uniquely specify the acl to delete", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateGroup" + "$ref": "#/components/schemas/AclItem" } } } }, "responses": { "200": { - "description": "Returns the new group object", + "description": "Returns the deleted acl object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Group" + "$ref": "#/components/schemas/Acl" } } } @@ -18974,12 +21873,12 @@ } }, "get": { - "operationId": "getGroup", + "operationId": "getAcl", "tags": [ - "Groups" + "Acls" ], - "description": "List out all groups. The groups are sorted by creation date, with the most recently-created groups coming first", - "summary": "List groups", + "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": [] @@ -19000,15 +21899,30 @@ "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/GroupName" + "$ref": "#/components/parameters/AclObjectType" }, { - "$ref": "#/components/parameters/OrgName" + "$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 group objects", + "description": "Returns a list of acl objects", "content": { "application/json": { "schema": { @@ -19017,9 +21931,9 @@ "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/Group" + "$ref": "#/components/schemas/Acl" }, - "description": "A list of group objects" + "description": "A list of acl objects" } }, "required": [ @@ -19115,9 +22029,9 @@ } }, "options": { - "operationId": "optionsGroup", + "operationId": "optionsAcl", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/group`)", + "summary": "Enable CORS (`/v1/acl`)", "security": [], "tags": [ "CORS" @@ -19172,14 +22086,14 @@ } } }, - "/v1/group/{group_id}": { + "/v1/acl/{acl_id}": { "get": { - "operationId": "getGroupId", + "operationId": "getAclId", "tags": [ - "Groups" + "Acls" ], - "description": "Get a group object by its id", - "summary": "Get group", + "description": "Get an acl object by its id", + "summary": "Get acl", "security": [ { "bearerAuth": [] @@ -19188,16 +22102,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/GroupIdParam" + "$ref": "#/components/parameters/AclIdParam" } ], "responses": { "200": { - "description": "Returns the group object", + "description": "Returns the acl object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Group" + "$ref": "#/components/schemas/Acl" } } } @@ -19286,13 +22200,13 @@ } } }, - "patch": { - "operationId": "patchGroupId", + "delete": { + "operationId": "deleteAclId", "tags": [ - "Groups" + "Acls" ], - "description": "Partially update a group 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 group", + "description": "Delete an acl object by its id", + "summary": "Delete acl", "security": [ { "bearerAuth": [] @@ -19301,27 +22215,199 @@ ], "parameters": [ { - "$ref": "#/components/parameters/GroupIdParam" + "$ref": "#/components/parameters/AclIdParam" } ], + "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 + } + } + } + } + } + }, + "options": { + "operationId": "optionsAclId", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/acl/{acl_id}`)", + "security": [], + "tags": [ + "CORS" + ], + "parameters": [ + { + "$ref": "#/components/parameters/AclIdParam" + } + ], + "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/acl/batch_update": { + "post": { + "operationId": "aclBatchUpdate", + "tags": [ + "Acls" + ], + "description": "Batch update acls. This operation is idempotent, so adding acls which already exist will have no effect, and removing acls which do not exist will have no effect.", + "summary": "Batch update acls", + "security": [ + { + "bearerAuth": [] + }, + {} + ], "requestBody": { - "description": "Fields to update", + "description": "Acls to add/remove.", "required": false, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchGroup" + "$ref": "#/components/schemas/AclBatchUpdateRequest" } } } }, "responses": { "200": { - "description": "Returns the group object", + "description": "A success status", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Group" + "$ref": "#/components/schemas/AclBatchUpdateResponse" } } } @@ -19409,14 +22495,16 @@ } } } - }, - "delete": { - "operationId": "deleteGroupId", + } + }, + "/v1/acl/list_org": { + "get": { + "operationId": "aclListOrg", "tags": [ - "Groups" + "Acls" ], - "description": "Delete a group object by its id", - "summary": "Delete group", + "description": "List all acls in the org. This query requires the caller to have `read_acls` permission at the organization level", + "summary": "List org acls", "security": [ { "bearerAuth": [] @@ -19425,16 +22513,52 @@ ], "parameters": [ { - "$ref": "#/components/parameters/GroupIdParam" + "$ref": "#/components/parameters/AppLimitParam" + }, + { + "$ref": "#/components/parameters/Ids" + }, + { + "$ref": "#/components/parameters/StartingAfter" + }, + { + "$ref": "#/components/parameters/EndingBefore" + }, + { + "$ref": "#/components/parameters/AclListOrgObjectType" + }, + { + "$ref": "#/components/parameters/AclListOrgObjectId" + }, + { + "$ref": "#/components/parameters/AclListUserId" + }, + { + "$ref": "#/components/parameters/AclListGroupId" + }, + { + "$ref": "#/components/parameters/AclListPermission" + }, + { + "$ref": "#/components/parameters/AclListRestrictObjectType" + }, + { + "$ref": "#/components/parameters/AclListRoleId" + }, + { + "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { - "description": "Returns the deleted group object", + "description": "A list of acls", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Group" + "type": "array", + "items": { + "$ref": "#/components/schemas/Acl" + } } } } @@ -19524,18 +22648,13 @@ } }, "options": { - "operationId": "optionsGroupId", + "operationId": "optionsAclListOrg", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/group/{group_id}`)", + "summary": "Enable CORS (`/v1/acl/list_org`)", "security": [], "tags": [ "CORS" ], - "parameters": [ - { - "$ref": "#/components/parameters/GroupIdParam" - } - ], "responses": { "200": { "description": "Response for CORS method", @@ -19586,111 +22705,49 @@ } } }, - "/v1/acl": { - "post": { + "/v1/acl/acl/batch_update": { + "options": { + "operationId": "optionsAclBatchUpdate", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/acl/acl/batch_update`)", + "security": [], "tags": [ - "Acls" - ], - "security": [ - { - "bearerAuth": [] - }, - {} + "CORS" ], - "operationId": "postAcl", - "description": "Create a new acl. If there is an existing acl with the same contents as the one specified in the request, will return the existing acl unmodified", - "summary": "Create acl", - "requestBody": { - "description": "Any desired information about the new acl object", - "required": false, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AclItem" - } - } - } - }, "responses": { "200": { - "description": "Returns the new 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": { + "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": { - "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": { @@ -19705,14 +22762,16 @@ } } } - }, + } + }, + "/v1/user": { "get": { - "operationId": "getAcl", + "operationId": "getUser", "tags": [ - "Acls" + "Users" ], - "description": "List out all acls. The acls are sorted by creation date, with the most recently-created acls coming first", - "summary": "List acls", + "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": [] @@ -19733,30 +22792,21 @@ "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/AclObjectType" - }, - { - "$ref": "#/components/parameters/AclObjectId" - }, - { - "$ref": "#/components/parameters/AclListUserId" - }, - { - "$ref": "#/components/parameters/AclListGroupId" + "$ref": "#/components/parameters/UserGivenName" }, { - "$ref": "#/components/parameters/AclListPermission" + "$ref": "#/components/parameters/UserFamilyName" }, { - "$ref": "#/components/parameters/AclListRestrictObjectType" + "$ref": "#/components/parameters/UserEmail" }, { - "$ref": "#/components/parameters/AclListRoleId" + "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { - "description": "Returns a list of acl objects", + "description": "Returns a list of user objects", "content": { "application/json": { "schema": { @@ -19765,9 +22815,9 @@ "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/Acl" + "$ref": "#/components/schemas/User" }, - "description": "A list of acl objects" + "description": "A list of user objects" } }, "required": [ @@ -19863,9 +22913,9 @@ } }, "options": { - "operationId": "optionsAcl", + "operationId": "optionsUser", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/acl`)", + "summary": "Enable CORS (`/v1/user`)", "security": [], "tags": [ "CORS" @@ -19920,14 +22970,14 @@ } } }, - "/v1/acl/{acl_id}": { + "/v1/user/{user_id}": { "get": { - "operationId": "getAclId", + "operationId": "getUserId", "tags": [ - "Acls" + "Users" ], - "description": "Get an acl object by its id", - "summary": "Get acl", + "description": "Get a user object by its id", + "summary": "Get user", "security": [ { "bearerAuth": [] @@ -19936,16 +22986,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/AclIdParam" + "$ref": "#/components/parameters/UserIdParam" } ], "responses": { "200": { - "description": "Returns the acl object", + "description": "Returns the user object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Acl" + "$ref": "#/components/schemas/User" } } } @@ -20034,31 +23084,101 @@ } } }, - "delete": { - "operationId": "deleteAclId", + "options": { + "operationId": "optionsUserId", + "description": "Enable CORS", + "summary": "Enable CORS (`/v1/user/{user_id}`)", + "security": [], "tags": [ - "Acls" + "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" ], - "description": "Delete an acl object by its id", - "summary": "Delete acl", "security": [ { "bearerAuth": [] }, {} ], - "parameters": [ - { - "$ref": "#/components/parameters/AclIdParam" + "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": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateAgent" + } + } } - ], + }, "responses": { "200": { - "description": "Returns the deleted acl object", + "description": "Returns the new agent object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Acl" + "$ref": "#/components/schemas/Agent" } } } @@ -20147,101 +23267,37 @@ } } }, - "options": { - "operationId": "optionsAclId", - "description": "Enable CORS", - "summary": "Enable CORS (`/v1/acl/{acl_id}`)", - "security": [], - "tags": [ - "CORS" - ], - "parameters": [ - { - "$ref": "#/components/parameters/AclIdParam" - } - ], - "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/acl/batch_update": { - "post": { - "operationId": "aclBatchUpdate", + "put": { "tags": [ - "Acls" + "Agents" ], - "description": "Batch update acls. This operation is idempotent, so adding acls which already exist will have no effect, and removing acls which do not exist will have no effect.", - "summary": "Batch update acls", "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": "Acls to add/remove.", - "required": false, + "description": "Any desired information about the new agent object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AclBatchUpdateRequest" + "$ref": "#/components/schemas/CreateAgent" } } } }, "responses": { "200": { - "description": "A success status", + "description": "Returns the new agent object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AclBatchUpdateResponse" + "$ref": "#/components/schemas/Agent" } } } @@ -20329,16 +23385,14 @@ } } } - } - }, - "/v1/acl/list_org": { + }, "get": { - "operationId": "aclListOrg", + "operationId": "getAgent", "tags": [ - "Acls" + "Agents" ], - "description": "List all acls in the org. This query requires the caller to have `read_acls` permission at the organization level", - "summary": "List org acls", + "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": [] @@ -20349,9 +23403,6 @@ { "$ref": "#/components/parameters/AppLimitParam" }, - { - "$ref": "#/components/parameters/Ids" - }, { "$ref": "#/components/parameters/StartingAfter" }, @@ -20359,25 +23410,10 @@ "$ref": "#/components/parameters/EndingBefore" }, { - "$ref": "#/components/parameters/AclListOrgObjectType" - }, - { - "$ref": "#/components/parameters/AclListOrgObjectId" - }, - { - "$ref": "#/components/parameters/AclListUserId" - }, - { - "$ref": "#/components/parameters/AclListGroupId" - }, - { - "$ref": "#/components/parameters/AclListPermission" - }, - { - "$ref": "#/components/parameters/AclListRestrictObjectType" + "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/AclListRoleId" + "$ref": "#/components/parameters/AgentName" }, { "$ref": "#/components/parameters/OrgName" @@ -20385,14 +23421,24 @@ ], "responses": { "200": { - "description": "A list of acls", + "description": "Returns a list of agent objects", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Acl" - } + "type": "object", + "properties": { + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Agent" + }, + "description": "A list of agent objects" + } + }, + "required": [ + "objects" + ], + "additionalProperties": false } } } @@ -20482,9 +23528,9 @@ } }, "options": { - "operationId": "optionsAclListOrg", + "operationId": "optionsAgent", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/acl/list_org`)", + "summary": "Enable CORS (`/v1/agent`)", "security": [], "tags": [ "CORS" @@ -20539,49 +23585,105 @@ } } }, - "/v1/acl/acl/batch_update": { - "options": { - "operationId": "optionsAclBatchUpdate", - "description": "Enable CORS", - "summary": "Enable CORS (`/v1/acl/acl/batch_update`)", - "security": [], + "/v1/agent/{agent_id}": { + "get": { + "operationId": "getAgentId", "tags": [ - "CORS" + "Agents" + ], + "description": "Get a agent object by its id", + "summary": "Get agent", + "security": [ + { + "bearerAuth": [] + }, + {} + ], + "parameters": [ + { + "$ref": "#/components/parameters/AgentIdParam" + } ], "responses": { "200": { - "description": "Response for CORS method", - "headers": { - "Access-Control-Allow-Credentials": { + "description": "Returns the agent object", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/Agent" } - }, - "Access-Control-Allow-Headers": { + } + } + }, + "400": { + "description": "The request was unacceptable, often due to missing a required parameter", + "content": { + "text/plain": { "schema": { "type": "string" } }, - "Access-Control-Allow-Methods": { + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "401": { + "description": "No valid API key provided", + "content": { + "text/plain": { "schema": { "type": "string" } }, - "Access-Control-Allow-Origin": { + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "403": { + "description": "The API key doesn’t have permissions to perform the request", + "content": { + "text/plain": { "schema": { "type": "string" } }, - "Access-Control-Max-Age": { + "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": {} + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "nullable": true + } + } + } }, - "400": { - "description": "The request was unacceptable, often due to missing a required parameter", + "500": { + "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { @@ -20596,16 +23698,14 @@ } } } - } - }, - "/v1/user": { - "get": { - "operationId": "getUser", + }, + "patch": { + "operationId": "patchAgentId", "tags": [ - "Users" + "Agents" ], - "description": "List out all users. The users are sorted by creation date, with the most recently-created users coming first", - "summary": "List users", + "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": [] @@ -20614,50 +23714,27 @@ ], "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" + "$ref": "#/components/parameters/AgentIdParam" } ], + "requestBody": { + "description": "Fields to update", + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchAgent" + } + } + } + }, "responses": { "200": { - "description": "Returns a list of user objects", + "description": "Returns the agent object", "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 + "$ref": "#/components/schemas/Agent" } } } @@ -20746,72 +23823,13 @@ } } }, - "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", + "delete": { + "operationId": "deleteAgentId", "tags": [ - "Users" + "Agents" ], - "description": "Get a user object by its id", - "summary": "Get user", + "description": "Delete a agent object by its id", + "summary": "Delete agent", "security": [ { "bearerAuth": [] @@ -20820,16 +23838,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/UserIdParam" + "$ref": "#/components/parameters/AgentIdParam" } ], "responses": { "200": { - "description": "Returns the user object", + "description": "Returns the deleted agent object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/User" + "$ref": "#/components/schemas/Agent" } } } @@ -20919,16 +23937,16 @@ } }, "options": { - "operationId": "optionsUserId", + "operationId": "optionsAgentId", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/user/{user_id}`)", + "summary": "Enable CORS (`/v1/agent/{agent_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/UserIdParam" + "$ref": "#/components/parameters/AgentIdParam" } ], "responses": { @@ -20981,10 +23999,10 @@ } } }, - "/v1/agent": { + "/v1/project_automation": { "post": { "tags": [ - "Agents" + "ProjectAutomations" ], "security": [ { @@ -20992,27 +24010,27 @@ }, {} ], - "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", + "operationId": "postProjectAutomation", + "description": "Create a new project_automation. If there is an existing project_automation with the same name as the one specified in the request, will return the existing project_automation unmodified", + "summary": "Create project_automation", "requestBody": { - "description": "Any desired information about the new agent object", - "required": false, + "description": "Any desired information about the new project_automation object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateAgent" + "$ref": "#/components/schemas/CreateProjectAutomation" } } } }, "responses": { "200": { - "description": "Returns the new agent object", + "description": "Returns the new project_automation object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Agent" + "$ref": "#/components/schemas/ProjectAutomation" } } } @@ -21103,7 +24121,7 @@ }, "put": { "tags": [ - "Agents" + "ProjectAutomations" ], "security": [ { @@ -21111,27 +24129,27 @@ }, {} ], - "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", + "operationId": "putProjectAutomation", + "description": "Create or replace project_automation. If there is an existing project_automation with the same name as the one specified in the request, will replace the existing project_automation with the provided fields", + "summary": "Create or replace project_automation", "requestBody": { - "description": "Any desired information about the new agent object", - "required": false, + "description": "Any desired information about the new project_automation object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateAgent" + "$ref": "#/components/schemas/CreateProjectAutomation" } } } }, "responses": { "200": { - "description": "Returns the new agent object", + "description": "Returns the new project_automation object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Agent" + "$ref": "#/components/schemas/ProjectAutomation" } } } @@ -21221,12 +24239,12 @@ } }, "get": { - "operationId": "getAgent", + "operationId": "getProjectAutomation", "tags": [ - "Agents" + "ProjectAutomations" ], - "description": "List out all agents. The agents are sorted by creation date, with the most recently-created agents coming first", - "summary": "List agents", + "description": "List out all project_automations. The project_automations are sorted by creation date, with the most recently-created project_automations coming first", + "summary": "List project_automations", "security": [ { "bearerAuth": [] @@ -21247,7 +24265,7 @@ "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/AgentName" + "$ref": "#/components/parameters/ProjectAutomationName" }, { "$ref": "#/components/parameters/OrgName" @@ -21255,7 +24273,7 @@ ], "responses": { "200": { - "description": "Returns a list of agent objects", + "description": "Returns a list of project_automation objects", "content": { "application/json": { "schema": { @@ -21264,9 +24282,9 @@ "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/Agent" + "$ref": "#/components/schemas/ProjectAutomation" }, - "description": "A list of agent objects" + "description": "A list of project_automation objects" } }, "required": [ @@ -21362,9 +24380,9 @@ } }, "options": { - "operationId": "optionsAgent", + "operationId": "optionsProjectAutomation", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/agent`)", + "summary": "Enable CORS (`/v1/project_automation`)", "security": [], "tags": [ "CORS" @@ -21419,14 +24437,14 @@ } } }, - "/v1/agent/{agent_id}": { + "/v1/project_automation/{project_automation_id}": { "get": { - "operationId": "getAgentId", + "operationId": "getProjectAutomationId", "tags": [ - "Agents" + "ProjectAutomations" ], - "description": "Get a agent object by its id", - "summary": "Get agent", + "description": "Get a project_automation object by its id", + "summary": "Get project_automation", "security": [ { "bearerAuth": [] @@ -21435,16 +24453,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/AgentIdParam" + "$ref": "#/components/parameters/ProjectAutomationIdParam" } ], "responses": { "200": { - "description": "Returns the agent object", + "description": "Returns the project_automation object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Agent" + "$ref": "#/components/schemas/ProjectAutomation" } } } @@ -21534,12 +24552,12 @@ } }, "patch": { - "operationId": "patchAgentId", + "operationId": "patchProjectAutomationId", "tags": [ - "Agents" + "ProjectAutomations" ], - "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", + "description": "Partially update a project_automation 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 project_automation", "security": [ { "bearerAuth": [] @@ -21548,7 +24566,7 @@ ], "parameters": [ { - "$ref": "#/components/parameters/AgentIdParam" + "$ref": "#/components/parameters/ProjectAutomationIdParam" } ], "requestBody": { @@ -21557,18 +24575,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchAgent" + "$ref": "#/components/schemas/PatchProjectAutomation" } } } }, "responses": { "200": { - "description": "Returns the agent object", + "description": "Returns the project_automation object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Agent" + "$ref": "#/components/schemas/ProjectAutomation" } } } @@ -21658,12 +24676,12 @@ } }, "delete": { - "operationId": "deleteAgentId", + "operationId": "deleteProjectAutomationId", "tags": [ - "Agents" + "ProjectAutomations" ], - "description": "Delete a agent object by its id", - "summary": "Delete agent", + "description": "Delete a project_automation object by its id", + "summary": "Delete project_automation", "security": [ { "bearerAuth": [] @@ -21672,16 +24690,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/AgentIdParam" + "$ref": "#/components/parameters/ProjectAutomationIdParam" } ], "responses": { "200": { - "description": "Returns the deleted agent object", + "description": "Returns the deleted project_automation object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Agent" + "$ref": "#/components/schemas/ProjectAutomation" } } } @@ -21771,16 +24789,16 @@ } }, "options": { - "operationId": "optionsAgentId", + "operationId": "optionsProjectAutomationId", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/agent/{agent_id}`)", + "summary": "Enable CORS (`/v1/project_automation/{project_automation_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/AgentIdParam" + "$ref": "#/components/parameters/ProjectAutomationIdParam" } ], "responses": { @@ -21833,10 +24851,10 @@ } } }, - "/v1/project_automation": { + "/v1/org_automation": { "post": { "tags": [ - "ProjectAutomations" + "OrgAutomations" ], "security": [ { @@ -21844,27 +24862,27 @@ }, {} ], - "operationId": "postProjectAutomation", - "description": "Create a new project_automation. If there is an existing project_automation with the same name as the one specified in the request, will return the existing project_automation unmodified", - "summary": "Create project_automation", + "operationId": "postOrgAutomation", + "description": "Create a new org_automation. If there is an existing org_automation with the same name as the one specified in the request, will return the existing org_automation unmodified", + "summary": "Create org_automation", "requestBody": { - "description": "Any desired information about the new project_automation object", - "required": false, + "description": "Any desired information about the new org_automation object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateProjectAutomation" + "$ref": "#/components/schemas/CreateOrgAutomation" } } } }, "responses": { "200": { - "description": "Returns the new project_automation object", + "description": "Returns the new org_automation object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProjectAutomation" + "$ref": "#/components/schemas/OrgAutomation" } } } @@ -21955,7 +24973,7 @@ }, "put": { "tags": [ - "ProjectAutomations" + "OrgAutomations" ], "security": [ { @@ -21963,27 +24981,27 @@ }, {} ], - "operationId": "putProjectAutomation", - "description": "Create or replace project_automation. If there is an existing project_automation with the same name as the one specified in the request, will replace the existing project_automation with the provided fields", - "summary": "Create or replace project_automation", + "operationId": "putOrgAutomation", + "description": "Create or replace org_automation. If there is an existing org_automation with the same name as the one specified in the request, will replace the existing org_automation with the provided fields", + "summary": "Create or replace org_automation", "requestBody": { - "description": "Any desired information about the new project_automation object", - "required": false, + "description": "Any desired information about the new org_automation object", + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateProjectAutomation" + "$ref": "#/components/schemas/CreateOrgAutomation" } } } }, "responses": { "200": { - "description": "Returns the new project_automation object", + "description": "Returns the new org_automation object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProjectAutomation" + "$ref": "#/components/schemas/OrgAutomation" } } } @@ -22073,12 +25091,12 @@ } }, "get": { - "operationId": "getProjectAutomation", + "operationId": "getOrgAutomation", "tags": [ - "ProjectAutomations" + "OrgAutomations" ], - "description": "List out all project_automations. The project_automations are sorted by creation date, with the most recently-created project_automations coming first", - "summary": "List project_automations", + "description": "List out all org_automations. The org_automations are sorted by creation date, with the most recently-created org_automations coming first", + "summary": "List org_automations", "security": [ { "bearerAuth": [] @@ -22099,7 +25117,7 @@ "$ref": "#/components/parameters/Ids" }, { - "$ref": "#/components/parameters/ProjectAutomationName" + "$ref": "#/components/parameters/OrgAutomationName" }, { "$ref": "#/components/parameters/OrgName" @@ -22107,7 +25125,7 @@ ], "responses": { "200": { - "description": "Returns a list of project_automation objects", + "description": "Returns a list of org_automation objects", "content": { "application/json": { "schema": { @@ -22116,9 +25134,9 @@ "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/ProjectAutomation" + "$ref": "#/components/schemas/OrgAutomation" }, - "description": "A list of project_automation objects" + "description": "A list of org_automation objects" } }, "required": [ @@ -22214,9 +25232,9 @@ } }, "options": { - "operationId": "optionsProjectAutomation", + "operationId": "optionsOrgAutomation", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/project_automation`)", + "summary": "Enable CORS (`/v1/org_automation`)", "security": [], "tags": [ "CORS" @@ -22271,14 +25289,14 @@ } } }, - "/v1/project_automation/{project_automation_id}": { + "/v1/org_automation/{org_automation_id}": { "get": { - "operationId": "getProjectAutomationId", + "operationId": "getOrgAutomationId", "tags": [ - "ProjectAutomations" + "OrgAutomations" ], - "description": "Get a project_automation object by its id", - "summary": "Get project_automation", + "description": "Get a org_automation object by its id", + "summary": "Get org_automation", "security": [ { "bearerAuth": [] @@ -22287,16 +25305,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ProjectAutomationIdParam" + "$ref": "#/components/parameters/OrgAutomationIdParam" } ], "responses": { "200": { - "description": "Returns the project_automation object", + "description": "Returns the org_automation object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProjectAutomation" + "$ref": "#/components/schemas/OrgAutomation" } } } @@ -22386,12 +25404,12 @@ } }, "patch": { - "operationId": "patchProjectAutomationId", + "operationId": "patchOrgAutomationId", "tags": [ - "ProjectAutomations" + "OrgAutomations" ], - "description": "Partially update a project_automation 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 project_automation", + "description": "Partially update a org_automation 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 org_automation", "security": [ { "bearerAuth": [] @@ -22400,7 +25418,7 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ProjectAutomationIdParam" + "$ref": "#/components/parameters/OrgAutomationIdParam" } ], "requestBody": { @@ -22409,18 +25427,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchProjectAutomation" + "$ref": "#/components/schemas/PatchOrgAutomation" } } } }, "responses": { "200": { - "description": "Returns the project_automation object", + "description": "Returns the org_automation object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProjectAutomation" + "$ref": "#/components/schemas/OrgAutomation" } } } @@ -22510,12 +25528,12 @@ } }, "delete": { - "operationId": "deleteProjectAutomationId", + "operationId": "deleteOrgAutomationId", "tags": [ - "ProjectAutomations" + "OrgAutomations" ], - "description": "Delete a project_automation object by its id", - "summary": "Delete project_automation", + "description": "Delete a org_automation object by its id", + "summary": "Delete org_automation", "security": [ { "bearerAuth": [] @@ -22524,16 +25542,16 @@ ], "parameters": [ { - "$ref": "#/components/parameters/ProjectAutomationIdParam" + "$ref": "#/components/parameters/OrgAutomationIdParam" } ], "responses": { "200": { - "description": "Returns the deleted project_automation object", + "description": "Returns the deleted org_automation object", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProjectAutomation" + "$ref": "#/components/schemas/OrgAutomation" } } } @@ -22623,16 +25641,16 @@ } }, "options": { - "operationId": "optionsProjectAutomationId", + "operationId": "optionsOrgAutomationId", "description": "Enable CORS", - "summary": "Enable CORS (`/v1/project_automation/{project_automation_id}`)", + "summary": "Enable CORS (`/v1/org_automation/{org_automation_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { - "$ref": "#/components/parameters/ProjectAutomationIdParam" + "$ref": "#/components/parameters/OrgAutomationIdParam" } ], "responses": { @@ -22701,7 +25719,7 @@ "summary": "Create project_score", "requestBody": { "description": "Any desired information about the new project_score object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -22820,7 +25838,7 @@ "summary": "Create or replace project_score", "requestBody": { "description": "Any desired information about the new project_score object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -23562,7 +26580,7 @@ "summary": "Create project_tag", "requestBody": { "description": "Any desired information about the new project_tag object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -23681,7 +26699,7 @@ "summary": "Create or replace project_tag", "requestBody": { "description": "Any desired information about the new project_tag object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -24420,7 +27438,7 @@ "summary": "Create span_iframe", "requestBody": { "description": "Any desired information about the new span_iframe object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -24539,7 +27557,7 @@ "summary": "Create or replace span_iframe", "requestBody": { "description": "Any desired information about the new span_iframe object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -25272,7 +28290,7 @@ "summary": "Create function", "requestBody": { "description": "Any desired information about the new function object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -25391,7 +28409,7 @@ "summary": "Create or replace function", "requestBody": { "description": "Any desired information about the new function object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -26250,7 +29268,7 @@ "summary": "Create view", "requestBody": { "description": "Any desired information about the new view object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -26369,7 +29387,7 @@ "summary": "Create or replace view", "requestBody": { "description": "Any desired information about the new view object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -26818,7 +29836,7 @@ ], "requestBody": { "description": "Fields to update", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -26942,7 +29960,7 @@ ], "requestBody": { "description": "Additional parameters for the delete operation", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -28291,7 +31309,7 @@ "summary": "Create service_token", "requestBody": { "description": "Any desired information about the new service_token object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -28309,6 +31327,13 @@ "service_account_id": { "type": "string", "description": "The ID of the service account to which the token should belong. To create a service account, visit [**Settings > Service tokens**](https://www.braintrust.dev/app/~/configuration/org/service-tokens) in the Braintrust UI or call [`PATCH /v1/organization/members`](https://www.braintrust.dev/docs/api-reference/organizations/modify-organization-membership)." + }, + "expires_in_seconds": { + "type": "integer", + "nullable": true, + "minimum": 0, + "exclusiveMinimum": true, + "description": "Number of seconds from now after which the service token should expire. If omitted, the token never expires." } }, "required": [ @@ -28429,7 +31454,7 @@ "summary": "Create or replace service_token", "requestBody": { "description": "Any desired information about the new service_token object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -28447,6 +31472,13 @@ "service_account_id": { "type": "string", "description": "The ID of the service account to which the token should belong. To create a service account, visit [**Settings > Service tokens**](https://www.braintrust.dev/app/~/configuration/org/service-tokens) in the Braintrust UI or call [`PATCH /v1/organization/members`](https://www.braintrust.dev/docs/api-reference/organizations/modify-organization-membership)." + }, + "expires_in_seconds": { + "type": "integer", + "nullable": true, + "minimum": 0, + "exclusiveMinimum": true, + "description": "Number of seconds from now after which the service token should expire. If omitted, the token never expires." } }, "required": [ @@ -28552,6 +31584,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": 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": [ @@ -29057,7 +32208,7 @@ "summary": "Create ai_secret", "requestBody": { "description": "Any desired information about the new ai_secret object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -29176,7 +32327,7 @@ "summary": "Create or replace ai_secret", "requestBody": { "description": "Any desired information about the new ai_secret object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -29280,6 +32431,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": true, + "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": [ @@ -29912,7 +33182,7 @@ "summary": "Create env_var", "requestBody": { "description": "Any desired information about the new env_var object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -30074,7 +33344,7 @@ "summary": "Create or replace env_var", "requestBody": { "description": "Any desired information about the new env_var object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -30551,7 +33821,7 @@ ], "requestBody": { "description": "Fields to update", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -30874,7 +34144,7 @@ "summary": "Create mcp_server", "requestBody": { "description": "Any desired information about the new mcp_server object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -30993,7 +34263,7 @@ "summary": "Create or replace mcp_server", "requestBody": { "description": "Any desired information about the new mcp_server object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -31726,7 +34996,7 @@ "summary": "Create dataset_snapshot", "requestBody": { "description": "Any desired information about the new dataset_snapshot object", - "required": false, + "required": true, "content": { "application/json": { "schema": { @@ -31845,7 +35115,7 @@ "summary": "Create or replace dataset_snapshot", "requestBody": { "description": "Any desired information about the new dataset_snapshot object", - "required": false, + "required": true, "content": { "application/json": { "schema": { diff --git a/py/src/braintrust/api/_generated/__init__.py b/py/src/braintrust/api/_generated/__init__.py index e6768440..1f3ec4ba 100644 --- a/py/src/braintrust/api/_generated/__init__.py +++ b/py/src/braintrust/api/_generated/__init__.py @@ -1,6 +1,6 @@ # Generated by scripts/generate-api-client.py. DO NOT EDIT. -# OpenAPI commit: 9daf27f19d9e0340304d7a3e7d0edb28380b94c6 -# OpenAPI spec SHA-256: 5ec753c0263c0c44cd04f741edfc7e8bad491cc25a2113d029e84edc076520f0 +# OpenAPI commit: 8d6e24ce78d8e33cbf9ba5f35d2fbc71749306d7 +# OpenAPI spec SHA-256: ebac33c1422e5673f875a254b3f7a13e4d8b5f5ab9b5095fd6b48e836613d507 # datamodel-code-generator: 0.72.4 # ruff: 0.15.21 # Generator Python: 3.14 diff --git a/py/src/braintrust/api/_generated/datasets.py b/py/src/braintrust/api/_generated/datasets.py index 00c6a46e..80292eb6 100644 --- a/py/src/braintrust/api/_generated/datasets.py +++ b/py/src/braintrust/api/_generated/datasets.py @@ -1,10 +1,10 @@ # Generated by scripts/generate-api-client.py. DO NOT EDIT. -# OpenAPI commit: 9daf27f19d9e0340304d7a3e7d0edb28380b94c6 -# OpenAPI spec SHA-256: 5ec753c0263c0c44cd04f741edfc7e8bad491cc25a2113d029e84edc076520f0 +# OpenAPI commit: 8d6e24ce78d8e33cbf9ba5f35d2fbc71749306d7 +# OpenAPI spec SHA-256: ebac33c1422e5673f875a254b3f7a13e4d8b5f5ab9b5095fd6b48e836613d507 # datamodel-code-generator: 0.72.4 # ruff: 0.15.21 # Generator Python: 3.14 -# Content SHA-256: 39bb40ebc26c57f57f09d2a309b8bb6702b737b0d6dbd07a1faca97e7ea5be56 +# Content SHA-256: 2ef2df01ea3035c9361fdc45725fc3b27a1772e6362eb14c55b4da7ff96262bc """Generated Datasets REST operations and resource.""" @@ -318,7 +318,7 @@ class DatasetsAPI(ResourceAPI): def post_dataset( self, *, - body: "CreateDataset | None" = None, + body: "CreateDataset", ) -> "Dataset": return cast( "Dataset", @@ -400,7 +400,7 @@ def post_dataset_id_insert( self, dataset_id: "DatasetIdParam", *, - body: "InsertDatasetEventRequest | None" = None, + body: "InsertDatasetEventRequest", ) -> "InsertEventsResponse": return cast( "InsertEventsResponse", @@ -453,7 +453,7 @@ def post_dataset_id_feedback( self, dataset_id: "DatasetIdParam", *, - body: "FeedbackDatasetEventRequest | None" = None, + body: "FeedbackDatasetEventRequest", ) -> "FeedbackResponseSchema": return cast( "FeedbackResponseSchema", diff --git a/py/src/braintrust/api/_generated/experiments.py b/py/src/braintrust/api/_generated/experiments.py index 7623e5c2..52584e61 100644 --- a/py/src/braintrust/api/_generated/experiments.py +++ b/py/src/braintrust/api/_generated/experiments.py @@ -1,10 +1,10 @@ # Generated by scripts/generate-api-client.py. DO NOT EDIT. -# OpenAPI commit: 9daf27f19d9e0340304d7a3e7d0edb28380b94c6 -# OpenAPI spec SHA-256: 5ec753c0263c0c44cd04f741edfc7e8bad491cc25a2113d029e84edc076520f0 +# OpenAPI commit: 8d6e24ce78d8e33cbf9ba5f35d2fbc71749306d7 +# OpenAPI spec SHA-256: ebac33c1422e5673f875a254b3f7a13e4d8b5f5ab9b5095fd6b48e836613d507 # datamodel-code-generator: 0.72.4 # ruff: 0.15.21 # Generator Python: 3.14 -# Content SHA-256: 539406e3c181decdc8f29755e5b60d79b61798b27371fa34cd905f1542671985 +# Content SHA-256: a3a944dbc3203812c4d9f566f7719bfa986680ccee6a2429005dac87045b4563 """Generated Experiments REST operations and resource.""" @@ -325,7 +325,7 @@ class ExperimentsAPI(ResourceAPI): def post_experiment( self, *, - body: "CreateExperiment | None" = None, + body: "CreateExperiment", ) -> "Experiment": return cast( "Experiment", @@ -407,7 +407,7 @@ def post_experiment_id_insert( self, experiment_id: "ExperimentIdParam", *, - body: "InsertExperimentEventRequest | None" = None, + body: "InsertExperimentEventRequest", ) -> "InsertEventsResponse": return cast( "InsertEventsResponse", @@ -460,7 +460,7 @@ def post_experiment_id_feedback( self, experiment_id: "ExperimentIdParam", *, - body: "FeedbackExperimentEventRequest | None" = None, + body: "FeedbackExperimentEventRequest", ) -> "FeedbackResponseSchema": return cast( "FeedbackResponseSchema", diff --git a/py/src/braintrust/api/_generated/models/__init__.py b/py/src/braintrust/api/_generated/models/__init__.py index 20fffd21..5006f61a 100644 --- a/py/src/braintrust/api/_generated/models/__init__.py +++ b/py/src/braintrust/api/_generated/models/__init__.py @@ -1,6 +1,6 @@ # Generated by scripts/generate-api-client.py. DO NOT EDIT. -# OpenAPI commit: 9daf27f19d9e0340304d7a3e7d0edb28380b94c6 -# OpenAPI spec SHA-256: 5ec753c0263c0c44cd04f741edfc7e8bad491cc25a2113d029e84edc076520f0 +# OpenAPI commit: 8d6e24ce78d8e33cbf9ba5f35d2fbc71749306d7 +# OpenAPI spec SHA-256: ebac33c1422e5673f875a254b3f7a13e4d8b5f5ab9b5095fd6b48e836613d507 # datamodel-code-generator: 0.72.4 # ruff: 0.15.21 # Generator Python: 3.14 diff --git a/py/src/braintrust/api/_generated/models/common.py b/py/src/braintrust/api/_generated/models/common.py index 0175de4b..3035db86 100644 --- a/py/src/braintrust/api/_generated/models/common.py +++ b/py/src/braintrust/api/_generated/models/common.py @@ -1,6 +1,6 @@ # Generated by scripts/generate-api-client.py. DO NOT EDIT. -# OpenAPI commit: 9daf27f19d9e0340304d7a3e7d0edb28380b94c6 -# OpenAPI spec SHA-256: 5ec753c0263c0c44cd04f741edfc7e8bad491cc25a2113d029e84edc076520f0 +# OpenAPI commit: 8d6e24ce78d8e33cbf9ba5f35d2fbc71749306d7 +# OpenAPI spec SHA-256: ebac33c1422e5673f875a254b3f7a13e4d8b5f5ab9b5095fd6b48e836613d507 # datamodel-code-generator: 0.72.4 # ruff: 0.15.21 # Generator Python: 3.14 diff --git a/py/src/braintrust/api/_generated/models/datasets.py b/py/src/braintrust/api/_generated/models/datasets.py index a6a17fab..4f430aa6 100644 --- a/py/src/braintrust/api/_generated/models/datasets.py +++ b/py/src/braintrust/api/_generated/models/datasets.py @@ -1,6 +1,6 @@ # Generated by scripts/generate-api-client.py. DO NOT EDIT. -# OpenAPI commit: 9daf27f19d9e0340304d7a3e7d0edb28380b94c6 -# OpenAPI spec SHA-256: 5ec753c0263c0c44cd04f741edfc7e8bad491cc25a2113d029e84edc076520f0 +# OpenAPI commit: 8d6e24ce78d8e33cbf9ba5f35d2fbc71749306d7 +# OpenAPI spec SHA-256: ebac33c1422e5673f875a254b3f7a13e4d8b5f5ab9b5095fd6b48e836613d507 # datamodel-code-generator: 0.72.4 # ruff: 0.15.21 # Generator Python: 3.14 diff --git a/py/src/braintrust/api/_generated/models/experiments.py b/py/src/braintrust/api/_generated/models/experiments.py index 39eb30c6..a295f24e 100644 --- a/py/src/braintrust/api/_generated/models/experiments.py +++ b/py/src/braintrust/api/_generated/models/experiments.py @@ -1,6 +1,6 @@ # Generated by scripts/generate-api-client.py. DO NOT EDIT. -# OpenAPI commit: 9daf27f19d9e0340304d7a3e7d0edb28380b94c6 -# OpenAPI spec SHA-256: 5ec753c0263c0c44cd04f741edfc7e8bad491cc25a2113d029e84edc076520f0 +# OpenAPI commit: 8d6e24ce78d8e33cbf9ba5f35d2fbc71749306d7 +# OpenAPI spec SHA-256: ebac33c1422e5673f875a254b3f7a13e4d8b5f5ab9b5095fd6b48e836613d507 # datamodel-code-generator: 0.72.4 # ruff: 0.15.21 # Generator Python: 3.14 diff --git a/py/src/braintrust/api/_generated/models/projects.py b/py/src/braintrust/api/_generated/models/projects.py index 0f744ee4..6468be82 100644 --- a/py/src/braintrust/api/_generated/models/projects.py +++ b/py/src/braintrust/api/_generated/models/projects.py @@ -1,10 +1,10 @@ # Generated by scripts/generate-api-client.py. DO NOT EDIT. -# OpenAPI commit: 9daf27f19d9e0340304d7a3e7d0edb28380b94c6 -# OpenAPI spec SHA-256: 5ec753c0263c0c44cd04f741edfc7e8bad491cc25a2113d029e84edc076520f0 +# OpenAPI commit: 8d6e24ce78d8e33cbf9ba5f35d2fbc71749306d7 +# OpenAPI spec SHA-256: ebac33c1422e5673f875a254b3f7a13e4d8b5f5ab9b5095fd6b48e836613d507 # datamodel-code-generator: 0.72.4 # ruff: 0.15.21 # Generator Python: 3.14 -# Content SHA-256: 7f255d8bb302ac26b6281a82889c8108c5a8f65cc4b9f748eb47919dcf89d947 +# Content SHA-256: c31f920240f9bc3c3f3c225ca78b62abfaed5892c1fd3eedf11f231ef7e2d83e from typing import Any, Literal, TypeAlias, TypedDict from typing_extensions import NotRequired @@ -72,6 +72,10 @@ class ProjectSettings(TypedDict): """ The id of the experiment to use as the default baseline for comparisons """ + blind_reviews: NotRequired[bool | None] + """ + If true, hide peer review scores, comments, and aggregate results from reviewers without project update permissions until they submit their own review. + """ comparison_key: NotRequired[str | None] """ The key used to join two experiments (defaults to `input`) @@ -81,6 +85,10 @@ class ProjectSettings(TypedDict): """ If true, disable real-time queries for this project. This can improve query performance for high-volume logs. """ + monitor_charts_use_metrics_start: NotRequired[bool | None] + """ + If true, use metrics.start rather than created for monitor chart time bucket dimensions. + """ remote_eval_sources: NotRequired[Sequence[RemoteEvalSource] | None] """ The remote eval sources to use for the project diff --git a/py/src/braintrust/api/_generated/projects.py b/py/src/braintrust/api/_generated/projects.py index e29d3899..621081bd 100644 --- a/py/src/braintrust/api/_generated/projects.py +++ b/py/src/braintrust/api/_generated/projects.py @@ -1,10 +1,10 @@ # Generated by scripts/generate-api-client.py. DO NOT EDIT. -# OpenAPI commit: 9daf27f19d9e0340304d7a3e7d0edb28380b94c6 -# OpenAPI spec SHA-256: 5ec753c0263c0c44cd04f741edfc7e8bad491cc25a2113d029e84edc076520f0 +# OpenAPI commit: 8d6e24ce78d8e33cbf9ba5f35d2fbc71749306d7 +# OpenAPI spec SHA-256: ebac33c1422e5673f875a254b3f7a13e4d8b5f5ab9b5095fd6b48e836613d507 # datamodel-code-generator: 0.72.4 # ruff: 0.15.21 # Generator Python: 3.14 -# Content SHA-256: 13bc46e7fff061668546a7e3b807764115580449165934413a88d381a2091675 +# Content SHA-256: af02a43ff12855234f1d45dc636fa0b66579dfb9e823a1aab9c08905407bd12c """Generated Projects REST operations and resource.""" @@ -149,7 +149,7 @@ class ProjectsAPI(ResourceAPI): def post_project( self, *, - body: "CreateProject | None" = None, + body: "CreateProject", ) -> "Project": return cast( "Project",