Skip to main content
Use start_outbound_call() to dial any phone number and connect it to your agent.

Basic Call

from smallestai.atoms import AtomsClient

client = AtomsClient()

response = client.start_outbound_call(
    conversation_outbound_post_request={
        "agentId": "your-agent-id",
        "phoneNumber": "+14155551234"
    }
)

conversation_id = response.data.conversation_id
print(f"Call started: {conversation_id}")

Parameters

ParameterTypeRequiredDescription
agentIdstringYesID of your agent (from dashboard)
phoneNumberstringYesE.164 format phone number
Phone numbers must be in E.164 format: +[country code][number]Examples: +14155551234 (US), +919876543210 (India)

Response

# response.data.conversation_id = "CALL-1767900635803-8a3bee"
FieldTypeDescription
conversation_idstringUnique ID to track this call
Save this ID to retrieve transcripts and analytics later.

Error Handling

try:
    response = client.start_outbound_call(
        conversation_outbound_post_request={
            "agentId": "agent-123",
            "phoneNumber": "+14155551234"
        }
    )
    print(f"Call started: {response.data.conversation_id}")
    
except Exception as e:
    error = str(e)
    
    if "Invalid agent id" in error:
        print("Error: Agent not found. Check your agent ID.")
    elif "Invalid phone" in error:
        print("Error: Invalid phone number. Use E.164 format.")
    elif "401" in error:
        print("Error: Check your API key.")
    else:
        print(f"Error: {error}")

Tips

Use a library like phonenumbers to validate before calling. Invalid numbers waste API calls.
Wait 5-10 seconds between calls to avoid rate limits.
Save them in your database to retrieve transcripts later.
Wrap calls in try/except and log failures for retry.