Initiate task handoff between agents
POST /api/agent-communication/handoffs/initiate
Initiate a task handoff from one agent to another.
Transfers an ongoing task or conversation with full context preservation. Ensures smooth transitions with proper state transfer and handoff tracking.
Args: request: HandoffInitiateRequest containing from_agent, to_agent, task_context, and handoff_reason
Returns:
HandoffInitiateResponse: Handoff confirmation with tracking ID.
accepted reflects whether the underlying handoff message was
successfully queued on the receiving agent; status is
"accepted" when queued, "failed" otherwise.
Raises: HTTPException(400): Hub-level validation failure (empty content, etc.). HTTPException(404): Target agent is not registered with the hub. HTTPException(500): Unexpected internal failure while routing.
Example Request: POST /handoffs/initiate { “fromAgent”: “LAGAN”, “toAgent”: “HAWKEN”, “taskContext”: {“task_id”: “task_456”, “status”: “in_progress”}, “handoffReason”: “Requires code expertise” }
Example Response: { “status”: “accepted”, “handoffId”: “handoff_abc123def456”, “accepted”: true, “timestamp”: “2026-04-19T10:30:00+00:00” }
Request Body required
Section titled “Request Body required ”Request model for initiating agent handoff.
Transfers an ongoing task or conversation from one agent to another with full context preservation and handoff reasoning.
Fields: from_agent: Agent initiating the handoff to_agent: Agent receiving the handoff task_context: Complete task state and history handoff_reason: Reason for the handoff priority: Handoff priority level
JSON Example: { “fromAgent”: “LAGAN”, “toAgent”: “HAWKEN”, “taskContext”: {“task_id”: “task_456”, “status”: “in_progress”}, “handoffReason”: “Requires creative expertise”, “priority”: “high” }
Used By: - POST /api/agent-communication/handoffs/initiate - Agent handoff workflows - Task routing system
object
Source agent ID
Target agent ID
Task context and state
object
Handoff reasoning
Handoff priority
Responses
Section titled “ Responses ”Successful Response
Handoff initiation response model.
Provides confirmation and tracking information for agent handoff operations. Includes handoff ID, acceptance status, and timestamp.
Fields:
status: Operation status (success/error)handoff_id: Unique handoff identifier for trackingaccepted: Boolean indicating whether handoff was acceptedtimestamp: ISO 8601 timestamp of handoff initiation
Usage: POST /api/agent-communication/handoffs/initiate returns this response model.
JSON Example:
{
"status": "success",
"handoffId": "handoff_123",
"accepted": true,
"timestamp": "2025-01-31T10:30:00Z"
}object
Operation status
Unique handoff identifier
Whether handoff was accepted
ISO timestamp of handoff initiation
Validation Error