Create a free Sulus US number:
curl -X POST "https://api.sulus.ai/phone-number" \
-H "Authorization: Bearer $SULUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "sulus",
"assistantId": "your-assistant-id",
"numberDesiredAreaCode": "415"
}'
TypeScript:
const res = await fetch('https://api.sulus.ai/phone-number', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SULUS_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
provider: 'sulus',
assistantId: 'your-assistant-id',
numberDesiredAreaCode: '415',
}),
});
const phoneNumber = await res.json();
console.log(phoneNumber.id);
Python:
import os, requests
res = requests.post(
"https://api.sulus.ai/phone-number",
headers={
"Authorization": f"Bearer {os.getenv('SULUS_API_KEY')}",
"Content-Type": "application/json",
},
json={
"provider": "sulus",
"assistantId": "your-assistant-id",
"numberDesiredAreaCode": "415",
},
timeout=30,
)
phone_number = res.json()
print(phone_number["id"])