Outbound Calling is not picking system prompt
# support
m
When trying a outbound call with vapi api POST - https://api.vapi.ai/call/phone its not picking the system prompt
v
Hi @mukul, 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 Calling]() * [Outbound Calls from Python]() * [Create Phone Call]() * [Web Calling]() -----------------------------
### Answer To ensure the system prompt is properly set for your outbound call with Vapi, make sure your API request includes the
assistant
object configuration with the appropriate
model
and
messages
. Here's an example of how to structure your request:
Copy code
python
import requests

# Your Vapi API Authorization token
auth_token = '<YOUR AUTH TOKEN>'
# The Phone Number ID, and the Customer details for the call
phone_number_id = '<PHONE NUMBER ID FROM DASHBOARD>'
customer_number = "+14151231234"

# 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,
    'customer': {
        'number': customer_number,
    },
}

# 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)
[(1)]() Ensure that the
messages
field within the
model
object includes the system prompt you want to use. If the issue persists, double-check the prompt configuration and ensure all necessary fields are correctly populated.
Glad I could be helpful. Feel free to create a new thread with any new questions you may have.
4 Views