Testing Dynamic Variables
# support
r
How to test dynamic variables in web calls ?
v
To test dynamic variables in Vapi web calls, you can use the chat endpoint instead of making actual calls. According to the documentation, this is a recommended approach for testing:
Copy code
javascript
// Example of testing dynamic variables with the chat endpoint
$.ajax({
  url: 'https://api.vapi.ai/chat', // Use chat endpoint for testing
  type: 'POST',
  contentType: 'application/json',
  data: JSON.stringify({
    assistantId: "your-assistant-id",
    assistantOverrides: {
      variableValues: {
        name: "TestUser" // Your dynamic variable
      }
    }
  })
});
Additional information about the chat endpoint can be found at: https://staging-api.vapi.ai/api-extended#/ Sources: - [Discord](https://discord.com/channels/1211482211119796234/1333853589965377587) - [Dynamic Variables](https://docs.vapi.ai/assistants/dynamic-variables)
k
pass them through assistantOverrides.variableValues when starting the call with the Web SDK.