diff --git a/api-reference/agent-templates/list.mdx b/api-reference/agent-templates/list.mdx new file mode 100644 index 0000000..bd6186d --- /dev/null +++ b/api-reference/agent-templates/list.mdx @@ -0,0 +1,4 @@ +--- +title: List Agent Templates +openapi: '/api-reference/openapi/agent-templates.json GET /api/agents/templates' +--- diff --git a/api-reference/openapi/agent-templates.json b/api-reference/openapi/agent-templates.json new file mode 100644 index 0000000..7050f44 --- /dev/null +++ b/api-reference/openapi/agent-templates.json @@ -0,0 +1,129 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Recoup API - Agent Templates", + "description": "Lists agent prompt templates (`GET /api/agents/templates`). Clients use the Recoup API base URL from `servers`.", + "license": { + "name": "MIT" + }, + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://api.recoupable.com" + } + ], + "paths": { + "/api/agents/templates": { + "get": { + "description": "Returns agent prompt templates visible to the **authenticated** caller. The account is resolved from `Authorization: Bearer` or `x-api-key`. Response includes public templates, templates the caller owns, and private templates shared with the caller. Each row includes `is_favourite` for that caller. For **private templates the caller owns**, `shared_emails` lists recipients the template was shared with; for others it is empty.", + "parameters": [], + "security": [ + { + "apiKeyAuth": [] + }, + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "Templates retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AgentTemplate" + } + } + } + } + }, + "401": { + "description": "Missing or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentTemplatesError" + } + } + } + }, + "500": { + "description": "Failed to fetch templates", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentTemplatesError" + } + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer" + }, + "apiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "x-api-key", + "description": "Your Recoup API key. [Learn more](/quickstart#api-keys)." + } + }, + "schemas": { + "AgentTemplate": { + "type": "object", + "description": "A stored agent template row as returned from the API.", + "required": [ + "id", + "title", + "description", + "prompt", + "is_private", + "is_favourite" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "title": { "type": "string" }, + "description": { "type": "string" }, + "prompt": { "type": "string" }, + "tags": { + "type": "array", + "items": { "type": "string" }, + "nullable": true + }, + "creator": { "type": "string", "nullable": true }, + "is_private": { "type": "boolean" }, + "created_at": { "type": "string", "nullable": true }, + "favorites_count": { "type": "integer", "nullable": true }, + "updated_at": { "type": "string", "nullable": true }, + "is_favourite": { + "type": "boolean", + "description": "Whether this template is a favorite for the authenticated caller." + }, + "shared_emails": { + "type": "array", + "items": { "type": "string", "format": "email" }, + "description": "Email addresses for accounts the template is shared with — only populated for **private templates owned by** the authenticated caller; otherwise empty array." + } + } + }, + "AgentTemplatesError": { + "type": "object", + "properties": { + "error": { "type": "string" } + } + } + } + } +} diff --git a/docs.json b/docs.json index fdf0a2c..d574265 100644 --- a/docs.json +++ b/docs.json @@ -229,12 +229,18 @@ "tab": "Agents & Sandboxes", "groups": [ { - "group": "Agent Onboarding", + "group": "Workflows", "pages": [ "api-reference/agents/signup", "api-reference/agents/verify" ] }, + { + "group": "Templates", + "pages": [ + "api-reference/agent-templates/list" + ] + }, { "group": "Agents", "pages": [