vapi.calls.create

I have a very simple test program which was working before and now is not:

import { VapiClient } from "@vapi-ai/server-sdk";

const VAPI_API_KEY = "VAPI_API_KEY";

const vapi = new VapiClient({
token: VAPI_API_KEY,
});

const assistant_id = "ASSISTANT_ID";
const phone_number_id = "PHONE_NUMBER_ID";
const phone_number = '+1xxxxxxxxxx';

async function makeOutboundCall(assistant_id, phone_number_id, phone_number, selected_specialist, referring_practice) {
try {
const call = await vapi.calls.create({
assistant: {
assistantId: assistant_id,
},
phoneNumberId: phone_number_id,
customer: {
number: phone_number,
},
assistantOverrides: {
variableValues: {
selected_specialist: selected_specialist,
referring_practice: referring_practice,
},
},
});
console.log("Call initiated:", call.id);
return call;
} catch (error) {
console.error("Error initiating call:", error);
}
}

const call = makeOutboundCall(assistant_id, phone_number_id, phone_number);
console.log(call);


This is almost directly taken from examples, and was working up until very recently. Now it gives a 400 error with the following message:

'assistant.property assistantId should not exist'

Which makes no sense looking at the documentation because assistantId is clearly required.

I've tried it multiple times but one timestamp is 'Tue, 15 Jul 2025 14:09:14 GMT'

I am not getting a call id back because it isn't getting queued.
Was this page helpful?