Assigns Salesforce objects to users using round-robin logic with pool management.
The Round Robin Assignment API provides intelligent assignment of Salesforce objects (leads, contacts, opportunities, accounts) to users based on configurable pools and rotation rules. It supports inactive user exclusion, reset rules, and maintains sequence tracking for fair distribution.
object: Salesforce object type to assign (lead, contact, opportunity, account)sf_id: Salesforce ID of the object to assignpool: Round-robin pool identifierexclude_inactive: Whether to exclude inactive users from assignmentreset_rules: Optional reset rules for the assignment
reason: Reason for reset (e.g., 'bad_fit', 'user_request')place_user_at_top: Optional user ID to place at top of rotation
success: Boolean indicating request successassigned_to: User ID that was assignedsequence: Current sequence number in the rotationpool_size: Total number of active users in the pooltimestamp: ISO timestamp of the assignmentcredits_consumed: Number of credits usedprocessing_time_ms: Processing time in millisecondscached: Whether result was from cache
- Pool Management: Organize users into assignment pools
- Sequence Tracking: Maintains rotation sequence for fair distribution
- Inactive User Exclusion: Automatically excludes inactive users
- Reset Rules: Support for resetting rotation with specific reasons
- Fair Distribution: Ensures equal distribution across active users
- Audit Trail: Timestamps and sequence tracking for compliance
Round Robin assignment consumes credits based on complexity:
- Basic Assignment: 1 credit per assignment
- With Reset Rules: +1 credit for reset operations
- Pool Management: +0.5 credits for pool size calculation
Security
BearerAuth
Salesforce object type to assign
Enum:"lead""contact""opportunity""account"
Whether to exclude inactive users from assignment
Default:true
- Lantern API serverhttps://api-gateway.agenthq.withlantern.com/v1/routing/assign
- Local API serverhttp://localhost:8000/v1/routing/assign
curl -i -X POST \
https://api-gateway.agenthq.withlantern.com/v1/routing/assign \
-H 'Authorization: Bearer <YOUR_ApiToken_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"object": "lead",
"sf_id": "string",
"pool": "string",
"exclude_inactive": true,
"reset_rules": {
"reason": "string",
"place_user_at_top": "string"
}
}'Success Response
Response
{ "success": true, "assigned_to": "005xx0002ABCDE", "sequence": 1245, "pool_size": 17, "timestamp": "2025-09-18T16:12:00Z", "credits_consumed": 1, "processing_time_ms": 450, "cached": false }