PromptlyAgent Documentation
PromptlyAgent is an AI Workbench built for developers and end-users alike. It allows everyone to harness the power of multi-agent orchestration, RAG (Retrieval-Augmented Generation) and more at ease.
What is PromptlyAgent?
PromptlyAgent is a comprehensive Laravel-based AI Workbench that enables you to:
- Powerful Chat interface with Session management, Artifact generation, web-search, full research details and sources
- Build intelligent AI agents with specialized tools and capabilities
- Orchestrate multi-agent workflows for complex research and analysis tasks
- Manage knowledge bases with semantic search and RAG capabilities
- Stream real-time AI responses and feedback via Server-Sent Events (SSE) and Websockets
- Integrate with external systems through webhooks, triggers, and custom packages
- Scale operations with queue-based job processing (Horizon)
Built on the TALL stack (Tailwind, Alpine.js, Laravel, Livewire), PromptlyAgent provides both a web interface for users and a comprehensive REST API for developers.
Key Features
Multi-Agent System
Create and manage AI agents with different specializations:
- Research Agents - Web search, news gathering, topic analysis
- Synthesis Agents - Consolidate and summarize findings
- QA - Validate Agent results and request iterations
- Custom Agents - Build agents for specific domains and tasks
Each agent can be equipped with tools (web search, calculators, file operations, etc.) and configured with specific AI models (OpenAI GPT, Anthropic Claude, AWS Bedrock). Agents can be created and configured via code, through the web interface or through a "Agent generation Agent" (yes, that's meta).
Agent tools
Core suite of over 30 tools that can extend AI capabilities.
- Knowledge - Search and retrieve knowledge
- Artifacts - Create, manipulate or search for artifacts in a conversation
- Context - Full context awareness with search, source access and more
- HTTP Requests - Send HTTP Requests to interact with APIs
- Web Search - search the web through SearXng
- URL Validation/Scraping - Validation and retrieval of urls
- Conversion - Scraping and conversion of various sources through Markitdown
Developers can easily extend the already broad set of core tools through integrations.
Workflow Orchestration
Execute complex multi-agent workflows with four execution strategies:
- Simple - Single agent execution
- Sequential - Chain agents together for progressive refinement
- Parallel - Run multiple agents simultaneously for speed
- Mixed - Combine parallel and sequential stages for complex pipelines
Utilizing Laravel's batch processing powerful agentic workflows can be created. This can happen through custom code such as our DailyDigestCommand or automatically through our "Deeply Agent" that will take a user's prompt and translate it into an agentic workflow utilizing multiple agents.
Knowledge Management (RAG)
Build intelligent knowledge bases with:
- Semantic Search - Vector embeddings with Meilisearch
- Hybrid Search - Combines keyword and semantic search
- Document Processing - PDF, Word, text files, code files
- External URLs - Automatic fetching and refresh
- Privacy Controls - Public and private document levels
- Tagging - automatic and manual tagging to easier assign content to agents
The built-in Knowledge management system is extendable and allows for semantic search and dynamic assignments of knowledge to specific agents through either the web interface or via code.
Real-Time Chat & Streaming
Interactive conversational AI with:
- Server-Sent Events (SSE) - Real-time streaming responses
- Session Management - Multi-turn conversations with history
- File Attachments - Upload documents for context
- Public Sharing - Share chat sessions via UUID links
- Full insighs - Full insights into Sources, Steps and execution details
- Artifact management - Powerful artifact creation and editing as well as export functionality (including PDF)
- Visualizations - With MermaidJS the system can create data visualizations without the need for external tools
PWA (Progressive Web App) for mobile
Access core functionality through a PWA on iOS/Android.
- Chat interface - Powerful chat interface and session management
- Knowledge access - Access to knowledge documents and search
- Session sharing - Share chat sessions
- File attachments & Camera - Use your camera or existing files to add context to your chat
Powerful APIs and integration abilities
Quick Start
1. Clone and navigate
git clone https://github.com/promptlyagentai/promptlyagent.git
cd promptlyagent
2. Configure environment
cp .env.example .env
Edit .env and set:
- Your AI provider API key (OpenAI, Anthropic, Google, or AWS)
WWWUSER=$(id -u)andWWWGROUP=$(id -g)to match your host user
3. Install Composer dependencies (first-time setup)
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/var/www/html:z" \
-w /var/www/html \
laravelsail/php84-composer:latest \
composer install --ignore-platform-reqs --no-scripts
4. Start Docker containers
./vendor/bin/sail up -d
Note: Initial build takes 10-15 minutes. Subsequent starts are faster.
5. Complete Composer setup
./vendor/bin/sail composer install
6. Install npm dependencies
./vendor/bin/sail npm install
7. Initialize application
./vendor/bin/sail artisan key:generate
./vendor/bin/sail artisan migrate
8. Create admin user
./vendor/bin/sail artisan make:admin
9. Seed database (creates default agents)
./vendor/bin/sail artisan db:seed
10. Build frontend
./vendor/bin/sail npm run build
Alternative for development with hot reload:
./vendor/bin/sail npm run dev
11. Access the application
- Web Interface: http://localhost
- API Documentation: http://localhost/docs
- Horizon Dashboard: http://localhost/horizon
📚 Need help? See the Complete Installation Guide for troubleshooting, advanced configuration, and detailed explanations.
Architecture
Technology Stack: Laravel 12, PHP 8.4, Livewire 3, Volt, Flux UI (Free), Tailwind 4, Prism-PHP, Meilisearch, Horizon, Reverb
PromptlyAgent uses a modular architecture with multi-container Docker infrastructure, load-balanced services, and queue-based background processing.
📚 Learn More: See the Architecture Guide for detailed system design, component diagrams, and infrastructure details.
📚 For complete technology stack details: See the Introduction Guide
Use Cases
Research & Analysis
- Daily news digests with multi-topic research
- Competitive intelligence gathering
- Market research and trend analysis
- Academic research assistance
Knowledge Management
- Internal documentation search
- Code repository analysis
- Customer support knowledge bases
- Compliance and regulatory document management
Content Creation
- Blog post research and drafting
- Social media content generation
- Email campaign creation
- Report generation with data synthesis
Integration & Automation
- Webhook-triggered research workflows
- Scheduled digest delivery
- Slack bot integration
- Email notification systems
Getting Help
- GitHub Repository: promptlyagentai/promptlyagent
- GitHub Issues: Report bugs and request features
- API Documentation: Comprehensive REST API reference (see below)
Interactive Support Widget
PromptlyAgent includes an AI-powered support widget with deep codebase integration:
- Codebase Access - The widget has complete access to the project source code, architecture, and documentation
- Intelligent Assistance - Ask questions about implementation details, architecture decisions, or usage patterns
- Issue Creation - Create GitHub issues directly from conversations with automatic context capture
- Code Examples - Get specific code examples and explanations tailored to your questions
Look for the support widget in the bottom-right corner of the application interface. It's designed to help you understand the codebase, troubleshoot issues, and get unstuck quickly.
Developer Documentation
Comprehensive guides for developing with PromptlyAgent:
📚 Learning Paths:
New User Path (Start Here):
- Getting Started - Installation and setup
- Introduction - Core concepts (agents, RAG, workflows)
- Development Guide - Day-to-day workflow
Package Developer Path:
- Getting Started - Installation
- Package Development - Build custom integrations
- Architecture - Understanding the system
Architect Path:
- Introduction - Core concepts
- Architecture - Deep dive into system design
- Workflows - Multi-agent orchestration
All Guides:
- Introduction - Platform overview and core concepts
- Getting Started - Installation and setup
- Development Guide - Development workflow and commands
- Architecture - System design and components
- Workflows - Creating custom multi-agent workflows
- Actions - Workflow actions development
- Theming - Color system and UI customization
- Package Development - Building self-registering Laravel packages
- PDF & other exports - PDF and other exports via Pandoc and Eisvogel
- MermaidJS Diagrams - Let AI visualize your data via MermaidJS
License
PromptlyAgent is available under a dual-licensing model:
- 🆓 MIT License - For personal, academic, and non-commercial use
- 💼 Commercial License - Required for business and commercial use
Personal/non-commercial use includes hobby projects, academic research, and internal use within non-profit organizations that doesn't generate revenue.
Commercial use includes any for-profit entity, revenue-generating applications, production business operations, or services offered for a fee.
See the LICENSE file for complete terms and definitions. For commercial licensing inquiries, contact [email protected].
All third-party dependencies and their licenses, including containerized services (Pandoc, SearXNG, MarkItDown, MermaidJS), are documented in THIRD_PARTY_NOTICES.md.
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your API key from your dashboard at Settings > API Tokens.
Create artifact from chat interaction (API endpoint for PWA)
requires authentication
Example request:
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update artifact metadata and content
requires authentication
Example request:
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Queue async conversion of artifact (API endpoint)
requires authentication
Example request:
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show artifact details (API endpoint)
requires authentication
Example request:
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"success": false,
"error": "UNAUTHENTICATED",
"message": "Authentication required.",
"timestamp": "2026-02-10T11:16:48+00:00"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get conversions for an artifact (API endpoint for PWA)
requires authentication
Example request:
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"success": false,
"error": "UNAUTHENTICATED",
"message": "Authentication required.",
"timestamp": "2026-02-10T11:16:48+00:00"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Download conversion via API (uses signed URLs)
requires authentication
This endpoint uses signed URLs for secure, time-limited access. The 'signed' middleware validates the URL signature, ensuring the URL was generated by our server and hasn't expired.
Example request:
Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 300
x-ratelimit-remaining: 298
vary: Origin
{
"success": false,
"error": "NOT_FOUND",
"message": "The requested resource was not found.",
"timestamp": "2026-02-10T11:16:48+00:00"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get conversion status (for polling)
requires authentication
Example request:
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"success": false,
"error": "UNAUTHENTICATED",
"message": "Authentication required.",
"timestamp": "2026-02-10T11:16:48+00:00"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Agents & Tools
API endpoints for managing and querying AI agents and their configurations.
All endpoints require authentication and the agent:view token ability.
List available agents
requires authentication
Returns all agents available to the authenticated user, including public agents and user-created agents. Only active agents are returned.
Example Usage
Ulauncher Extension (github.com/promptlyagentai/ulauncher-promptlyagent) - Desktop AI integration:
- Browse and select from configured agents via keyboard shortcut
- Smart caching (1-hour default) to reduce API calls
- Agent filtering and quick selection in TUI
- Requires
agent:viewtoken ability
Example request:
Example response (200, Success):
{
"success": true,
"agents": [
{
"id": 1,
"name": "Direct Chat Agent",
"description": "General purpose conversational agent",
"agent_type": "chat",
"ai_provider": "openai",
"ai_model": "gpt-4",
"is_active": true,
"max_steps": 10,
"tool_count": 5,
"created_at": "2024-01-01T00:00:00.000000Z"
}
]
}
Example response (403, Insufficient permissions):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the agent:view ability"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get agent details
requires authentication
Returns detailed information about a specific agent, including its configuration, system prompt, and enabled tools.
Example Usage
PWA (resources/js/pwa/agent-api.js) - Agent details with caching:
- Retrieves specific agent configuration and settings
- Uses cached agent list for faster access
- Fallback to cache when offline
- Cache validity: 1 hour
Example request:
Example response (200, Success):
{
"success": true,
"agent": {
"id": 1,
"name": "Direct Chat Agent",
"description": "General purpose conversational agent",
"agent_type": "chat",
"ai_provider": "openai",
"ai_model": "gpt-4",
"is_active": true,
"max_steps": 10,
"system_prompt": "You are a helpful AI assistant...",
"tools": [
"web_search",
"calculator",
"file_read"
],
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
}
}
Example response (404, Agent not found):
{
"success": false,
"error": "Not Found",
"message": "Agent not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List tools enabled for a specific agent
requires authentication
Retrieve all tools currently assigned to a specific agent. Only tools that have been explicitly enabled for the agent are returned.
Example request:
Example response (200, Success):
{
"success": true,
"agent_id": 5,
"agent_name": "Research Agent",
"tools": [
{
"name": "web_search",
"description": "Search the web using SearXNG meta-search engine",
"category": "research",
"enabled": true
},
{
"name": "search_knowledge",
"description": "Query the knowledge base with semantic search",
"category": "research",
"enabled": true
}
],
"total": 2
}
Example response (403, Missing tools:view ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the tools:view ability"
}
Example response (403, Missing agent:view ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the agent:view ability required to access agent tools"
}
Example response (404, Agent Not Found):
{
"success": false,
"error": "Not Found",
"message": "Agent not found"
}
Example response (500, Server Error):
{
"success": false,
"error": "Server Error",
"message": "An error occurred while retrieving agent tools"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
agent_id
integer
The agent ID
agent_name
string
The agent name
tools
string[]
Array of tools enabled for this agent
name
string
Tool identifier
description
string
Tool description
category
string
Tool category (research, file, calculation, integration, general)
enabled
boolean
Always true for this endpoint (indicates tool is enabled for agent)
total
integer
Number of tools enabled for this agent
List all available tools
requires authentication
Retrieve all tools registered in the ToolRegistry with their descriptions, categories, and authentication requirements. These are the tools that can be assigned to agents.
Example request:
Example response (200, Success):
{
"success": true,
"tools": [
{
"name": "web_search",
"description": "Search the web using SearXNG meta-search engine",
"category": "research",
"requires_auth": false
},
{
"name": "search_knowledge",
"description": "Query the knowledge base with semantic search",
"category": "research",
"requires_auth": false
},
{
"name": "calculator",
"description": "Perform mathematical calculations",
"category": "calculation",
"requires_auth": false
}
],
"total": 15
}
Example response (403, Missing tools:view ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the tools:view ability"
}
Example response (500, Server Error):
{
"success": false,
"error": "Server Error",
"message": "An error occurred while retrieving tools"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
tools
string[]
Array of available tools
name
string
Tool identifier (used when assigning to agents)
description
string
Human-readable description of tool functionality
category
string
Tool category (research, file, calculation, integration, general)
requires_auth
boolean
Whether tool requires user authentication to external services
total
integer
Total number of available tools
Chat & Streaming
Direct chat API endpoints with real-time SSE streaming support. Integrate conversational AI into your applications without webhook triggers.
Features
- Real-time streaming responses via Server-Sent Events (SSE)
- Session management and history
- File attachments support
- Multi-turn conversations
- Agent selection per message
Required Token Abilities
chat:create- Send messages and create sessionsagent:attach- Upload file attachments
Rate Limiting
- Streaming & send: 10 requests/minute (expensive AI operations)
- Session management: 60 requests/minute
- Session viewing: 300 requests/minute
Stream a chat message with real-time SSE responses
requires authentication
Sends a message to an AI agent and streams the response in real-time using Server-Sent Events (SSE). Supports multi-turn conversations, file attachments, and automatic session management.
The stream returns various event types (message, tool_call, source, artifact, heartbeat, complete, error) with JSON-encoded data payloads. Connections are kept alive with periodic heartbeats and protected against timeouts.
Example Usage
Support Widget (github.com/promptlyagentai/support-widget) - AI-powered support chat:
- Real-time streaming responses with SSE
- Session persistence with cookies
- Element selection for contextual help
- Screenshot capture with messages
Ulauncher Extension (github.com/promptlyagentai/ulauncher-promptlyagent) - Desktop AI assistant:
- Quick access from Linux desktop
- Real-time streaming with notifications
- Clipboard integration for results
- Agent selection and filtering
Example request:
Example response (200, SSE Stream):
event: message
data: {"type": "text", "content": "Here are the best practices for Laravel routing...", "delta": true}
event: tool_call
data: {"tool": "search_knowledge", "arguments": {"query": "routing best practices"}}
event: source
data: {"title": "Laravel Docs - Routing", "url": "https://laravel.com/docs/routing", "domain": "laravel.com"}
event: artifact
data: {"type": "code", "language": "php", "content": "Route::get('/user', [UserController::class, 'index']);"}
event: heartbeat
data: {"timestamp": 1704067200}
event: complete
data: {"status": "completed", "duration_seconds": 12}
Example response (400, Agent Inactive):
{
"success": false,
"error": "Agent Inactive",
"message": "This agent is not currently active."
}
Example response (403, Missing chat:create ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the chat:create ability"
}
Example response (404, Resource Not Found):
{
"success": false,
"error": "Not Found",
"message": "The specified resource was not found"
}
Example response (422, File Validation Failed):
{
"success": false,
"error": "File Validation Failed",
"message": "File type not allowed: executable"
}
Example response (500, Agent Not Found):
{
"success": false,
"error": "Agent Not Found",
"message": "Direct Chat Agent not found. Please run database seeder."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
event
string
The SSE event type (message, tool_call, source, artifact, heartbeat, complete, error)
data
string
JSON-encoded event data. Structure varies by event type.
Send a chat message (non-streaming)
requires authentication
Non-streaming chat endpoint for sending messages and receiving complete responses.
Currently not implemented - use the /api/v1/chat/stream endpoint instead for all chat operations.
Example request:
Example response (501, Not Implemented):
{
"success": false,
"error": "Not Implemented",
"message": "Non-streaming chat endpoint not yet implemented. Please use /api/v1/chat/stream instead."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Toggle keep flag on a session
requires authentication
Mark a session as "kept" to protect it from automatic deletion, or remove the keep flag. Kept sessions are excluded from cleanup routines and remain permanently until manually deleted.
Example Usage
PWA (resources/js/pwa/session-api.js) - Session management:
- Toggles keep flag to protect important conversations
- Prevents automatic cleanup of marked sessions
- Supports bulk operations on multiple sessions
- Requires
chat:managetoken ability
Example request:
Example response (200, Success):
{
"success": true,
"session": {
"id": 123,
"is_kept": true
}
}
Example response (403, Missing chat:manage ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the chat:manage ability"
}
Example response (403, Not Session Owner):
{
"success": false,
"error": "Forbidden",
"message": "You do not have permission to modify this session"
}
Example response (404, Session Not Found):
{
"success": false,
"error": "Not Found",
"message": "Chat session not found"
}
Example response (500, Server Error):
{
"success": false,
"error": "Server Error",
"message": "An error occurred while updating the session"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
session
object
Updated session details
id
integer
Session ID
is_kept
boolean
New kept status (toggled)
Archive a chat session
requires authentication
Move a session to the archive. Archived sessions are hidden from the default session list and can be restored later. Cannot archive sessions marked as kept.
Example Usage
PWA (resources/js/pwa/session-api.js) - Session organization:
- Archives old or completed conversations
- Keeps chat history clean without permanent deletion
- Bulk operation support for multiple sessions
- Requires
chat:managetoken ability
Example request:
Example response (200, Success):
{
"success": true,
"session": {
"id": 123,
"is_archived": true,
"archived_at": "2024-01-01T12:00:00Z"
}
}
Example response (403, Missing chat:manage ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the chat:manage ability"
}
Example response (403, Not Session Owner):
{
"success": false,
"error": "Forbidden",
"message": "You do not have permission to modify this session"
}
Example response (404, Session Not Found):
{
"success": false,
"error": "Not Found",
"message": "Chat session not found"
}
Example response (422, Cannot Archive Kept Session):
{
"success": false,
"error": "Cannot Archive Kept Session",
"message": "Cannot archive a session marked as kept. Remove the keep flag first."
}
Example response (422, Already Archived):
{
"success": false,
"error": "Already Archived",
"message": "This session is already archived"
}
Example response (500, Server Error):
{
"success": false,
"error": "Server Error",
"message": "An error occurred while archiving the session"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
session
object
Updated session details
id
integer
Session ID
is_archived
boolean
Archive status (true)
archived_at
string
Archive timestamp (ISO 8601)
Unarchive a chat session
requires authentication
Restore an archived session back to the active session list.
Example request:
Example response (200, Success):
{
"success": true,
"session": {
"id": 123,
"is_archived": false,
"archived_at": null
}
}
Example response (403, Missing chat:manage ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the chat:manage ability"
}
Example response (403, Not Session Owner):
{
"success": false,
"error": "Forbidden",
"message": "You do not have permission to modify this session"
}
Example response (404, Session Not Found):
{
"success": false,
"error": "Not Found",
"message": "Chat session not found"
}
Example response (422, Not Archived):
{
"success": false,
"error": "Not Archived",
"message": "This session is not archived"
}
Example response (500, Server Error):
{
"success": false,
"error": "Server Error",
"message": "An error occurred while unarchiving the session"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
session
object
Updated session details
id
integer
Session ID
is_archived
boolean
Archive status (false)
archived_at
null Always null after unarchiving
Share a chat session publicly
requires authentication
Make a session publicly accessible via a unique URL. Optionally set an expiration period after which the public link will no longer work. Public sessions can be viewed by anyone with the link without authentication.
Example Usage
PWA (resources/js/pwa/session-api.js) - Public sharing:
- Generates public shareable URLs for conversations
- Optional TTL-based expiration (1-365 days)
- Returns full public URL for easy sharing
- Requires
chat:managetoken ability
Response
Response Fields
success
boolean
Indicates if the request was successful
session
object
Updated session details
id
integer
Session ID
uuid
string
Unique session identifier used in public URL
is_public
boolean
Public sharing status (true)
public_url
string
Full public URL for viewing the session
public_shared_at
string
Timestamp when session was made public (ISO 8601)
public_expires_at
string
Expiration timestamp (ISO 8601) or null if no expiration
Unshare a chat session (make private)
requires authentication
Remove public access from a session. The public URL will no longer work and the session will only be accessible to the owner when authenticated.
Response
Response Fields
success
boolean
Indicates if the request was successful
session
object
Updated session details
id
integer
Session ID
is_public
boolean
Public sharing status (false)
public_shared_at
null Always null after unsharing
public_expires_at
null Always null after unsharing
Delete a chat session
requires authentication
Permanently delete a session and all associated interactions, attachments, and artifacts. This action cannot be undone. Only the session owner can delete their sessions.
Example Usage
PWA (resources/js/pwa/session-api.js) - Session deletion:
- Permanently removes sessions and all related data
- Supports bulk deletion of multiple sessions
- Progress tracking for bulk operations
- Requires
chat:deletetoken ability
Example request:
Example response (200, Success):
{
"success": true,
"message": "Session deleted successfully"
}
Example response (403, Missing chat:delete ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the chat:delete ability"
}
Example response (403, Not Session Owner):
{
"success": false,
"error": "Forbidden",
"message": "You do not have permission to delete this session"
}
Example response (404, Session Not Found):
{
"success": false,
"error": "Not Found",
"message": "Chat session not found"
}
Example response (500, Server Error):
{
"success": false,
"error": "Server Error",
"message": "An error occurred while deleting the session"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
message
string
Confirmation message
List all chat sessions
requires authentication
Retrieve all chat sessions for the authenticated user with optional filtering and search. Supports filtering by source type, archive status, kept status, and full-text search across session titles and interaction content.
Example Usage
PWA (resources/js/pwa/session-api.js) - Session history and management:
- Lists sessions with advanced filtering (search, source_type, archived, kept)
- Pagination support (per_page, page parameters)
- Powers the chat history interface in the Progressive Web App
- Requires
chat:viewtoken ability
Example request:
Example response (200, Success):
{
"success": true,
"sessions": [
{
"id": 123,
"name": "API Chat Session",
"title": "Discussion about Laravel",
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"is_public": false,
"source_type": "api",
"is_kept": false,
"is_archived": false,
"archived_at": null,
"interactions_count": 5,
"attachments_count": 2,
"artifacts_count": 1,
"sources_count": 3,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:15:00Z"
}
],
"filters": {
"source_type": "all",
"include_archived": false,
"kept_only": false,
"limit": 50
}
}
Example response (403, Missing chat:view ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the chat:view ability"
}
Example response (422, Invalid Parameters):
{
"success": false,
"error": "Validation Failed",
"message": "Invalid query parameters",
"errors": {
"per_page": [
"The per page must be between 1 and 50."
]
}
}
Example response (500, Server Error):
{
"success": false,
"error": "Server Error",
"message": "An error occurred while retrieving sessions"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
sessions
string[]
Array of chat sessions
id
integer
Session ID
name
string
Session name
title
string
Session title (auto-generated)
uuid
string
Unique session identifier
is_public
boolean
Public sharing status
source_type
string
Source type (web, api, webhook, slack, trigger)
is_kept
boolean
Whether session is marked as kept (protected from auto-deletion)
is_archived
boolean
Archive status
archived_at
string
Archive timestamp (ISO 8601) or null
interactions_count
integer
Number of interactions in session
attachments_count
integer
Number of file attachments
artifacts_count
integer
Number of generated artifacts (code, documents)
sources_count
integer
Number of knowledge sources referenced
created_at
string
Creation timestamp (ISO 8601)
updated_at
string
Last update timestamp (ISO 8601)
filters
object
Applied filters for this request
View a chat session
requires authentication
Retrieve a single chat session with all interactions, messages, and sources. Returns the complete conversation history with nested source attributions from the knowledge base.
Example Usage
Support Widget (github.com/promptlyagentai/support-widget) - Restore conversation history:
- Retrieves existing sessions from cookie-stored session IDs
- Displays full conversation history when reopening widget
Trigger API Client (github.com/promptlyagentai/trigger-api-client) - Session validation:
- Validates session IDs before streaming trigger responses
- Continues conversations in specific chat sessions
Example request:
Example response (200, Success):
{
"success": true,
"session": {
"id": 123,
"name": "API Chat Session",
"title": "Discussion about Laravel routing",
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"is_public": false,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:15:00Z"
},
"interactions": [
{
"id": 456,
"question": "What are Laravel best practices?",
"answer": "Here are the Laravel best practices...",
"agent_name": "Direct Chat Agent",
"sources": [
{
"title": "Laravel Documentation",
"url": "https://laravel.com/docs",
"domain": "laravel.com"
}
],
"created_at": "2024-01-01T00:00:00Z"
}
]
}
Example response (403, Missing chat:view ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the chat:view ability"
}
Example response (403, Not Session Owner):
{
"success": false,
"error": "Forbidden",
"message": "You do not have permission to access this session"
}
Example response (404, Session Not Found):
{
"success": false,
"error": "Not Found",
"message": "Chat session not found"
}
Example response (500, Server Error):
{
"success": false,
"error": "Server Error",
"message": "An error occurred while retrieving the session"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
session
object
The chat session details
id
integer
Session ID
name
string
Session name
title
string
Session title (auto-generated from first message)
uuid
string
Unique session identifier for public sharing
is_public
boolean
Whether the session is publicly shared
created_at
string
Session creation timestamp (ISO 8601)
updated_at
string
Last update timestamp (ISO 8601)
interactions
string[]
Array of chat interactions in chronological order
id
integer
Interaction ID
question
string
User's question/message
answer
string
Agent's response
agent_name
string
Name of the agent that handled this interaction
sources
string[]
Knowledge sources referenced in the response
title
string
Source document title
url
string
Source URL
domain
string
Source domain name
created_at
string
Interaction timestamp (ISO 8601)
Input Triggers
Input Triggers provide webhook-based automation for invoking AI agents. Execute triggers via REST API with Sanctum authentication and optional IP whitelisting.
Authentication & Authorization
Required token abilities:
trigger:invoke- Execute triggerstrigger:attach- Upload file attachmentstrigger:tools- Override tool selectiontrigger:status- View trigger metadata
Execution Modes
- Synchronous (
/invoke): Returns complete response after execution - Streaming (
/stream): Real-time SSE streaming with step-by-step updates
Rate Limiting
- Expensive operations (invoke, stream): 10 requests/minute
- Read operations (index, show): 300 requests/minute
Execute trigger synchronously
requires authentication
Invoke an input trigger and wait for the complete response. Supports both synchronous
and asynchronous execution modes. For real-time streaming responses, use the /stream endpoint instead.
The request format depends on the trigger's provider. Common providers include:
direct_text: Simple text input viainputparameterschedule: No input required (scheduled triggers)- Custom providers: May require specific fields
Example request:
Example response (200, Success (Sync)):
{
"success": true,
"result": {
"answer": "Analysis complete. Here are the findings...",
"sources": [],
"artifacts": []
},
"execution_time": 5.2
}
Example response (200, Success (Async)):
{
"success": true,
"execution_id": 456,
"status": "queued",
"message": "Trigger execution started asynchronously"
}
Example response (403, Missing trigger:invoke ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the trigger:invoke ability"
}
Example response (403, Not Trigger Owner):
{
"success": false,
"error": "Forbidden",
"message": "You do not have permission to invoke this trigger"
}
Example response (403, Trigger Disabled):
{
"success": false,
"error": "Trigger Disabled",
"message": "This trigger is currently disabled"
}
Example response (422, Validation Failed):
{
"success": false,
"error": "Validation Failed",
"message": "Invalid input format",
"errors": {
"input": [
"The input field is required"
]
}
}
Example response (422, Invalid Input):
{
"success": false,
"error": "Invalid Input",
"message": "Input exceeds maximum length"
}
Example response (500, Provider Not Found):
{
"success": false,
"error": "Provider Not Found",
"message": "Provider 'custom_provider' is not registered"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
result
object
Execution result (synchronous mode only)
answer
string
AI agent's response
sources
string[]
Knowledge sources referenced
artifacts
string[]
Generated artifacts (code, documents)
execution_time
number
Execution duration in seconds
execution_id
integer
Execution ID (async mode only)
status
string
Execution status: queued, processing, completed, failed (async mode only)
Execute trigger with real-time SSE streaming
requires authentication
Invoke an input trigger and stream the AI response in real-time using Server-Sent Events (SSE). Supports file attachments, tool overrides, and session continuity.
The stream returns various event types (message, tool_call, source, artifact, heartbeat, complete, error) with JSON-encoded data payloads. Connections are kept alive with periodic heartbeats.
Example Usage
Trigger API Client (github.com/promptlyagentai/trigger-api-client) - Full-featured Python CLI:
- Three operation modes: Interactive TUI, Direct, and JSON output
- Real-time SSE streaming with live status updates
- File attachment support (up to 5MB per file)
- Session management and conversation history
- Rich markdown rendering in TUI mode
- Requires
trigger:invoke,trigger:status, andtrigger:attachtoken abilities
Example request:
Example response (200, SSE Stream):
event: message
data: {"type": "text", "content": "Analysis complete. Here are the key findings...", "delta": true}
event: tool_call
data: {"tool": "search_knowledge", "arguments": {"query": "data analysis"}}
event: source
data: {"title": "Data Analysis Guide", "url": "https://example.com/guide", "domain": "example.com"}
event: heartbeat
data: {"timestamp": 1704067200}
event: complete
data: {"status": "completed", "duration_seconds": 8}
Example response (403, Missing trigger:invoke ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the trigger:invoke ability"
}
Example response (403, Missing trigger:attach for files):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the trigger:attach ability required for file uploads"
}
Example response (403, Missing trigger:tools for override):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the trigger:tools ability required for tool override"
}
Example response (403, Not Trigger Owner):
{
"success": false,
"error": "Forbidden",
"message": "You do not have permission to invoke this trigger"
}
Example response (403, Trigger Disabled):
{
"success": false,
"error": "Trigger Disabled",
"message": "This trigger is currently disabled"
}
Example response (422, File Validation Failed):
{
"success": false,
"error": "File Validation Failed",
"message": "File type not allowed: executable"
}
Example response (422, Invalid Tool Override):
{
"success": false,
"error": "Invalid Tool Override",
"message": "Tool 'invalid_tool' not available for this agent",
"details": []
}
Example response (422, Validation Failed):
{
"success": false,
"error": "Validation Failed",
"message": "Invalid input format",
"errors": {}
}
Example response (500, Provider Not Found):
{
"success": false,
"error": "Provider Not Found",
"message": "Provider 'custom_provider' is not registered"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
event
string
The SSE event type (message, tool_call, source, artifact, heartbeat, complete, error)
data
string
JSON-encoded event data. Structure varies by event type.
List all triggers
requires authentication
Retrieve all input triggers for the authenticated user with basic information and API URLs. Results are ordered by creation date (newest first).
Example request:
Example response (200, Success):
{
"success": true,
"triggers": [
{
"id": 1,
"name": "Daily Report Generator",
"description": "Generates daily analytics reports",
"provider": "schedule",
"is_active": true,
"agent_name": "Report Agent",
"usage_count": 42,
"last_invoked_at": "2024-01-01T10:00:00Z",
"api_url": "https://promptlyagent.com/api/input-triggers/1"
}
]
}
Example response (403, Missing trigger:status ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the trigger:status ability"
}
Example response (500, Server Error):
{
"success": false,
"error": "Server Error",
"message": "An error occurred while retrieving triggers"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
triggers
string[]
Array of triggers
id
integer
Trigger ID
name
string
Trigger name
description
string
Trigger description
provider
string
Provider ID
is_active
boolean
Whether trigger is active
agent_name
string
Associated agent name
usage_count
integer
Number of invocations
last_invoked_at
string
Last invocation timestamp (ISO 8601) or null
api_url
string
Full API URL for invoking this trigger
View a trigger's details
requires authentication
Retrieve comprehensive information about a specific input trigger including configuration, usage statistics, and provider metadata.
Example request:
Example response (200, Success):
{
"success": true,
"trigger": {
"id": 1,
"name": "Daily Report Generator",
"description": "Generates daily analytics reports",
"provider": "schedule",
"is_active": true,
"agent_id": 5,
"agent_name": "Report Agent",
"session_strategy": "continue_last",
"usage_count": 42,
"last_invoked_at": "2024-01-01T10:00:00Z",
"rate_limits": {
"max_per_minute": 10
},
"created_at": "2023-12-01T00:00:00Z"
},
"provider_info": {
"name": "Schedule",
"description": "Scheduled triggers",
"icon": "⏰"
}
}
Example response (403, Missing trigger:status ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the trigger:status ability"
}
Example response (403, Not Trigger Owner):
{
"success": false,
"error": "Forbidden",
"message": "You do not have permission to view this trigger"
}
Example response (404, Trigger Not Found):
{
"success": false,
"error": "Not Found",
"message": "Trigger not found"
}
Example response (500, Server Error):
{
"success": false,
"error": "Server Error",
"message": "An error occurred while retrieving trigger information"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
trigger
object
Trigger details
id
integer
Trigger ID
name
string
Trigger name
description
string
Trigger description
provider
string
Provider ID (schedule, direct_text, webhook, etc.)
is_active
boolean
Whether trigger is currently active
agent_id
integer
Associated agent ID
agent_name
string
Associated agent name
session_strategy
string
Session handling strategy (new_each, continue_last, specified)
usage_count
integer
Number of times trigger has been invoked
last_invoked_at
string
Last invocation timestamp (ISO 8601) or null
rate_limits
object
Rate limiting configuration
created_at
string
Creation timestamp (ISO 8601)
provider_info
object
Provider metadata (name, description, icon)
Resolve session for a trigger
requires authentication
Determine which chat session would be used for a trigger execution based on its session strategy, without actually executing the trigger. Useful for understanding session continuity behavior or pre-loading session history in CLI tools.
Session strategies:
new_each: Creates a new session for each executioncontinue_last: Continues the most recent session for this triggerspecified: Uses a specific default session
Example request:
Example response (200, Will Create New Session):
{
"success": true,
"session_id": null,
"is_existing": false,
"will_create": true,
"session_name": "⏰ Daily Report Generator",
"strategy": "new_each"
}
Example response (200, Will Continue Existing):
{
"success": true,
"session_id": 123,
"session_name": "Daily Report Generator",
"is_existing": true,
"will_create": false,
"strategy": "continue_last",
"interactions_count": 15
}
Example response (403, Missing trigger:status ability):
{
"success": false,
"error": "Unauthorized",
"message": "Your API token does not have the trigger:status ability"
}
Example response (403, Not Trigger Owner):
{
"success": false,
"error": "Forbidden",
"message": "You do not have permission to access this trigger"
}
Example response (500, Server Error):
{
"success": false,
"error": "Server Error",
"message": "An error occurred while resolving the session"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
session_id
integer
Existing session ID, or null if new session will be created
session_name
string
Name of existing session or proposed name for new session
is_existing
boolean
Whether an existing session was found
will_create
boolean
Whether a new session will be created on execution
strategy
string
Session strategy used (new_each, continue_last, specified)
interactions_count
integer
Number of interactions in existing session (only if is_existing=true)
Validate or resolve session
requires authentication
Validate that a specific session ID is compatible with this trigger, or resolve which session would be used based on the trigger's session strategy.
Use cases:
- Validate a session ID before execution:
?session_id=123 - Resolve which session will be used: No parameters
Example request:
Example response (200, Session Valid):
{
"success": true,
"valid": true,
"session": {
"id": 123,
"name": "Daily Report Generator",
"url": "https://promptlyagent.com/dashboard/research-chat/123",
"strategy_used": "validated"
}
}
Example response (200, Session Resolved):
{
"success": true,
"valid": true,
"session": {
"id": 456,
"name": "Report Session",
"url": "https://promptlyagent.com/dashboard/research-chat/456",
"strategy_used": "continue_last"
}
}
Example response (200, No Session Available):
{
"success": true,
"valid": true,
"session": null,
"message": "No existing session available",
"strategy": "new_each",
"url_pattern": "https://promptlyagent.com/dashboard/research-chat/<id>"
}
Example response (403, Missing trigger:status ability):
{
"success": false,
"valid": false,
"error": "Unauthorized",
"message": "Your API token does not have the trigger:status ability"
}
Example response (403, Not Trigger Owner):
{
"success": false,
"valid": false,
"error": "Forbidden",
"message": "You do not have permission to access this trigger"
}
Example response (404, Session Not Found):
{
"success": false,
"valid": false,
"session": null,
"message": "Session not found"
}
Example response (404, Session Not Owned):
{
"success": false,
"valid": false,
"session": null,
"message": "Session does not belong to you"
}
Example response (404, Session Wrong Trigger):
{
"success": false,
"valid": false,
"session": null,
"message": "Session does not belong to this trigger"
}
Example response (500, Server Error):
{
"success": false,
"valid": false,
"error": "Internal Server Error",
"message": "Failed to validate session"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
valid
boolean
Whether the session is valid for this trigger
session
object
Session details (null if no session available)
id
integer
Session ID
name
string
Session name
url
string
Full URL to view session in dashboard
strategy_used
string
Strategy that resolved this session (validated, continue_last, specified)
message
string
Informational message (when session is null)
strategy
string
Trigger's session strategy (when session is null)
url_pattern
string
URL pattern for accessing sessions (when session is null)
List webhook trigger configurations
requires authentication
Retrieve webhook trigger configurations for UI integration. Returns trigger metadata including webhook URLs and secrets needed for external webhook setup.
Note: This endpoint is primarily for UI consumption. For API integration, use the v1 API endpoints instead.
Example request:
Example response (200, Success):
{
"triggers": [
{
"id": 1,
"name": "GitHub Push Webhook",
"config": {
"provider": "webhook",
"description": "Trigger on push events"
},
"webhook_url": "https://example.com/webhooks/triggers/1",
"webhook_secret": "whs_abc123xyz456"
}
]
}
Example response (401, Unauthenticated):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
triggers
string[]
List of trigger configurations
id
integer
Trigger ID
name
string
Trigger name
config
object
Trigger configuration
webhook_url
string
Full webhook URL for external services
webhook_secret
string
HMAC secret key for signature validation (null if not webhook trigger)
Get webhook trigger configuration
requires authentication
Retrieve webhook configuration for a specific trigger. Returns webhook URL and secret needed for external webhook setup.
Note: This endpoint is primarily for UI consumption. For API integration, use the v1 API endpoints instead.
Example request:
Example response (200, Success):
{
"id": 1,
"name": "GitHub Push Webhook",
"config": {
"provider": "webhook",
"description": "Trigger on push events"
},
"webhook_url": "https://example.com/webhooks/triggers/1",
"webhook_secret": "whs_abc123xyz456"
}
Example response (401, Unauthenticated):
{
"message": "Unauthenticated."
}
Example response (404, Not Found):
{
"message": "Not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
id
integer
Trigger ID
name
string
Trigger name
config
object
Trigger configuration
webhook_url
string
Full webhook URL for external services
webhook_secret
string
HMAC secret key for signature validation (null if not webhook trigger)
Knowledge Management
Comprehensive API for managing knowledge documents, files, and RAG (Retrieval-Augmented Generation) operations.
Document Types
- File uploads: PDF, Word, text files, code files
- Text documents: Direct text content
- External URLs: Automatic fetching and refresh
Features
- Semantic search with embeddings
- Hybrid search (keyword + semantic)
- Document tagging and categorization
- Agent assignment for RAG context
- Privacy controls (private/public)
Rate Limiting
- File uploads & extraction: 10 requests/minute
- Search & reprocessing: 60 requests/minute
- Read operations: 300 requests/minute
Security
All file uploads are validated with magic byte verification, executable detection, and path traversal protection.
Create a new knowledge document
requires authentication
Create a knowledge document from text content, file upload, or external URL. Supports automatic content extraction, embedding generation, and TTL-based expiration.
Example Usage
Chrome Extension (github.com/promptlyagentai/chrome-extension) - Save web page content to knowledge base:
- Extracts content using Mozilla Readability
- Sends as
content_type: 'text'with title, content, tags, TTL - Requires
knowledge:createtoken ability
Example request:
Example response (201, Success):
{
"success": true,
"data": {
"id": 1,
"title": "Laravel Best Practices",
"content_type": "text",
"privacy_level": "private",
"processing_status": "completed",
"created_at": "2024-01-01T00:00:00Z"
},
"message": "Knowledge document created successfully"
}
Example response (422, File Validation Failed):
{
"success": false,
"error": "FILE_VALIDATION_FAILED",
"message": "File type not allowed: executable"
}
Example response (500, Creation Failed):
{
"success": false,
"error": "CREATION_FAILED",
"message": "Failed to create document"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
The created knowledge document
id
integer
Document ID
title
string
Document title
content_type
string
Content type (text, file, external)
privacy_level
string
Privacy level
processing_status
string
Current processing status
created_at
string
Creation timestamp (ISO 8601)
message
string
Success message
Extract content from a URL
requires authentication
Extract and parse content from a URL without creating a document. Returns extracted text, title, description, and metadata. Useful for previewing content before saving.
Includes SSRF protection to block access to private networks and metadata services.
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"content": "Laravel is a web application framework...",
"title": "Laravel Documentation",
"description": "The PHP framework for web artisans",
"tags": [
"framework",
"php"
],
"metadata": {
"author": "Laravel",
"published_at": "2024-01-01"
}
}
}
Example response (403, SSRF Blocked):
{
"success": false,
"error": "SSRF_BLOCKED",
"message": "Access to this URL is not allowed for security reasons"
}
Example response (422, Validation Failed):
{
"success": false,
"error": "VALIDATION_ERROR",
"message": "URL parameter is required"
}
Example response (422, Invalid URL):
{
"success": false,
"error": "VALIDATION_ERROR",
"message": "Invalid URL format"
}
Example response (500, Extraction Failed):
{
"success": false,
"error": "Failed to extract content from URL: Connection timeout"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
Extracted content and metadata
content
string
Extracted text content
title
string
Page title
description
string
Page description/summary
tags
string[]
Auto-extracted tags
metadata
object
Additional metadata (author, published date, etc.)
Query knowledge base for RAG context
requires authentication
Retrieve relevant knowledge documents for a given query, formatted as RAG context. Returns concatenated document excerpts with source attribution, ready for AI injection.
Results are automatically filtered by privacy (public + user-owned) and TTL expiration. Optionally filter to agent-specific documents.
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"context": "[Source: Laravel Queues Guide]\nLaravel queues provide a unified API for background job processing...\n\n[Source: Redis Configuration]\nTo use Redis as your queue driver, set QUEUE_CONNECTION=redis...",
"query": "How do I configure Laravel queues?",
"total_sources": 2,
"sources": [
{
"id": 1,
"title": "Laravel Queues Guide",
"relevance_score": 0.8,
"document_type": "text"
},
{
"id": 5,
"title": "Redis Configuration",
"relevance_score": 0.8,
"document_type": "file"
}
]
}
}
Example response (200, No Sources Found):
{
"success": true,
"data": {
"context": "",
"query": "obscure query with no matches",
"total_sources": 0,
"sources": []
}
}
Example response (403, Missing Ability):
{
"success": false,
"error": "Unauthorized"
}
Example response (500, Failed):
{
"success": false,
"error": "RAG query failed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
RAG context data
context
string
Formatted RAG context with source attribution (ready for AI injection)
query
string
The original search query
total_sources
integer
Number of source documents included
sources
string[]
Source document metadata (if include_sources=true)
id
integer
Document ID
title
string
Document title
relevance_score
number
Search relevance score (0-1)
document_type
string
Document content type (text, file, external)
Get RAG context (alias)
requires authentication
Alternative endpoint for retrieving RAG context. Functionally identical to the query endpoint. Provided for semantic clarity in workflows where "context" terminology is preferred.
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"context": "[Source: Laravel Queues Guide]\nLaravel queues provide a unified API...",
"query": "How do I configure Laravel queues?",
"total_sources": 2,
"sources": [
{
"id": 1,
"title": "Laravel Queues Guide",
"relevance_score": 0.8,
"document_type": "text"
}
]
}
}
Example response (403, Missing Ability):
{
"success": false,
"error": "Unauthorized"
}
Example response (500, Failed):
{
"success": false,
"error": "RAG query failed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
RAG context data
context
string
Formatted RAG context with source attribution
query
string
The original search query
total_sources
integer
Number of source documents included
sources
string[]
Source document metadata (if include_sources=true)
Stream RAG context with real-time SSE
requires authentication
Retrieve relevant knowledge with Server-Sent Events (SSE) streaming. Returns context progressively as sources are found and processed, enabling real-time UI updates.
Ideal for building responsive interfaces where users see sources appearing in real-time rather than waiting for the complete result.
Connection Requirements:
- Set
Accept: text/event-streamheader - Keep connection open to receive events
- Parse SSE format:
data: {json}\n\n
Event Sequence:
context_retrieved- Initial event with source countsource- One event per source document (progressive)context- Final formatted RAG contextdone- Completion signalerror- Only on failure
Example request:
Example response (200, SSE Stream):
event: message
data: {"type": "context_retrieved", "sources_found": 3}
data: {"type": "source", "data": {"id": 1, "title": "Laravel Queues Guide", "score": 0.8}}
data: {"type": "source", "data": {"id": 5, "title": "Redis Configuration", "score": 0.8}}
data: {"type": "context", "data": "[Source: Laravel Queues Guide]\nLaravel queues provide..."}
data: {"type": "done"}
Example response (200, SSE Error):
event: message
data: {"type": "error", "message": "RAG streaming failed"}
Example response (403, Missing Ability):
{
"error": "Unauthorized",
"message": "Your API token does not have the knowledge:rag ability"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Bulk delete documents
requires authentication
Delete multiple knowledge documents in a single operation. Each document is individually authorized - documents you don't have permission to delete will be skipped.
Returns a detailed summary including successful deletions and errors for failed operations.
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"deleted_count": 3,
"total_requested": 5,
"errors": [
"Document 2 not found",
"Access denied for document 4"
]
},
"message": "Successfully deleted 3 documents"
}
Example response (403, Missing Ability):
{
"success": false,
"error": "Unauthorized"
}
Example response (500, Operation Failed):
{
"success": false,
"error": "Bulk delete failed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
Bulk operation results
deleted_count
integer
Number of documents successfully deleted
total_requested
integer
Total number of documents requested for deletion
errors
string[]
Array of error messages for documents that couldn't be deleted
message
string
Summary message
Bulk assign tag to documents
requires authentication
Assign a tag to multiple knowledge documents in a single operation. If the tag doesn't exist, it will be created automatically. Each document is individually authorized - documents you don't have permission to update will be skipped.
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"assigned_count": 4,
"total_requested": 5,
"tag": {
"id": 1,
"name": "important",
"color": "zinc"
},
"errors": [
"Access denied for document 3"
]
},
"message": "Successfully assigned tag 'important' to 4 documents"
}
Example response (500, Operation Failed):
{
"success": false,
"error": "Bulk assign tag failed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
Bulk operation results
assigned_count
integer
Number of documents successfully tagged
total_requested
integer
Total number of documents requested for tagging
tag
object
The tag that was assigned (created if new)
id
integer
Tag ID
name
string
Tag name
color
string
Tag color
errors
string[]
Array of error messages for documents that couldn't be tagged
message
string
Summary message
Regenerate missing embeddings in bulk
requires authentication
Process multiple documents that are missing embeddings and generate embeddings for them. Useful for batch processing after system updates or when embeddings fail.
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"processed": 25,
"successful": 23,
"failed": 2,
"failed_documents": [
{
"id": 10,
"error": "Content too large"
},
{
"id": 15,
"error": "Invalid format"
}
]
},
"message": "Processed 25 documents. Successful: 23, Failed: 2"
}
Example response (500, Failed):
{
"success": false,
"error": "Failed to regenerate embeddings"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
Regeneration results
processed
integer
Total documents processed
successful
integer
Documents successfully embedded
failed
integer
Documents that failed
failed_documents
string[]
Details of failed documents with error messages
message
string
Summary message
Regenerate embeddings for a document
requires authentication
Regenerate embeddings for a specific document. Deletes existing embeddings and generates new ones from the current document content.
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"chunk_count": 150,
"generated_at": "2024-01-01T12:00:00Z",
"embedding_model": "text-embedding-ada-002"
},
"message": "Document embedding regenerated successfully"
}
Example response (403, Missing Ability):
{
"success": false,
"error": "Unauthorized"
}
Example response (403, No Permission):
{
"success": false,
"error": "You do not have permission to modify this document"
}
Example response (500, Failed):
{
"success": false,
"error": "Failed to regenerate embedding"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
Embedding generation results
chunk_count
integer
Number of chunks created
generated_at
string
Generation timestamp (ISO 8601)
embedding_model
string
Model used for embeddings
message
string
Success message
Reprocess a knowledge document
requires authentication
Regenerate embeddings and reindex the document. Useful after system updates or when embeddings are corrupted.
Example request:
Example response (200, Success (Sync)):
{
"success": true,
"data": {
"chunks_processed": 150,
"embeddings_generated": 150
},
"message": "Document reprocessed successfully"
}
Example response (202, Success (Async)):
{
"success": true,
"status": "processing",
"job_id": "job_abc123",
"status_url": "/api/v1/knowledge/1"
}
Example response (403, Unauthorized):
{
"success": false,
"error": "You do not have permission to reprocess this document"
}
Example response (500, Server Error):
{
"success": false,
"error": "Failed to reprocess document"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
Reprocessing results (sync mode)
status
string
Processing status (async mode)
job_id
string
Job identifier (async mode)
status_url
string
URL to check processing status (async mode)
message
string
Success message
Refresh external document content
requires authentication
Queue a job to re-fetch content from the external URL. Only available for documents created from external URLs (content_type: external).
Example request:
Example response (200, Success):
{
"success": true,
"data": null,
"message": "Document refresh queued successfully"
}
Example response (403, Unauthorized):
{
"success": false,
"error": "You do not have permission to refresh this document"
}
Example response (422, Not Refreshable):
{
"success": false,
"error": "INVALID_DOCUMENT",
"message": "Document is not refreshable"
}
Example response (422, No External URL):
{
"success": false,
"error": "INVALID_DOCUMENT",
"message": "Document does not have an external source URL"
}
Example response (500, Server Error):
{
"success": false,
"error": "Failed to queue document refresh"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
null Always null
message
string
Success message
Search knowledge documents
requires authentication
Full-text search across all accessible knowledge documents using Meilisearch. Supports filtering by content type, tags, and expiration status.
Example Usage
PWA (resources/js/pwa/knowledge-api.js) - Knowledge search with offline support:
- Full-text keyword search with typo tolerance
- Automatic result caching for offline access
- Intelligent fallback to cached results when offline
- Cache validity: 30 minutes
Example request:
Example response (200, Success):
{
"success": true,
"data": [
{
"id": 1,
"title": "Laravel Routing Guide",
"content": "Laravel routing allows you to...",
"score": 1,
"created_at": "2024-01-01T00:00:00Z"
}
]
}
Example response (500, Search Failed):
{
"success": false,
"error": "Search failed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
string[]
Array of search results ordered by relevance
id
integer
Document ID
title
string
Document title
content
string
Content preview (first 200 characters)
score
number
Relevance score (0-1)
created_at
string
Creation timestamp (ISO 8601)
Semantic search knowledge documents
requires authentication
Search documents by semantic meaning using embeddings. Finds conceptually similar content even when exact keywords don't match.
Example Usage
PWA (resources/js/pwa/knowledge-api.js) - Semantic knowledge search:
- Meaning-based search using embeddings
- Finds conceptually related content
- Offline cache support with 30-minute validity
- Automatic fallback for offline queries
Example request:
Example response (200, Success):
{
"success": true,
"data": [
{
"id": 1,
"title": "Laravel HTTP Client",
"content": "The Laravel HTTP client...",
"score": 0.95,
"created_at": "2024-01-01T00:00:00Z"
}
]
}
Example response (500, Search Failed):
{
"success": false,
"error": "Search failed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Hybrid search knowledge documents
requires authentication
Combines full-text and semantic search for optimal results. Uses keyword matching for precision and semantic similarity for recall.
Example Usage
PWA (resources/js/pwa/knowledge-api.js) - Hybrid knowledge search (default):
- Combines keyword and semantic search for best results
- Default search type in PWA knowledge interface
- Offline cache support with intelligent fallback
- Cache validity: 30 minutes
Example request:
Example response (200, Success):
{
"success": true,
"data": [
{
"id": 1,
"title": "Authentication Middleware",
"content": "Laravel middleware...",
"score": 0.98,
"created_at": "2024-01-01T00:00:00Z"
}
]
}
Example response (500, Search Failed):
{
"success": false,
"error": "Search failed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Find similar documents
requires authentication
Find documents similar to a given document based on content type and other attributes. Useful for recommendations and related content discovery.
Example request:
Example response (200, Success):
{
"success": true,
"data": [
{
"id": 2,
"title": "Laravel Routing Advanced",
"content": "Advanced routing techniques...",
"score": 0.8
}
]
}
Example response (500, Failed):
{
"success": false,
"error": "Failed to find similar documents"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
string[]
Array of similar documents
id
integer
Document ID
title
string
Document title
content
string
Content preview (first 200 characters)
score
number
Similarity score (0-1)
Create a new knowledge tag
requires authentication
Create a new tag for organizing knowledge documents. If a tag with the same name already exists, returns the existing tag.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
The created or existing tag
id
integer
Tag ID
name
string
Tag name
description
string
Tag description
color
string
Tag color
created_at
string
Creation timestamp (ISO 8601)
message
string
Success message
Add tags to a document
requires authentication
Add one or more tags to a knowledge document. Existing tags are preserved (does not replace).
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
The updated document with tags
id
integer
Document ID
title
string
Document title
tags
string[]
All tags now attached to the document
message
string
Success message
Assign document to agent
requires authentication
Make a knowledge document available to an agent for RAG context. The agent will be able to query this document's content during executions.
Example request:
Example response (200, Success):
{
"success": true,
"data": null,
"message": "Document assigned to agent successfully"
}
Example response (403, Missing Ability):
{
"success": false,
"error": "Unauthorized"
}
Example response (403, No Permission):
{
"success": false,
"error": "You do not have permission to modify this document"
}
Example response (422, Validation Failed):
{
"success": false,
"error": "Validation failed",
"errors": {
"agent_id": [
"The agent id field is required."
]
}
}
Example response (500, Failed):
{
"success": false,
"error": "Failed to assign document to agent"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
null Always null for assignment operations
message
string
Success message
Unassign document from agent
requires authentication
Remove a knowledge document from an agent's RAG context. The agent will no longer be able to query this document's content.
Example request:
Example response (200, Success):
{
"success": true,
"data": null,
"message": "Document unassigned from agent successfully"
}
Example response (403, Missing Ability):
{
"success": false,
"error": "Unauthorized"
}
Example response (403, No Permission):
{
"success": false,
"error": "You do not have permission to modify this document"
}
Example response (500, Failed):
{
"success": false,
"error": "Failed to unassign document from agent"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
null Always null for unassignment operations
message
string
Success message
Update a knowledge document
requires authentication
Update document metadata including title, description, privacy level, tags, and TTL. Content cannot be modified - create a new document for content changes.
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"id": 1,
"title": "Updated Laravel Guide",
"privacy_level": "public"
},
"message": "Knowledge document updated successfully"
}
Example response (403, Unauthorized):
{
"success": false,
"error": "You do not have permission to update this document"
}
Example response (500, Server Error):
{
"success": false,
"error": "Failed to update document"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
Updated document
message
string
Success message
Delete a knowledge document
requires authentication
Permanently delete a document, its embeddings, and associated files. This action cannot be undone.
Example request:
Example response (200, Success):
{
"success": true,
"data": null,
"message": "Knowledge document deleted successfully"
}
Example response (403, Unauthorized):
{
"success": false,
"error": "You do not have permission to delete this document"
}
Example response (500, Server Error):
{
"success": false,
"error": "Failed to delete document"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
null Always null for delete operations
message
string
Success message
List knowledge documents
requires authentication
Retrieve knowledge documents with filtering and pagination. Returns public documents and the authenticated user's private documents. Supports filtering by content type, privacy level, processing status, tags, and TTL expiration.
Example request:
Example response (200, Success):
{
"success": true,
"data": [
{
"id": 1,
"title": "Laravel Documentation",
"description": "Comprehensive Laravel guide",
"content_type": "external",
"privacy_level": "public",
"processing_status": "completed",
"url": "https://laravel.com/docs",
"domain": "laravel.com",
"tags": [
{
"id": 1,
"name": "laravel"
}
],
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
],
"meta": {
"current_page": 1,
"per_page": 50,
"total": 100
}
}
Example response (500, Server Error):
{
"success": false,
"error": "Failed to retrieve documents"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
string[]
Array of knowledge documents
id
integer
Document ID
title
string
Document title
description
string
Document description
content_type
string
Content type (text, file, external)
privacy_level
string
Privacy level (private, public)
processing_status
string
Processing status (pending, processing, completed, failed)
url
string
URL for external documents (null for others)
domain
string
Domain name for external documents
tags
string[]
Associated tags
created_at
string
Creation timestamp (ISO 8601)
updated_at
string
Last update timestamp (ISO 8601)
meta
object
Pagination metadata
List recent knowledge documents
requires authentication
Retrieve recently created knowledge documents. Returns up to 100 most recent completed documents that are either public or owned by the authenticated user. Excludes expired documents.
Example Usage
PWA (resources/js/pwa/knowledge-api.js) - Recent documents with offline support:
- Displays recently added knowledge documents
- Caches all returned documents for offline access
- Fallback to cached documents when offline
- Sorted by creation date (newest first)
Example request:
Example response (200, Success):
{
"success": true,
"data": [
{
"id": 1,
"title": "Laravel Documentation",
"content_type": "external",
"created_at": "2024-01-01T00:00:00Z"
}
]
}
Example response (500, Server Error):
{
"success": false,
"error": "Failed to retrieve recent documents"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
string[]
Array of recent documents (ordered by creation date, newest first)
Check if URL already exists
requires authentication
Check if a URL has already been added to your knowledge base. Useful for preventing duplicate document creation when importing external content.
Example request:
Example response (200, URL Exists):
{
"success": true,
"exists": true,
"document": {
"id": 1,
"title": "Laravel Documentation",
"url": "https://laravel.com/docs"
}
}
Example response (200, URL Not Found):
{
"success": true,
"exists": false,
"document": null
}
Example response (422, Missing URL):
{
"success": false,
"error": "VALIDATION_ERROR",
"message": "URL parameter is required"
}
Example response (500, Server Error):
{
"success": false,
"error": "Failed to check URL"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
exists
boolean
Whether the URL exists in your knowledge base
document
object
The existing document (null if not found)
View a knowledge document
requires authentication
Retrieve complete details for a specific knowledge document including content, metadata, tags, and embedding status.
Example Usage
PWA (resources/js/pwa/knowledge-api.js) - Document viewer with offline support:
- Retrieves full document details including content
- Automatic caching for offline access
- Staleness check (cached data valid for 30 minutes)
- Fallback to cache when offline
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"id": 1,
"title": "Laravel Documentation",
"description": "Comprehensive guide",
"content": "Laravel is a web application framework...",
"content_type": "external",
"privacy_level": "public",
"processing_status": "completed",
"url": "https://laravel.com/docs",
"embedding_status": {
"has_embeddings": true,
"chunk_count": 150,
"last_embedded_at": "2024-01-01T00:00:00Z"
},
"tags": [
{
"id": 1,
"name": "laravel"
}
],
"created_at": "2024-01-01T00:00:00Z"
}
}
Example response (403, Unauthorized):
{
"success": false,
"error": "You do not have permission to view this document"
}
Example response (500, Server Error):
{
"success": false,
"error": "Failed to retrieve document"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
Complete document details
embedding_status
object
Embedding generation status
has_embeddings
boolean
Whether embeddings exist
chunk_count
integer
Number of text chunks with embeddings
last_embedded_at
string
Last embedding generation timestamp
Download a knowledge document file
requires authentication
Download the original uploaded file for file-type documents. Only available for documents created from file uploads.
Example request:
Example response (200, Success):
(binary file download)
Example response (403, Unauthorized):
Forbidden
Example response (404, Not a File):
File not found
Example response (404, File Missing):
File not found
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get system-wide embedding status
requires authentication
Retrieve overall embedding statistics and status for all documents in the system. Shows counts of documents with/without embeddings and processing status.
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"statistics": {
"total_documents": 1000,
"documents_with_embeddings": 950,
"documents_without_embeddings": 50,
"total_chunks": 15000,
"avg_chunks_per_document": 15.8
},
"documents": [
{
"id": 1,
"title": "Laravel Guide",
"has_embeddings": true,
"chunk_count": 150
}
]
}
}
Example response (403, Missing Ability):
{
"success": false,
"error": "Unauthorized"
}
Example response (500, Failed):
{
"success": false,
"error": "Failed to retrieve embedding status"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
Embedding status data
statistics
object
System-wide embedding statistics
total_documents
integer
Total documents in system
documents_with_embeddings
integer
Documents that have embeddings
documents_without_embeddings
integer
Documents missing embeddings
total_chunks
integer
Total text chunks with embeddings
avg_chunks_per_document
number
Average chunks per document
documents
string[]
Array of documents with their embedding status
Get document embedding status
requires authentication
Retrieve embedding status for a specific document including chunk count and last generation time.
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"has_embeddings": true,
"chunk_count": 150,
"last_embedded_at": "2024-01-01T00:00:00Z",
"embedding_model": "text-embedding-ada-002"
}
}
Example response (403, Missing Ability):
{
"success": false,
"error": "Unauthorized"
}
Example response (403, No Permission):
{
"success": false,
"error": "You do not have permission to view this document"
}
Example response (500, Failed):
{
"success": false,
"error": "Failed to retrieve embedding status"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
Document embedding status
has_embeddings
boolean
Whether document has embeddings
chunk_count
integer
Number of text chunks with embeddings
last_embedded_at
string
Last embedding generation timestamp (ISO 8601)
embedding_model
string
Model used for embeddings
List all knowledge tags
requires authentication
Retrieve all knowledge tags ordered alphabetically by name.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
string[]
Array of tags ordered alphabetically
id
integer
Tag ID
name
string
Tag name
description
string
Tag description
color
string
Tag color (for UI display)
created_at
string
Creation timestamp (ISO 8601)
Get agent's available documents
requires authentication
Retrieve all knowledge documents available to an agent. Includes both directly assigned documents and documents tagged with tags assigned to the agent.
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"agent_id": 5,
"documents": [
{
"id": 1,
"title": "Laravel Guide",
"tags": [
{
"id": 1,
"name": "laravel"
}
]
}
],
"assigned_tags": [
{
"id": 1,
"name": "laravel"
}
],
"total_documents": 1
}
}
Example response (403, Missing Ability):
{
"success": false,
"error": "Unauthorized"
}
Example response (500, Failed):
{
"success": false,
"error": "Failed to retrieve agent knowledge"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
Agent knowledge data
agent_id
integer
The agent ID
documents
string[]
All documents available to the agent (direct assignments + tag-based)
assigned_tags
string[]
Tags assigned to the agent (documents with these tags are included)
total_documents
integer
Total number of unique documents available
Get knowledge base overview statistics
requires authentication
Retrieve comprehensive statistics about your knowledge documents including totals, processing status, content type breakdowns, and recent activity.
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"total_documents": 1000,
"completed_documents": 950,
"failed_documents": 10,
"processing_rate": 95,
"embedding_completion_rate": 92.5,
"content_types": {
"text": 400,
"file": 350,
"external": 250
},
"recent_activity": 45,
"embedding_service_status": {
"enabled": true,
"provider": "openai",
"model": "text-embedding-ada-002"
}
}
}
Example response (403, Missing Ability):
{
"success": false,
"error": "Unauthorized"
}
Example response (500, Failed):
{
"success": false,
"error": "Failed to retrieve statistics"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
Statistics data
total_documents
integer
Total documents owned by user
completed_documents
integer
Documents successfully processed
failed_documents
integer
Documents that failed processing
processing_rate
number
Success rate percentage (0-100)
embedding_completion_rate
number
Percentage of documents with embeddings
content_types
object
Document count by content type (text, file, external)
recent_activity
integer
Documents created in last 7 days
embedding_service_status
object
Embedding service configuration
enabled
boolean
Whether embedding service is enabled
provider
string
Embedding provider (openai, cohere, etc.)
model
string
Model name used for embeddings
Get embedding statistics
requires authentication
Retrieve detailed statistics about embedding coverage and service configuration.
Example request:
Example response (200, Success):
{
"success": true,
"data": {
"total_documents": 1000,
"documents_with_embeddings": 925,
"documents_without_embeddings": 75,
"completion_rate": 92.5,
"total_chunks": 15000,
"avg_chunks_per_document": 16.2,
"embedding_service_enabled": true,
"embedding_provider": "openai",
"embedding_model": "text-embedding-ada-002"
}
}
Example response (403, Missing Ability):
{
"success": false,
"error": "Unauthorized"
}
Example response (500, Failed):
{
"success": false,
"error": "Failed to retrieve embedding statistics"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
data
object
Embedding statistics
total_documents
integer
Total documents in system
documents_with_embeddings
integer
Documents that have embeddings
documents_without_embeddings
integer
Documents missing embeddings
completion_rate
number
Percentage with embeddings (0-100)
total_chunks
integer
Total text chunks with embeddings
avg_chunks_per_document
number
Average chunks per document
embedding_service_enabled
boolean
Whether embedding service is enabled
embedding_provider
string
Embedding provider name
embedding_model
string
Model used for embeddings
Output Actions
View execution logs and audit trails for output actions. Output actions are automated webhooks triggered by agent executions.
Use Cases
- Compliance reporting and audit trails
- Debugging failed webhook deliveries
- Monitoring action success rates
- Performance analysis
Authentication
Required token abilities:
output-action:view- View action logs and statistics
Log Retention
Logs are retained for up to 365 days and can be filtered by date range.
List execution logs for an output action
requires authentication
Retrieve paginated execution logs with filtering and statistics for a specific output action. Useful for debugging, compliance reporting, and monitoring webhook delivery success rates.
Example request:
Example response (200, Success with logs):
{
"success": true,
"action": {
"id": 1,
"name": "Slack Notification",
"type": "webhook",
"status": "active"
},
"stats": {
"total_executions": 100,
"successes": 95,
"failures": 4,
"timeouts": 1,
"success_rate": 95,
"avg_duration_ms": 245.3,
"last_executed_at": "2024-01-01T12:00:00Z",
"period_days": 30
},
"logs": {
"data": [
{
"id": 123,
"status": "success",
"response_code": 200,
"duration_ms": 234,
"executed_at": "2024-01-01T12:00:00Z"
}
],
"current_page": 1,
"per_page": 50,
"total": 100
}
}
Example response (403, Not Action Owner):
{
"success": false,
"error": "Forbidden",
"message": "You do not have permission to view this action"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
action
object
Output action details
id
integer
Action ID
name
string
Action name
type
string
Provider type (webhook, slack, email)
status
string
Action status (active, inactive)
stats
object
Execution statistics for the specified period
total_executions
integer
Total executions in period
successes
integer
Number of successful executions
failures
integer
Number of failed executions
timeouts
integer
Number of timeout executions
success_rate
number
Success percentage (0-100)
avg_duration_ms
number
Average execution duration in milliseconds
last_executed_at
string
Last execution timestamp (ISO 8601) or null
period_days
integer
Number of days included in statistics
logs
object
Paginated execution logs
data
string[]
Array of log entries
current_page
integer
Current page number
per_page
integer
Results per page
total
integer
Total number of logs
List all execution logs across all actions
requires authentication
Retrieve execution logs across all output actions owned by the authenticated user. Supports filtering by action, status, and date range.
Example request:
Example response (200, Success):
{
"success": true,
"logs": {
"data": [
{
"id": 123,
"output_action": {
"id": 1,
"name": "Slack Notification"
},
"status": "success",
"response_code": 200,
"duration_ms": 234,
"executed_at": "2024-01-01T12:00:00Z"
}
],
"current_page": 1,
"per_page": 50,
"total": 250
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
logs
object
Paginated execution logs across all actions
data
string[]
Array of log entries with nested output_action, user, and triggerable details
current_page
integer
Current page number
per_page
integer
Results per page
total
integer
Total number of logs matching filters
View a specific execution log
requires authentication
Retrieve complete details for a single output action execution log including request/response data, headers, timing information, and error details.
Example request:
Example response (200, Success):
{
"success": true,
"log": {
"id": 123,
"output_action": {
"id": 1,
"name": "Slack Notification",
"type": "webhook"
},
"user": {
"id": 10,
"name": "John Doe"
},
"triggerable": {
"type": "App\\Models\\AgentExecution",
"id": 456
},
"url": "https://hooks.slack.com/services/...",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"text": "Agent completed successfully"
},
"status": "success",
"response_code": 200,
"response_body": {
"ok": true
},
"error_message": null,
"duration_ms": 234,
"executed_at": "2024-01-01T12:00:00Z",
"created_at": "2024-01-01T12:00:00Z"
}
}
Example response (403, Not Log Owner):
{
"success": false,
"error": "Forbidden",
"message": "You do not have permission to view this log"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the request was successful
log
object
Complete log entry details
id
integer
Log entry ID
output_action
object
Output action that was executed
id
integer
Action ID
name
string
Action name
type
string
Provider type
user
object
User who triggered the action (null for system triggers)
triggerable
object
The model that triggered this action (agent execution, chat interaction, etc.)
type
string
Model class name
id
integer
Model ID
url
string
Target URL that was called
method
string
HTTP method used (POST, GET, etc.)
headers
object
Request headers sent
body
object
Request body sent
status
string
Execution status (success, failed, timeout)
response_code
integer
HTTP response code received (null on timeout)
response_body
object
Response body received (null on failure/timeout)
error_message
string
Error description (null on success)
duration_ms
integer
Execution duration in milliseconds
executed_at
string
Execution timestamp (ISO 8601)
created_at
string
Log creation timestamp (ISO 8601)
Public Access
Read-only access to publicly shared chat sessions. No authentication required - accessible to anyone with a valid share link.
Retrieve public chat session by UUID
Retrieve a chat session that has been shared publicly via its UUID. Returns the full conversation history with all interactions, sources, and metadata.
Example request:
Example response (200, Success):
{
"success": true,
"session": {
"uuid": "9d4e1c23-5f2b-4d3e-8a9c-0b1a2c3d4e5f",
"title": "My Research Session",
"shared_at": "2024-01-01T00:00:00.000000Z",
"expires_at": "2024-02-01T00:00:00.000000Z",
"interaction_count": 5,
"created_at": "2024-01-01T00:00:00.000000Z"
},
"interactions": [
{
"id": 1,
"question": "What is the capital of France?",
"answer": "Paris is the capital of France...",
"agent_name": "Research Agent",
"sources": [],
"created_at": "2024-01-01T00:00:00.000000Z"
}
]
}
Example response (404, Not found or not public):
{
"success": false,
"error": "Not Found",
"message": "This session is not publicly accessible or has expired"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Utility
Utility endpoints for URL validation, metadata extraction, and link previews. Used internally by the UI but available for API integration.
Rate Limiting
- Validation operations: 60 requests/minute
Validate URL and extract metadata
requires authentication
Validate a URL and extract rich metadata including title, description, images, and Open Graph tags. Useful for generating link previews and validating external URLs before processing.
Security: URL validation includes checks for private IP ranges, localhost, and suspicious schemes to prevent SSRF attacks.
Example request:
Example response (200, Success):
{
"valid": true,
"url": "https://example.com/article",
"title": "Example Article",
"description": "An interesting article about...",
"image": "https://example.com/og-image.jpg",
"domain": "example.com",
"metadata": {
"og:title": "Example Article",
"og:description": "An interesting article...",
"og:image": "https://example.com/og-image.jpg",
"twitter:card": "summary_large_image"
}
}
Example response (200, Invalid URL):
{
"valid": false,
"error": "Invalid URL format",
"url": "not-a-valid-url"
}
Example response (200, Unreachable URL):
{
"valid": false,
"error": "URL is not reachable",
"url": "https://nonexistent-domain-12345.com"
}
Example response (422, Validation Failed):
{
"message": "The url field is required.",
"errors": {
"url": [
"The url field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
valid
boolean
Whether the URL is valid and reachable
url
string
The validated URL (normalized)
title
string
Page title extracted from HTML or Open Graph tags
description
string
Page description from meta tags or Open Graph
image
string
Primary image URL (og:image, twitter:image, or first image)
domain
string
Domain name extracted from URL
metadata
object
Raw metadata extracted (Open Graph, Twitter Card, etc.)
error
string
Error message if validation failed (only present when valid=false)
Webhooks
Invoke input triggers via webhooks using HMAC signature authentication. Webhooks provide an alternative to API tokens for automated trigger invocation from external systems.
Authentication
Webhooks use HMAC-SHA256 signature validation instead of Sanctum tokens:
- X-Webhook-Signature: HMAC signature of request body
- X-Webhook-Timestamp: Unix timestamp (prevents replay attacks)
- X-Webhook-Nonce: Unique request identifier
Signature Generation:
payload = timestamp + ":" + nonce + ":" + request_body
signature = HMAC-SHA256(payload, secret_key)
Trigger Types
- Agent Triggers: Execute agent with webhook payload as input
- Command Triggers: Execute triggerable command with webhook parameters
Rate Limiting
- Webhook invocations: 60 requests/minute per trigger
- Ping endpoint: 120 requests/minute per trigger
Use Cases
- GitHub/GitLab webhook integration for CI/CD automation
- External system notifications triggering agent workflows
- Third-party service callbacks (payment processors, CRMs, etc.)
- Scheduled jobs from external cron services
Invoke webhook trigger
Execute an input trigger via webhook invocation. The trigger processes the webhook payload asynchronously and returns immediately with a 202 Accepted response.
Agent Triggers: Webhook payload is passed as the chat input to the agent. Command Triggers: Webhook payload parameters are mapped to command arguments.
Security: All requests must include valid HMAC signature headers or will be rejected with 401 Unauthorized. Disabled triggers return 403 Forbidden.
Example request:
Example response (202, Agent Trigger Accepted):
{
"success": true,
"message": "Webhook received and processing",
"invocation_id": "inv_abc123",
"session_id": 1,
"interaction_id": 5,
"status": "dispatched",
"status_url": "/api/status/inv_abc123",
"chat_url": "/chat/1"
}
Example response (202, Command Trigger Accepted):
{
"success": true,
"message": "Command execution dispatched",
"trigger_id": 1,
"trigger_type": "command",
"command_class": "App\\Console\\Commands\\ProcessData",
"status": "dispatched",
"queue": "research-coordinator"
}
Example response (400, Invalid Trigger Type):
{
"success": false,
"error": "Invalid Endpoint",
"message": "This trigger does not accept webhook invocations"
}
Example response (401, Invalid Signature):
{
"success": false,
"error": "Validation Failed",
"message": "HMAC signature verification failed"
}
Example response (403, Trigger Disabled):
{
"success": false,
"error": "Trigger Disabled",
"message": "This webhook endpoint is currently disabled"
}
Example response (422, Invalid Input):
{
"success": false,
"error": "Invalid Input",
"message": "Missing required parameter: repository"
}
Example response (500, Processing Failed):
{
"success": false,
"error": "Processing Failed",
"message": "An error occurred while processing the webhook"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the webhook was accepted
message
string
Human-readable status message
invocation_id
string
Unique invocation identifier (agent triggers only)
session_id
integer
Chat session ID (agent triggers only)
interaction_id
integer
Chat interaction ID (agent triggers only)
status
string
Processing status (dispatched, queued)
status_url
string
URL to check execution status (agent triggers only)
chat_url
string
URL to view chat session (agent triggers only)
trigger_id
integer
Trigger ID (command triggers only)
trigger_type
string
Trigger type (command triggers only)
command_class
string
Command class name (command triggers only)
queue
string
Queue name where job was dispatched (command triggers only)
Test webhook connectivity
Ping endpoint to verify webhook configuration and accessibility. Use this to test webhook URLs, verify trigger status, and confirm HMAC signature validation works.
Unlike the main webhook endpoint, ping does not execute the trigger or require HMAC signature validation, making it safe for testing and health checks.
Example request:
Example response (200, Success):
{
"success": true,
"message": "Webhook endpoint is reachable",
"trigger": {
"name": "GitHub Push Webhook",
"is_active": true,
"last_invoked_at": "2024-01-01T12:00:00Z"
}
}
Example response (400, Not a Webhook Trigger):
{
"success": false,
"error": "Invalid Endpoint",
"message": "This is not a webhook trigger"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
success
boolean
Indicates if the endpoint is reachable
message
string
Confirmation message
trigger
object
Trigger information
name
string
Trigger name
is_active
boolean
Whether trigger is currently active
last_invoked_at
string
Last invocation timestamp (ISO 8601, null if never invoked)