endless-jadeE

Can't add variable to workflows or assistants

Hi y'all,

I tried creating a call with the following request

const response = await fetch('https://api.vapi.ai/call', {
method: 'POST',
headers: {
Authorization: Bearer ${process.env.VAPI_API_KEY},
'Content-Type': 'application/json',
},
body: JSON.stringify({
workflowId: '82e77365-c659-4c39-9d91-9f87f26ca433',
phoneNumberId: 'c0875f04-3617-40b9-9d11-558980699222',
customer: { number: from },
workflowOverrides: {
variableValues: {
clinicName,
},
},
}),
});


But it doesn't seem to pass the variable clinicName to the workflow, even though I tag it as {{clinicName}} in the workflow.

Not sure why this is happening, given I already did exactly what the documentation at https://docs.vapi.ai/api-reference/calls/create is instructing.

I can, however, manually input the variable on the website before the call. But that's just a one off and not dynamic.

The same problem goes for assistantId and assistantOverrides when I try to use an assistant.

Could any be so kind as to help me out with this : )

Thanks,
Andy
Was this page helpful?