Deploy your first subagent
One API call. One prompt. That’s all it takes.
curl -X POST https://api.ploton.ai/v1/subagents \
-H "Authorization: Bearer $PLOTON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "crm-agent",
"prompt": "Handle CRM tasks. Connect Salesforce, HubSpot, and Pipedrive. Manage OAuth, pull contacts, sync deals, export data."
}'{
"id": "crm-agent",
"tools_available": 14,
"status": "deployed"
}Your subagent is live. It has 14 CRM-related tools ready to go.
Writing subagent prompts
The prompt defines the subagent’s domain. Be specific about what it should handle.
Good prompts
Handle CRM tasks. Connect Salesforce, HubSpot, and Pipedrive.
Manage OAuth, pull contacts, sync deals, export data.Handle billing and payments. Process refunds via Stripe,
generate invoices, manage subscriptions, route approvals
to managers via Slack.Handle image and video processing. Generate images,
remove backgrounds, convert formats, resize for social
media, extract text from PDFs.Bad prompts
Handle everything for the user.Too broad. A subagent that does everything is just a worse version of no subagents.
CRMToo vague. Ploton doesn’t know which services you need or what operations to support.
Best practices
- One domain per subagent. A CRM subagent handles CRM. A billing subagent handles billing. Don’t mix domains.
- Name the services. “Connect Salesforce, HubSpot, and Pipedrive” is better than “connect to CRM services.”
- List the operations. “Pull contacts, sync deals, export data” tells Ploton exactly what tools to make available.
Add to your agent’s system prompt
After deploying subagents, list them in your agent’s system prompt:
You have access to these Ploton subagents:
- crm-agent: CRM and sales data
- billing-agent: Payments and invoices
- media-agent: Image and video processing
When a request needs capabilities you don't have,
delegate to the relevant subagent.
If no subagent fits, decline the request.Your agent reads this list and decides which subagent handles each request.
Route tasks
When your agent decides to delegate, it sends a task with the sub_agent parameter:
curl -X POST https://api.ploton.ai/v1/tasks \
-H "Authorization: Bearer $PLOTON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Pull all open deals from Salesforce for user_123",
"sub_agent": "crm-agent",
"user_id": "user_123"
}'The subagent handles the rest — auth, tool selection, workflow, error recovery.
Managing subagents
List subagents
curl https://api.ploton.ai/v1/subagents \
-H "Authorization: Bearer $PLOTON_API_KEY"Get a subagent
curl https://api.ploton.ai/v1/subagents/crm-agent \
-H "Authorization: Bearer $PLOTON_API_KEY"Update a subagent
curl -X PATCH https://api.ploton.ai/v1/subagents/crm-agent \
-H "Authorization: Bearer $PLOTON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Handle CRM tasks. Connect Salesforce, HubSpot, Pipedrive, and Zoho. Manage OAuth, pull contacts, sync deals, export data, manage pipelines."
}'Delete a subagent
curl -X DELETE https://api.ploton.ai/v1/subagents/crm-agent \
-H "Authorization: Bearer $PLOTON_API_KEY"Testing subagents
Use mode: "test" to verify routing without executing:
curl -X POST https://api.ploton.ai/v1/tasks \
-H "Authorization: Bearer $PLOTON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Pull contacts from Salesforce created this month",
"sub_agent": "crm-agent",
"user_id": "user_123",
"mode": "test"
}'{
"id": "task_test_abc",
"status": "complete",
"mode": "test",
"sub_agent": "crm-agent",
"validation": {
"tools_selected": ["salesforce"],
"planned_steps": ["authenticate", "fetch_contacts", "filter_by_date"],
"estimated_duration_ms": 1200
}
}Test mode runs tool selection and workflow planning without making real API calls.
Pre-built subagents
Ploton ships pre-built subagents for common domains. These come with tool knowledge and execution memory already built in. Use them directly, or deploy your own custom subagents.
To see available pre-built subagents:
curl https://api.ploton.ai/v1/subagents?type=prebuilt \
-H "Authorization: Bearer $PLOTON_API_KEY"Next steps
- Subagents — How subagents work under the hood
- Prompt Engineering — Write task prompts that get reliable results
- REST API — Full endpoint reference