Developers
Prebuilt Agent Integration Guide
This guide documents the API standards required for custom Agents to integrate with the DuploCloud AI HelpDesk. By following these standards, your Agent can leverage HelpDesk features like Terminal command execution, browser interactions, and file operations.
Agent API Requirements
All custom Agents must expose a chat endpoint:
POST /api/sendMessageThis endpoint handles message exchanges between your Agent and Service Desk, supporting contextual information and specialized response types.
Request Format
Request from HelpDesk to Agent
The HelpDesk sends a flat array of messages where the last message is the current user request. All previous messages provide conversation context.
{
"messages": [
{
"role": "user" | "assistant",
"content": "Message text content",
"platform_context": {
// only for user messages
},
"data": {
// Structured data exchanges
},
"timestamp": "2025-05-20T18:00:46.123456Z"
}
// ... more messages
]
}Field Descriptions
messages (array, required)
Flat array of all conversation messages
Last element is the current message
Follows OpenAI/Anthropic conversation format
role (string, required)
"user": Message from user to Agent"assistant": Message from Agent to user
content (string, required)
Human-readable message text
Empty string for pure approval/rejection messages
platform_context (object, only for user messages)
Environment-specific configuration and credentials
Set by HelpDesk
Example:
data (object, required)
Structured data for commands, URLs, and other actions
Contains
cmds,executed_cmds, andurl_configsarrays
timestamp (string, optional)
formatted timestamp
Response Format
Response from Agent to HelpDesk
Capability-Specific Formats
Terminal Commands
Agents can provide Terminal commands for user approval and execution through a human-in-the-loop workflow.
Command Proposal (Agent → User)
Command Fields
command (string, required)
The shell command to execute
execute (boolean, required)
false: Command proposed by Agent, awaiting approvaltrue: Command approved by user
files (array, optional)
Files to create before command execution
Each file object contains:
file_path: Relative path where file should be createdfile_content: Content of the file
rejection_reason (string, optional in user response)
User's reason for rejecting a command (when execute=false)
Terminal Command Workflow
1. Agent Proposes Commands
Agent suggests commands with execute: false:
2. User Approves/Rejects Commands
When the user responds, they send back commands with updated execute status:
3. User can send Executed Commands to the agent
In the next request, the user can also share commands and outputs executed by him on his own in a shared user terminal to the agent:
4. Agent Analyzes and Responds
The agent can share the commands it executed to the user via the executed_cmds array.
User-Initiated Commands
Users can run their own terminal commands between agent messages. These appear in the next user message:
File Operations with Commands
For commands requiring file creation (e.g., Helm charts, configurations):
Browser Actions
Agents can direct users to web resources:
Complete Workflow Example
Here's a full conversation flow showing all capabilities:
Best Practices
Use Platform Context: Always use provided platform context values instead of hardcoded values
Clear Explanations: Provide clear explanations with suggested actions
Human-in-the-Loop: Set
execute: falsefor commands requiring approvalMaintain State: Include your executed commands in responses to maintain context
Progressive Disclosure: Start with diagnostic commands before suggesting changes
Analyze Outputs: Always analyze command outputs and provide insights
Thread Consistency: Return the same thread_id received in the request
Handle Rejections: Respect command rejections and adjust your approach
Symmetric Patterns: Use
executed_cmdsconsistently for sharing command results
Last updated
Was this helpful?

