{"openapi": "3.1.0", "info": {"title": "AI Prompt Bucket API", "version": "1.0.0", "description": "AI Prompt Bucket \u2014 Managed prompt registry for small teams"}, "paths": {"/api/": {"get": {"operationId": "api_main_api_root", "summary": "API Root", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/APIRootResponse"}}}}}, "description": "API root endpoint with version information"}}, "/api/v1/health": {"get": {"operationId": "api_v1_router_health_check", "summary": "Health Check", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HealthResponse"}}}}}, "description": "Simple health check endpoint", "tags": ["v1"]}}, "/api/v1/prompts/": {"get": {"operationId": "api_v1_prompts_list_prompts", "summary": "List prompts", "parameters": [{"in": "query", "name": "tag", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tag"}, "required": false}, {"in": "query", "name": "search", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Search"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/PromptListOut"}, "title": "Response", "type": "array"}}}}}, "tags": ["Prompts"], "security": [{"ApiKeyAuth": []}]}, "post": {"operationId": "api_v1_prompts_create_prompt", "summary": "Create prompt", "parameters": [], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PromptOut"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Prompts"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PromptCreateIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}}, "/api/v1/prompts/{slug}": {"get": {"operationId": "api_v1_prompts_get_prompt", "summary": "Get prompt", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PromptOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Prompts"], "security": [{"ApiKeyAuth": []}]}, "put": {"operationId": "api_v1_prompts_update_prompt", "summary": "Update prompt metadata", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PromptOut"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Prompts"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PromptUpdateIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}, "delete": {"operationId": "api_v1_prompts_delete_prompt", "summary": "Delete prompt", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"204": {"description": "No Content"}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Prompts"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/prompts/{slug}/versions": {"get": {"operationId": "api_v1_prompts_list_versions", "summary": "List versions", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/PromptVersionOut"}, "title": "Response", "type": "array"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Prompts"], "security": [{"ApiKeyAuth": []}]}, "post": {"operationId": "api_v1_prompts_create_version", "summary": "Create version", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PromptVersionOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Prompts"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/VersionCreateIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}}, "/api/v1/prompts/{slug}/versions/{num}": {"get": {"operationId": "api_v1_prompts_get_version", "summary": "Get specific version", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}, {"in": "path", "name": "num", "schema": {"title": "Num", "type": "integer"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PromptVersionOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Prompts"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/prompts/{slug}/render": {"post": {"operationId": "api_v1_prompts_render_prompt", "summary": "Render prompt template", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RenderOut"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Prompts"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/RenderIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}}, "/api/v1/prompts/{slug}/promote": {"post": {"operationId": "api_v1_prompts_promote_version", "summary": "Assign label to a version", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PromptOut"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Prompts"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PromoteIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}}, "/api/v1/prompts/{slug}/rollback": {"post": {"operationId": "api_v1_prompts_rollback_version", "summary": "Rollback label to previous version", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PromptOut"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Prompts"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/RollbackIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}}, "/api/v1/prompts/{slug}/health": {"get": {"operationId": "api_v1_prompts_get_health_score", "summary": "Get prompt health score", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HealthScoreOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Prompts"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/prompts/{slug}/health/refresh": {"post": {"operationId": "api_v1_prompts_refresh_health_score", "summary": "Recompute prompt health score", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HealthScoreOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Prompts"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/labels/": {"get": {"operationId": "api_v1_labels_list_labels", "summary": "List team labels", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/TeamLabelOut"}, "title": "Response", "type": "array"}}}}}, "tags": ["Labels"], "security": [{"ApiKeyAuth": []}]}, "post": {"operationId": "api_v1_labels_create_label", "summary": "Create team label", "parameters": [], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TeamLabelOut"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Labels"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/TeamLabelCreateIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}}, "/api/v1/labels/{name}": {"delete": {"operationId": "api_v1_labels_delete_label", "summary": "Delete team label", "parameters": [{"in": "path", "name": "name", "schema": {"title": "Name", "type": "string"}, "required": true}], "responses": {"204": {"description": "No Content"}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Labels"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/labels/prompts/{slug}": {"get": {"operationId": "api_v1_labels_list_prompt_labels", "summary": "List labels for a prompt", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/PromptLabelOut"}, "title": "Response", "type": "array"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Labels"], "security": [{"ApiKeyAuth": []}]}, "post": {"operationId": "api_v1_labels_assign_label", "summary": "Assign label to a prompt version", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PromptLabelOut"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Labels"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/AssignLabelIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}}, "/api/v1/labels/prompts/{slug}/impact": {"get": {"operationId": "api_v1_labels_impact_analysis", "summary": "Analyze impact of changing a prompt", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ImpactOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Labels"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/analysis/": {"get": {"operationId": "api_v1_analysis_list_analysis", "summary": "List analysis results", "parameters": [{"in": "query", "name": "limit", "schema": {"default": 5, "title": "Limit", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/AnalysisResultOut"}, "title": "Response", "type": "array"}}}}}, "tags": ["Analysis"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/analysis/run": {"post": {"operationId": "api_v1_analysis_run_analysis_endpoint", "summary": "Run new analysis", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AnalysisResultOut"}}}}}, "tags": ["Analysis"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/action-items/": {"get": {"operationId": "api_v1_action_items_list_action_items", "summary": "List action items", "parameters": [{"in": "query", "name": "status", "schema": {"default": "open", "title": "Status", "type": "string"}, "required": false}, {"in": "query", "name": "severity", "schema": {"default": "", "title": "Severity", "type": "string"}, "required": false}, {"in": "query", "name": "limit", "schema": {"default": 50, "title": "Limit", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/ActionItemOut"}, "title": "Response", "type": "array"}}}}}, "description": "List action items for the authenticated team, with optional filters.", "tags": ["Action Items"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/action-items/{item_id}/dismiss": {"post": {"operationId": "api_v1_action_items_dismiss_action_item", "summary": "Dismiss an action item", "parameters": [{"in": "path", "name": "item_id", "schema": {"title": "Item Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ActionItemOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Action Items"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/action-items/{item_id}/reopen": {"post": {"operationId": "api_v1_action_items_reopen_action_item", "summary": "Reopen a dismissed action item", "parameters": [{"in": "path", "name": "item_id", "schema": {"title": "Item Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ActionItemOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Action Items"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/exports/": {"get": {"operationId": "api_v1_exports_list_exports", "summary": "List exports", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/ExportOut"}, "title": "Response", "type": "array"}}}}}, "tags": ["Exports"], "security": [{"ApiKeyAuth": []}]}, "post": {"operationId": "api_v1_exports_create_export", "summary": "Request new export", "parameters": [], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExportOut"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Exports"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExportCreateIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}}, "/api/v1/exports/{export_id}/": {"get": {"operationId": "api_v1_exports_get_export", "summary": "Get export details", "parameters": [{"in": "path", "name": "export_id", "schema": {"title": "Export Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExportOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Exports"], "security": [{"ApiKeyAuth": []}]}, "delete": {"operationId": "api_v1_exports_delete_export", "summary": "Delete export", "parameters": [{"in": "path", "name": "export_id", "schema": {"title": "Export Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"additionalProperties": true, "title": "Response", "type": "object"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Exports"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/exports/{export_id}/download/": {"get": {"operationId": "api_v1_exports_download_export", "summary": "Download export file", "parameters": [{"in": "path", "name": "export_id", "schema": {"title": "Export Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK"}}, "tags": ["Exports"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/variables/": {"get": {"operationId": "api_v1_team_variables_list_variables", "summary": "List team variables", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/TeamVariableOut"}, "title": "Response", "type": "array"}}}}}, "tags": ["Variables"], "security": [{"ApiKeyAuth": []}]}, "post": {"operationId": "api_v1_team_variables_create_variable", "summary": "Create team variable", "parameters": [], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TeamVariableOut"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Variables"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/TeamVariableCreateIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}}, "/api/v1/variables/{name}": {"put": {"operationId": "api_v1_team_variables_update_variable", "summary": "Update team variable", "parameters": [{"in": "path", "name": "name", "schema": {"title": "Name", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TeamVariableOut"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Variables"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/TeamVariableUpdateIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}, "delete": {"operationId": "api_v1_team_variables_delete_variable", "summary": "Delete team variable", "parameters": [{"in": "path", "name": "name", "schema": {"title": "Name", "type": "string"}, "required": true}], "responses": {"204": {"description": "No Content"}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Variables"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/prompts/{slug}/test-cases": {"get": {"operationId": "api_v1_test_cases_list_test_cases", "summary": "List test cases for a prompt", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/TestCaseOut"}, "title": "Response", "type": "array"}}}}}, "tags": ["Test Cases"], "security": [{"ApiKeyAuth": []}]}, "post": {"operationId": "api_v1_test_cases_create_test_case", "summary": "Create a test case", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TestCaseOut"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Test Cases"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/TestCaseCreateIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}}, "/api/v1/prompts/{slug}/test-cases/{tc_id}": {"delete": {"operationId": "api_v1_test_cases_delete_test_case", "summary": "Delete a test case", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}, {"in": "path", "name": "tc_id", "schema": {"title": "Tc Id", "type": "string"}, "required": true}], "responses": {"204": {"description": "No Content"}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Test Cases"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/prompts/{slug}/test-cases/run": {"post": {"operationId": "api_v1_test_cases_run_test_cases", "summary": "Run all test cases for a prompt", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}, {"in": "query", "name": "label", "schema": {"default": "latest", "title": "Label", "type": "string"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TestCaseRunAllOut"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Test Cases"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/teams/": {"get": {"operationId": "api_v1_teams_list_teams", "summary": "List teams", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/TeamOut"}, "title": "Response", "type": "array"}}}}}, "description": "List teams for the authenticated API key.", "tags": ["Teams"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/teams/{slug}/": {"patch": {"operationId": "api_v1_teams_update_team", "summary": "Update team name", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TeamOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "tags": ["Teams"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/TeamUpdateIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}}, "/api/v1/teams/{slug}/api-keys/": {"get": {"operationId": "api_v1_team_api_keys_list_api_keys", "summary": "List API keys", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/APIKeyOut"}, "title": "Response", "type": "array"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "List active API keys for a team.", "tags": ["API Keys"], "security": [{"ApiKeyAuth": []}]}, "post": {"operationId": "api_v1_team_api_keys_create_api_key", "summary": "Create API key", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/APIKeyCreatedOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Create a new API key for a team.", "tags": ["API Keys"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/APIKeyCreateIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}}, "/api/v1/teams/{slug}/api-keys/{key_uuid}/": {"delete": {"operationId": "api_v1_team_api_keys_revoke_api_key", "summary": "Revoke API key", "parameters": [{"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}, {"in": "path", "name": "key_uuid", "schema": {"title": "Key Uuid", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "Revoke an API key (soft delete).", "tags": ["API Keys"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/admin/users/{email}/teams/": {"get": {"operationId": "api_v1_admin_api_list_user_teams", "summary": "List user's teams (superuser)", "parameters": [{"in": "path", "name": "email", "schema": {"title": "Email", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/UserTeamOut"}, "title": "Response", "type": "array"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "List all teams for a user (superuser only).", "tags": ["Admin"], "security": [{"ApiKeyAuth": []}]}}, "/api/v1/admin/users/{email}/teams/{slug}/api-keys/": {"get": {"operationId": "api_v1_admin_api_list_user_team_api_keys", "summary": "List user's team API keys (superuser)", "parameters": [{"in": "path", "name": "email", "schema": {"title": "Email", "type": "string"}, "required": true}, {"in": "path", "name": "slug", "schema": {"title": "Slug", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/APIKeyOut"}, "title": "Response", "type": "array"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorOut"}}}}}, "description": "List API keys for a user's team (superuser only).", "tags": ["Admin"], "security": [{"ApiKeyAuth": []}]}}}, "components": {"schemas": {"APIRootResponse": {"properties": {"message": {"description": "Welcome message", "title": "Message", "type": "string"}, "versions": {"additionalProperties": {"type": "string"}, "description": "Available API versions", "title": "Versions", "type": "object"}, "documentation": {"description": "Documentation URL", "title": "Documentation", "type": "string"}, "openapi_schema": {"description": "OpenAPI schema URL", "title": "Openapi Schema", "type": "string"}}, "required": ["message", "versions", "documentation", "openapi_schema"], "title": "APIRootResponse", "type": "object"}, "HealthResponse": {"properties": {"status": {"description": "API health status", "title": "Status", "type": "string"}, "version": {"description": "API version", "title": "Version", "type": "string"}, "timestamp": {"description": "Current timestamp", "title": "Timestamp", "type": "string"}}, "required": ["status", "version", "timestamp"], "title": "HealthResponse", "type": "object"}, "PromptListOut": {"properties": {"id": {"title": "Id", "type": "string"}, "slug": {"title": "Slug", "type": "string"}, "name": {"title": "Name", "type": "string"}, "description": {"title": "Description", "type": "string"}, "tags": {"items": {"type": "string"}, "title": "Tags", "type": "array"}, "version_count": {"title": "Version Count", "type": "integer"}, "updated_at": {"title": "Updated At", "type": "string"}}, "required": ["id", "slug", "name", "description", "tags", "version_count", "updated_at"], "title": "PromptListOut", "type": "object"}, "LabelOut": {"properties": {"label_name": {"title": "Label Name", "type": "string"}, "version_number": {"title": "Version Number", "type": "integer"}, "is_system": {"title": "Is System", "type": "boolean"}, "updated_at": {"title": "Updated At", "type": "string"}}, "required": ["label_name", "version_number", "is_system", "updated_at"], "title": "LabelOut", "type": "object"}, "PromptOut": {"properties": {"id": {"title": "Id", "type": "string"}, "slug": {"title": "Slug", "type": "string"}, "name": {"title": "Name", "type": "string"}, "description": {"title": "Description", "type": "string"}, "tags": {"items": {"type": "string"}, "title": "Tags", "type": "array"}, "variable_schema": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Variable Schema"}, "parent_prompt_slug": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Parent Prompt Slug"}, "version_count": {"title": "Version Count", "type": "integer"}, "labels": {"items": {"$ref": "#/components/schemas/LabelOut"}, "title": "Labels", "type": "array"}, "created_at": {"title": "Created At", "type": "string"}, "updated_at": {"title": "Updated At", "type": "string"}}, "required": ["id", "slug", "name", "description", "tags", "version_count", "created_at", "updated_at"], "title": "PromptOut", "type": "object"}, "ErrorOut": {"properties": {"detail": {"title": "Detail", "type": "string"}}, "required": ["detail"], "title": "ErrorOut", "type": "object"}, "PromptCreateIn": {"properties": {"name": {"maxLength": 200, "minLength": 1, "title": "Name", "type": "string"}, "slug": {"anyOf": [{"maxLength": 200, "pattern": "^[a-z0-9][-a-z0-9]*$", "type": "string"}, {"type": "null"}], "title": "Slug"}, "description": {"default": "", "title": "Description", "type": "string"}, "tags": {"items": {"type": "string"}, "title": "Tags", "type": "array"}, "template_text": {"description": "Initial template content", "title": "Template Text", "type": "string"}, "change_note": {"default": "Initial version", "title": "Change Note", "type": "string"}, "variable_schema": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Variable Schema"}, "parent_prompt_slug": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Parent Prompt Slug"}}, "required": ["name", "template_text"], "title": "PromptCreateIn", "type": "object"}, "PromptUpdateIn": {"properties": {"name": {"anyOf": [{"maxLength": 200, "type": "string"}, {"type": "null"}], "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "tags": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Tags"}, "variable_schema": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Variable Schema"}}, "title": "PromptUpdateIn", "type": "object"}, "PromptVersionOut": {"properties": {"id": {"title": "Id", "type": "string"}, "version_number": {"title": "Version Number", "type": "integer"}, "template_text": {"title": "Template Text", "type": "string"}, "change_note": {"title": "Change Note", "type": "string"}, "created_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Created By"}, "created_at": {"title": "Created At", "type": "string"}}, "required": ["id", "version_number", "template_text", "change_note", "created_at"], "title": "PromptVersionOut", "type": "object"}, "VersionCreateIn": {"properties": {"template_text": {"description": "Template content", "title": "Template Text", "type": "string"}, "change_note": {"default": "", "title": "Change Note", "type": "string"}}, "required": ["template_text"], "title": "VersionCreateIn", "type": "object"}, "RenderOut": {"properties": {"rendered_text": {"title": "Rendered Text", "type": "string"}, "token_estimate": {"title": "Token Estimate", "type": "integer"}, "version_number": {"title": "Version Number", "type": "integer"}, "label": {"title": "Label", "type": "string"}, "requested_label": {"title": "Requested Label", "type": "string"}, "resolution_source": {"title": "Resolution Source", "type": "string"}}, "required": ["rendered_text", "token_estimate", "version_number", "label", "requested_label", "resolution_source"], "title": "RenderOut", "type": "object"}, "RenderIn": {"properties": {"label": {"default": "latest", "description": "Label name to resolve version", "title": "Label", "type": "string"}, "fallback_labels": {"description": "Ordered labels to try if the primary label is missing", "items": {"type": "string"}, "title": "Fallback Labels", "type": "array"}, "allow_latest_version_fallback": {"default": true, "description": "If true, fall back to the most recent version when labels are unavailable", "title": "Allow Latest Version Fallback", "type": "boolean"}, "variables": {"additionalProperties": {"type": "string"}, "title": "Variables", "type": "object"}}, "title": "RenderIn", "type": "object"}, "PromoteIn": {"properties": {"version": {"description": "Version number to promote", "title": "Version", "type": "integer"}, "label": {"description": "Label to assign", "title": "Label", "type": "string"}}, "required": ["version", "label"], "title": "PromoteIn", "type": "object"}, "RollbackIn": {"properties": {"label": {"description": "Label to rollback", "title": "Label", "type": "string"}}, "required": ["label"], "title": "RollbackIn", "type": "object"}, "HealthScoreOut": {"properties": {"overall_grade": {"title": "Overall Grade", "type": "string"}, "overall_score": {"title": "Overall Score", "type": "integer"}, "completeness_score": {"title": "Completeness Score", "type": "integer"}, "maintenance_score": {"title": "Maintenance Score", "type": "integer"}, "deployment_score": {"title": "Deployment Score", "type": "integer"}, "coverage_score": {"title": "Coverage Score", "type": "integer"}, "detail": {"additionalProperties": true, "title": "Detail", "type": "object"}, "computed_at": {"title": "Computed At", "type": "string"}}, "required": ["overall_grade", "overall_score", "completeness_score", "maintenance_score", "deployment_score", "coverage_score", "detail", "computed_at"], "title": "HealthScoreOut", "type": "object"}, "TeamLabelOut": {"properties": {"id": {"title": "Id", "type": "string"}, "name": {"title": "Name", "type": "string"}, "is_protected": {"title": "Is Protected", "type": "boolean"}, "is_system": {"title": "Is System", "type": "boolean"}, "description": {"title": "Description", "type": "string"}, "created_at": {"title": "Created At", "type": "string"}}, "required": ["id", "name", "is_protected", "is_system", "description", "created_at"], "title": "TeamLabelOut", "type": "object"}, "TeamLabelCreateIn": {"properties": {"name": {"maxLength": 100, "minLength": 1, "pattern": "^[a-z0-9][-a-z0-9]*$", "title": "Name", "type": "string"}, "is_protected": {"default": false, "title": "Is Protected", "type": "boolean"}, "description": {"default": "", "title": "Description", "type": "string"}}, "required": ["name"], "title": "TeamLabelCreateIn", "type": "object"}, "PromptLabelOut": {"properties": {"label_name": {"title": "Label Name", "type": "string"}, "version_number": {"title": "Version Number", "type": "integer"}, "is_system": {"title": "Is System", "type": "boolean"}, "updated_at": {"title": "Updated At", "type": "string"}}, "required": ["label_name", "version_number", "is_system", "updated_at"], "title": "PromptLabelOut", "type": "object"}, "AssignLabelIn": {"properties": {"label": {"description": "Label name to assign", "title": "Label", "type": "string"}, "version": {"description": "Version number to point to", "title": "Version", "type": "integer"}}, "required": ["label", "version"], "title": "AssignLabelIn", "type": "object"}, "ImpactOut": {"properties": {"prompt_slug": {"title": "Prompt Slug", "type": "string"}, "affected_prompts": {"items": {"additionalProperties": true, "type": "object"}, "title": "Affected Prompts", "type": "array"}, "affected_count": {"title": "Affected Count", "type": "integer"}}, "required": ["prompt_slug", "affected_prompts", "affected_count"], "title": "ImpactOut", "type": "object"}, "AnalysisFindingOut": {"properties": {"type": {"title": "Type", "type": "string"}, "severity": {"title": "Severity", "type": "string"}, "message": {"title": "Message", "type": "string"}, "prompt_slugs": {"items": {"type": "string"}, "title": "Prompt Slugs", "type": "array"}, "detail": {"additionalProperties": true, "title": "Detail", "type": "object"}}, "required": ["type", "severity", "message", "prompt_slugs", "detail"], "title": "AnalysisFindingOut", "type": "object"}, "AnalysisResultOut": {"properties": {"id": {"title": "Id", "type": "string"}, "analysis_type": {"title": "Analysis Type", "type": "string"}, "findings": {"items": {"$ref": "#/components/schemas/AnalysisFindingOut"}, "title": "Findings", "type": "array"}, "summary": {"title": "Summary", "type": "string"}, "created_at": {"title": "Created At", "type": "string"}}, "required": ["id", "analysis_type", "findings", "summary", "created_at"], "title": "AnalysisResultOut", "type": "object"}, "ActionItemOut": {"properties": {"id": {"title": "Id", "type": "string"}, "prompt_slug": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Prompt Slug"}, "item_type": {"title": "Item Type", "type": "string"}, "source": {"title": "Source", "type": "string"}, "severity": {"title": "Severity", "type": "string"}, "status": {"title": "Status", "type": "string"}, "title": {"title": "Title", "type": "string"}, "description": {"title": "Description", "type": "string"}, "detail": {"additionalProperties": true, "title": "Detail", "type": "object"}, "related_prompts": {"items": {"type": "string"}, "title": "Related Prompts", "type": "array"}, "created_at": {"title": "Created At", "type": "string"}}, "required": ["id", "item_type", "source", "severity", "status", "title", "description", "detail", "related_prompts", "created_at"], "title": "ActionItemOut", "type": "object"}, "ExportOut": {"properties": {"id": {"title": "Id", "type": "string"}, "name": {"title": "Name", "type": "string"}, "status": {"title": "Status", "type": "string"}, "format": {"title": "Format", "type": "string"}, "file_size": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "File Size"}, "error_message": {"default": "", "title": "Error Message", "type": "string"}, "requested_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Requested By"}, "created_at": {"title": "Created At", "type": "string"}, "completed_at": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Completed At"}, "expires_at": {"title": "Expires At", "type": "string"}, "download_url": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Download Url"}}, "required": ["id", "name", "status", "format", "created_at", "expires_at"], "title": "ExportOut", "type": "object"}, "ExportCreateIn": {"properties": {"name": {"maxLength": 200, "minLength": 1, "title": "Name", "type": "string"}, "format": {"default": "json", "title": "Format", "type": "string"}, "include_versions": {"default": true, "title": "Include Versions", "type": "boolean"}, "include_labels": {"default": true, "title": "Include Labels", "type": "boolean"}, "include_health": {"default": false, "title": "Include Health", "type": "boolean"}, "include_analytics": {"default": false, "title": "Include Analytics", "type": "boolean"}}, "required": ["name"], "title": "ExportCreateIn", "type": "object"}, "TeamVariableOut": {"properties": {"id": {"title": "Id", "type": "string"}, "name": {"title": "Name", "type": "string"}, "type": {"title": "Type", "type": "string"}, "description": {"title": "Description", "type": "string"}, "default_value": {"anyOf": [{}, {"type": "null"}], "title": "Default Value"}, "example_value": {"anyOf": [{}, {"type": "null"}], "title": "Example Value"}, "created_at": {"title": "Created At", "type": "string"}, "updated_at": {"title": "Updated At", "type": "string"}}, "required": ["id", "name", "type", "description", "created_at", "updated_at"], "title": "TeamVariableOut", "type": "object"}, "TeamVariableCreateIn": {"properties": {"name": {"maxLength": 100, "minLength": 1, "pattern": "^[a-zA-Z_]\\w*$", "title": "Name", "type": "string"}, "type": {"default": "string", "title": "Type", "type": "string"}, "description": {"default": "", "title": "Description", "type": "string"}, "default_value": {"anyOf": [{}, {"type": "null"}], "title": "Default Value"}, "example_value": {"anyOf": [{}, {"type": "null"}], "title": "Example Value"}}, "required": ["name"], "title": "TeamVariableCreateIn", "type": "object"}, "TeamVariableUpdateIn": {"properties": {"type": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Type"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "default_value": {"anyOf": [{}, {"type": "null"}], "title": "Default Value"}, "example_value": {"anyOf": [{}, {"type": "null"}], "title": "Example Value"}}, "title": "TeamVariableUpdateIn", "type": "object"}, "TestCaseOut": {"properties": {"id": {"title": "Id", "type": "string"}, "name": {"title": "Name", "type": "string"}, "description": {"title": "Description", "type": "string"}, "variables": {"additionalProperties": true, "title": "Variables", "type": "object"}, "expected_contains": {"items": {"type": "string"}, "title": "Expected Contains", "type": "array"}, "created_at": {"title": "Created At", "type": "string"}, "updated_at": {"title": "Updated At", "type": "string"}}, "required": ["id", "name", "description", "variables", "expected_contains", "created_at", "updated_at"], "title": "TestCaseOut", "type": "object"}, "TestCaseCreateIn": {"properties": {"name": {"maxLength": 100, "minLength": 1, "title": "Name", "type": "string"}, "variables": {"additionalProperties": true, "title": "Variables", "type": "object"}, "expected_contains": {"items": {"type": "string"}, "title": "Expected Contains", "type": "array"}, "description": {"default": "", "title": "Description", "type": "string"}}, "required": ["name"], "title": "TestCaseCreateIn", "type": "object"}, "TestCaseRunAllOut": {"properties": {"results": {"items": {"$ref": "#/components/schemas/TestCaseRunResult"}, "title": "Results", "type": "array"}, "summary": {"additionalProperties": true, "title": "Summary", "type": "object"}}, "required": ["results", "summary"], "title": "TestCaseRunAllOut", "type": "object"}, "TestCaseRunResult": {"properties": {"name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "status": {"title": "Status", "type": "string"}, "rendered_text": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Rendered Text"}, "token_estimate": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Token Estimate"}, "version_number": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Version Number"}, "assertion_errors": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Assertion Errors"}, "error": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Error"}}, "required": ["name", "id", "status"], "title": "TestCaseRunResult", "type": "object"}, "TeamOut": {"properties": {"name": {"title": "Name", "type": "string"}, "slug": {"title": "Slug", "type": "string"}, "created_at": {"title": "Created At", "type": "string"}, "owner_email": {"title": "Owner Email", "type": "string"}}, "required": ["name", "slug", "created_at", "owner_email"], "title": "TeamOut", "type": "object"}, "TeamUpdateIn": {"properties": {"name": {"maxLength": 255, "minLength": 1, "title": "Name", "type": "string"}}, "required": ["name"], "title": "TeamUpdateIn", "type": "object"}, "APIKeyOut": {"properties": {"uuid": {"title": "Uuid", "type": "string"}, "description": {"title": "Description", "type": "string"}, "is_prod": {"title": "Is Prod", "type": "boolean"}, "created_at": {"title": "Created At", "type": "string"}}, "required": ["uuid", "description", "is_prod", "created_at"], "title": "APIKeyOut", "type": "object"}, "APIKeyCreatedOut": {"properties": {"uuid": {"title": "Uuid", "type": "string"}, "description": {"title": "Description", "type": "string"}, "is_prod": {"title": "Is Prod", "type": "boolean"}, "created_at": {"title": "Created At", "type": "string"}, "raw_key": {"title": "Raw Key", "type": "string"}}, "required": ["uuid", "description", "is_prod", "created_at", "raw_key"], "title": "APIKeyCreatedOut", "type": "object"}, "APIKeyCreateIn": {"properties": {"description": {"default": "", "title": "Description", "type": "string"}, "is_prod": {"default": false, "title": "Is Prod", "type": "boolean"}}, "title": "APIKeyCreateIn", "type": "object"}, "MessageOut": {"properties": {"uuid": {"title": "Uuid", "type": "string"}, "message": {"title": "Message", "type": "string"}}, "required": ["uuid", "message"], "title": "MessageOut", "type": "object"}, "UserTeamOut": {"properties": {"name": {"title": "Name", "type": "string"}, "slug": {"title": "Slug", "type": "string"}, "role": {"title": "Role", "type": "string"}, "created_at": {"title": "Created At", "type": "string"}}, "required": ["name", "slug", "role", "created_at"], "title": "UserTeamOut", "type": "object"}}, "securitySchemes": {"ApiKeyAuth": {"type": "http", "scheme": "bearer"}}}, "servers": []}