In the API documentation the create a call page ne...
# support
t
Hey I'm trying to look at the API documentation for creating a call but whenever I try and load that page it never works. All the other works fine. Is there any way to see the page?
v
Hi @Tinjira, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Outbound Calls from Python]() * [Create Assistant]() * [Create Phone Call]() * [Tools Calling]() -----------------------------
### Answer You can find the information about creating a phone call using the Vapi API in the available documentation. Here is a direct code example for creating a phone call:
Copy code
python
import requests

# Your Vapi API Authorization token
auth_token = '<YOUR AUTH TOKEN>'

# Create the header with Authorization token
headers = {
    'Authorization': f'Bearer {auth_token}',
    'Content-Type': 'application/json',
}

# Create the data payload for the API request
data = {
    'assistant': {
        "firstMessage": "Hey, what's up?",
        "model": {
            "provider": "openai",
            "model": "gpt-3.5-turbo",
            "messages": [
                {
                    "role": "system",
                    "content": "You are an assistant."
                }
            ]
        },
        "voice": "jennifer-playht"
    },
    'phoneNumberId': '<PHONE NUMBER ID FROM DASHBOARD>',
    'customer': {
        'number': '+14151231234',
    },
}

# Make the POST request to Vapi to create the phone call
response = requests.post(
    'https://api.vapi.ai/call/phone', headers=headers, json=data)

# Check if the request was successful and print the response
if response.status_code == 201:
    print('Call created successfully')
    print(response.json())
else:
    print('Failed to create call')
    print(response.text)
For detailed API references, you can explore [Create Phone Call]() and view more examples in [Outbound Calls from Python]() [(1)]() [(2)]() .
Glad I could be helpful. Feel free to create a new thread with any new questions you may have.
s
yes, something up. mintlify looking into it. for now: api.vapi.ai/api
5 Views