Marketplace API Reference
This document provides a comprehensive reference for the Marketplace API endpoints, which enable browsing, installing, and managing marketplace items (agents, recipes, plugins, and tools). For information about plugin architecture and content structure, see 5.1 Plugin Architecture. For the upload and security scanning workflow, see 5.2 Plugin Upload & Security.
Purpose and Scope
The Marketplace API exposes REST endpoints for:
Browsing marketplace items by type, category, and search query
Installing items to workspaces (agents, recipes, plugins)
Submitting items for marketplace approval
Managing approvals (admin-only)
Plugin lifecycle (workspace enablement, agent assignment)
All endpoints are authenticated via hybrid authentication (Clerk JWT + API keys) and enforce workspace isolation.
Sources: orchestrator/api/marketplace.py:1-30
Marketplace API Architecture
The marketplace system uses a single-table architecture where agents and recipes are stored in their respective tables with owner_type discriminator fields ('workspace' vs 'marketplace'). Plugins use a dedicated marketplace_plugins table with S3 storage.
Sources: orchestrator/api/marketplace.py:1-311, frontend/components/marketplace/marketplace-homepage.tsx:1-156, orchestrator/core/models/core.py:86-185
Core Marketplace Endpoints
GET /api/marketplace/items
List and filter marketplace items across all types.
Query Parameters:
type
string
Filter by item type
agent, recipe, skill, llm, tool
category
string
Filter by category
DevOps, Customer Support
search
string
Search in name/description
code review
featured
boolean
Show only featured items
true
limit
integer
Max items to return (1-100)
50
offset
integer
Pagination offset
0
Response Model:
Implementation Details:
The endpoint queries both agents and workflow_templates tables with owner_type = 'marketplace', merges results, and applies global pagination when fetching multiple types.
Sources: orchestrator/api/marketplace.py:122-309, orchestrator/api/marketplace.py:53-80
GET /api/marketplace/items/{id}
Retrieve detailed information about a specific marketplace item, including dependencies.
Response Model:
Agent Metadata Enrichment:
For agents, the backend enriches metadata with:
Tool names and icons from
agent_tool_assignmentsjoined withcomposio_apps_cacheSkill details from
agent_skillsrelationshipModel configuration from
model_configJSON field
Sources: orchestrator/api/marketplace.py:311-450, frontend/components/marketplace/marketplace-item-modal.tsx:39-61
POST /api/marketplace/items/{id}/install
Install a marketplace item to the current workspace. Creates a clone with workspace ownership.
Request Body: None (uses path parameter)
Response:
Installation Flow:
Sources: orchestrator/api/marketplace.py:453-624
POST /api/marketplace/submit
Submit an item to the marketplace for approval. Converts workspace-owned items to marketplace items.
Request Body:
Submission Workflow:
Verify workspace ownership of the original item
Create marketplace clone with
owner_type = 'marketplace'Set approval status to
pending(requires admin approval)Preserve creator info via
original_creator_idReturn submission ID for tracking
Sources: orchestrator/api/marketplace.py:626-768, orchestrator/api/marketplace.py:100-117
POST /api/marketplace/items/{id}/approve
Admin-only endpoint to approve pending marketplace items.
Request Body: None
Response:
Approval Logic:
Sources: orchestrator/api/marketplace.py:770-810, orchestrator/api/marketplace.py:43-47
DELETE /api/marketplace/items/{id}
Admin-only endpoint to remove items from marketplace (soft delete by setting owner_type back to workspace).
Sources: orchestrator/api/marketplace.py:812-855
Plugin-Specific Endpoints
GET /api/marketplace/plugins
List approved marketplace plugins with pagination and filtering.
Query Parameters:
category_id
UUID
Filter by category UUID
search
string
Search in name/description
approval_status
string
Filter by approval status (approved, pending, rejected)
limit
integer
Max plugins to return (1-100)
offset
integer
Pagination offset
Response Model:
Sources: orchestrator/api/marketplace_plugins.py:1-150 (referenced in main.py imports)
POST /api/workspaces/{workspace_id}/plugins
Enable a marketplace plugin for a workspace (adds to workspace_enabled_plugins junction table).
Request Body:
Response:
Sources: orchestrator/api/workspace_plugins.py:1-100 (referenced in main.py imports)
GET /api/agents/{agent_id}/plugins
List plugins assigned to a specific agent.
Response:
Sources: orchestrator/api/agent_plugins.py:69-125
PUT /api/agents/{agent_id}/plugins
Update (replace) plugin assignments for an agent.
Request Body:
Assignment Logic:
Validate all plugins are enabled for the agent's workspace
Delete existing assignments for this agent
Create new assignments with priority based on array order
Commit transaction atomically
Sources: orchestrator/api/agent_plugins.py:127-209
GET /api/agents/{agent_id}/assembled-context
Retrieve the fully assembled agent context including persona prompt, plugin content, and tool definitions.
Response Model:
Context Assembly Process:
Sources: orchestrator/api/agent_plugins.py:211-338, orchestrator/core/services/plugin_context_service.py:1-200 (referenced)
Database Models Reference
MarketplacePlugin
Sources: orchestrator/core/models/marketplace_plugins.py:50-118
WorkspaceEnabledPlugin
Junction table linking workspaces to enabled plugins.
Sources: orchestrator/core/models/marketplace_plugins.py:183-200
AgentAssignedPlugin
Junction table linking agents to assigned plugins with priority ordering.
Sources: orchestrator/core/models/marketplace_plugins.py:203-225
Common API Workflows
Browse and Install an Agent
Sources: frontend/components/marketplace/marketplace-agents-tab.tsx:82-146, orchestrator/api/marketplace.py:453-624
Enable Plugin for Agent
Sources: orchestrator/api/agent_plugins.py:127-209, orchestrator/api/workspace_plugins.py:1-100 (referenced)
Error Handling
All marketplace endpoints return consistent error responses:
400
Bad request (invalid parameters)
"Plugins not enabled for workspace: uuid1, uuid2"
403
Forbidden (admin-only endpoint)
"Admin access required"
404
Item not found
"Agent not found"
409
Conflict (already installed)
"Item already installed in workspace"
500
Internal server error
"Failed to install marketplace item"
Sources: orchestrator/api/marketplace.py:43-47, orchestrator/api/agent_plugins.py:85-90
Authentication and Authorization
All marketplace endpoints use hybrid authentication via get_request_context_hybrid:
Admin Check:
Sources: orchestrator/api/marketplace.py:36-47, orchestrator/core/auth/hybrid.py:1-200 (referenced)
Frontend Integration Examples
Using the Marketplace API in React
Sources: frontend/components/marketplace/marketplace-agents-tab.tsx:93-98, frontend/hooks/use-marketplace-api.tsx:1-100 (referenced)
Rate Limiting and Performance
The marketplace API implements caching strategies:
Plugin content caching in Redis with 3600s TTL
Database query optimization via indexes on
owner_type,approval_statusPagination to limit response sizes (max 100 items per request)
Lazy loading of dependencies (only fetched on detail views)
Sources: orchestrator/core/services/plugin_context_service.py:1-200 (referenced), orchestrator/api/marketplace.py:122-309
Last updated

