# Routing ## Round Robin Assignment - [POST /v1/routing/assign](https://developers.withlantern.com/openapi/routing/assign_object_v1_routing_assign_post.md): Assigns Salesforce objects to users using round-robin logic with pool management. ## Overview 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. ## Request Body - object: Salesforce object type to assign (lead, contact, opportunity, account) - sf_id: Salesforce ID of the object to assign - pool: Round-robin pool identifier - exclude_inactive: Whether to exclude inactive users from assignment - reset_rules: Optional reset rules for the assignment ## Reset Rules - reason: Reason for reset (e.g., 'bad_fit', 'user_request') - place_user_at_top: Optional user ID to place at top of rotation ## Response Fields - success: Boolean indicating request success - assigned_to: User ID that was assigned - sequence: Current sequence number in the rotation - pool_size: Total number of active users in the pool - timestamp: ISO timestamp of the assignment - credits_consumed: Number of credits used - credits_remaining: Credits remaining in account - processing_time_ms: Processing time in milliseconds - cached: Whether result was from cache ## Features - 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 ## Credit Usage 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