{"openapi":"3.1.0","info":{"title":"AnroAgents MCP API","description":"API for managing AI agents on the AnroAgents platform. Use Personal Access Tokens (PAT) for authentication.","version":"1.0.0","contact":{"url":"https://anroagents.com"}},"servers":[{"url":"https://api.anroagents.com/mcp"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Personal Access Token (pat_...)"}},"schemas":{"Agent":{"type":"object","properties":{"agentId":{"type":"string"},"status":{"type":"string","enum":["draft","review","active","disabled"]},"enabled":{"type":"boolean"},"businessName":{"type":"string"},"businessDescription":{"type":"string"},"businessDescriptionI18n":{"type":"object","additionalProperties":{"type":"string"},"description":"Per-language description map, e.g. {\"en\":\"...\",\"ru\":\"...\"}"},"defaultGreeting":{"type":"string"},"defaultLanguage":{"type":"string"},"communicationTone":{"type":"string","enum":["formal","friendly","neutral"]},"businessHours":{"type":"string"},"widgetTitle":{"type":"string"},"escalationRules":{"type":"string"},"restrictions":{"type":"string"},"bookingUrl":{"type":"string"},"calendarEnabled":{"type":"boolean"},"logoKey":{"type":"string","description":"S3 key of the uploaded logo (obtained from POST /uploads)."},"logoUrl":{"type":"string","description":"Read-only presigned URL to fetch the current logo. Expires ~10 minutes after the response."},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"price":{"type":"string"},"description":{"type":"string"}}}},"contacts":{"type":"object","properties":{"website":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"address":{"type":"string"}}},"faq":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"answer":{"type":"string"}}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CreateAgentRequest":{"type":"object","required":["businessName"],"properties":{"businessName":{"type":"string","description":"Name of the business"},"businessDescription":{"type":"string"},"businessDescriptionI18n":{"type":"object","additionalProperties":{"type":"string"},"description":"Per-language description map, e.g. {\"en\":\"...\",\"ru\":\"...\"}"},"defaultGreeting":{"type":"string"},"defaultLanguage":{"type":"string","default":"en"},"communicationTone":{"type":"string","enum":["formal","friendly","neutral"]},"businessHours":{"type":"string"},"widgetTitle":{"type":"string"},"escalationRules":{"type":"string"},"restrictions":{"type":"string"},"bookingUrl":{"type":"string"},"logoKey":{"type":"string","description":"S3 key of a logo image previously uploaded via POST /uploads. Sets the agent logo."},"claimable":{"type":"boolean","description":"Admin only. When true, shows a \"Claim agent\" button on the public chat page so a prospect can take over this demo agent (it transfers to their account). Defaults to false."},"services":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"price":{"type":"string"},"description":{"type":"string"}}}},"contacts":{"type":"object","properties":{"website":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"address":{"type":"string"}}},"faq":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string"},"answer":{"type":"string"}}}},"proactiveTriggers":{"type":"array","maxItems":10,"description":"Rules that auto-open the widget on visitor behavior. Max 10 per agent.","items":{"type":"object","required":["type","priority","frequency","device","action","conditions","enabled"],"properties":{"id":{"type":"string","description":"Optional. Server assigns one if omitted."},"enabled":{"type":"boolean"},"type":{"type":"string","enum":["time_on_page","url_match","exit_intent","returning_visitor","scroll_depth","utm_match","referrer_match","idle"]},"priority":{"type":"integer","minimum":0,"maximum":100,"description":"Higher wins when multiple triggers are eligible simultaneously."},"frequency":{"type":"string","enum":["once_per_session","once_per_visitor","always"]},"device":{"type":"string","enum":["all","desktop","mobile"]},"action":{"type":"string","enum":["open_widget","show_greeting_bubble"]},"cooldownSeconds":{"type":"integer","minimum":60,"maximum":86400,"description":"Required only when frequency=always."},"conditions":{"type":"object","properties":{"urlPattern":{"type":"string","description":"Glob e.g. /pricing*. Required for url_match."},"delaySeconds":{"type":"integer","description":"1..3600 for time_on_page, 5..3600 for idle."},"minVisits":{"type":"integer","minimum":2,"maximum":100,"description":"For returning_visitor."},"scrollPercent":{"type":"integer","minimum":1,"maximum":100,"description":"For scroll_depth."},"utm":{"type":"object","properties":{"source":{"type":"string"},"medium":{"type":"string"},"campaign":{"type":"string"}},"description":"At least one field required for utm_match."},"referrerPattern":{"type":"string","description":"Glob against referrer hostname. Required for referrer_match."}}},"greeting":{"description":"Optional custom greeting shown when this trigger fires. String or localized map.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":{"type":"string"}}]}}}}}},"SuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"data":{}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"string"}}},"KnowledgeFile":{"type":"object","properties":{"fileId":{"type":"string"},"agentId":{"type":"string"},"fileName":{"type":"string"},"fileType":{"type":"string"},"fileSize":{"type":"number"},"source":{"type":"string","enum":["upload","url"]},"sourceUrl":{"type":"string"},"status":{"type":"string","enum":["pending","processing","ready","error"]},"charCount":{"type":"number"},"chunkCount":{"type":"number"},"errorMessage":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"UploadKnowledgeRequest":{"type":"object","required":["fileName","contentType"],"properties":{"fileName":{"type":"string","description":"Original file name (e.g., \"menu.pdf\")"},"contentType":{"type":"string","description":"MIME type (e.g., \"application/pdf\")"},"fileSize":{"type":"number","description":"File size in bytes"}}},"UploadAssetRequest":{"type":"object","required":["fileName","contentType"],"properties":{"fileName":{"type":"string","description":"Original file name (e.g., \"logo.png\")"},"contentType":{"type":"string","description":"MIME type. Allowed: image/png, image/jpeg, image/webp, image/svg+xml"},"fileSize":{"type":"number","description":"File size in bytes (max 10 MB)"}}}}},"paths":{"/agents":{"get":{"operationId":"listAgents","summary":"List all agents","responses":{"200":{"description":"List of agents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}}}},"post":{"operationId":"createAgent","summary":"Create a new agent","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRequest"}}}},"responses":{"201":{"description":"Agent created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/agents/{agentId}":{"get":{"operationId":"getAgent","summary":"Get agent details","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Agent details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"404":{"description":"Agent not found"}}},"put":{"operationId":"updateAgent","summary":"Update agent configuration","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRequest"}}}},"responses":{"200":{"description":"Agent updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}}}},"delete":{"operationId":"deleteAgent","summary":"Delete a draft agent","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Agent deleted"},"400":{"description":"Cannot delete non-draft agents"}}}},"/agents/{agentId}/submit":{"post":{"operationId":"submitAgentForReview","summary":"Submit agent for review","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Submitted for review"}}}},"/agents/{agentId}/toggle":{"post":{"operationId":"toggleAgent","summary":"Enable/disable an active agent","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Toggled","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}}}}}}}}},"/agents/{agentId}/embed-code":{"get":{"operationId":"getEmbedCode","summary":"Get widget embed code","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Embed code","content":{"application/json":{"schema":{"type":"object","properties":{"embedCode":{"type":"string"}}}}}}}}},"/agents/{agentId}/regenerate-key":{"post":{"operationId":"regenerateAgentKey","summary":"Regenerate agent API key","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"New API key","content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string"}}}}}}}}},"/agents/{agentId}/knowledge":{"get":{"operationId":"listKnowledgeFiles","summary":"List knowledge base files for an agent","description":"Returns all uploaded knowledge files with their processing status, plus plan limits.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Knowledge files and plan limits","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeFile"}},"limits":{"type":"object","properties":{"fileLimit":{"type":"number"},"fileSizeMb":{"type":"number"},"charLimit":{"type":"number"},"urlScraping":{"type":"boolean"}}}}}}}}}},"post":{"operationId":"uploadKnowledgeFile","summary":"Upload a knowledge base file","description":"Returns a presigned S3 URL. Upload the file to that URL with PUT, then the file will be processed asynchronously (text extraction → chunking → embedding).","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadKnowledgeRequest"}}}},"responses":{"200":{"description":"Upload URL generated","content":{"application/json":{"schema":{"type":"object","properties":{"uploadUrl":{"type":"string"},"fileId":{"type":"string"},"s3Key":{"type":"string"}}}}}},"400":{"description":"Validation error or plan limit reached"},"403":{"description":"Knowledge Base requires a paid plan"}}}},"/agents/{agentId}/knowledge/{fileId}":{"delete":{"operationId":"deleteKnowledgeFile","summary":"Delete a knowledge base file","description":"Removes the file from S3, deletes vector embeddings from the database, and removes the metadata record.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"File deleted"},"404":{"description":"File not found"}}}},"/uploads":{"post":{"operationId":"createUpload","summary":"Get a presigned URL to upload an asset (e.g. an agent logo)","description":"Returns a presigned S3 URL and its object key. PUT the file to uploadUrl using the same Content-Type, then pass the returned key as logoKey to create or update an agent. Allowed types: image/png, image/jpeg, image/webp, image/svg+xml. Max 10 MB.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadAssetRequest"}}}},"responses":{"200":{"description":"Upload URL generated","content":{"application/json":{"schema":{"type":"object","properties":{"uploadUrl":{"type":"string"},"key":{"type":"string"}}}}}},"400":{"description":"Validation error (missing fields, disallowed type, or file too large)"}}}}}}