Create a question with text-to-speech audio generation:
cURL
JavaScript
Python
curl -X POST https://api.prod.qualifi.hr/qsi/gather/questions \ -H "x-api-key: ${API_KEY}" \ -H "Content-Type: application/json" \ -d '{ "title": "Tell me about yourself", "questionScript": "Tell me about yourself and your background.", "generateAudio": true }'
const response = await fetch('https://api.prod.qualifi.hr/qsi/gather/questions', { method: 'POST', headers: { 'x-api-key': apiKey, 'Content-Type': 'application/json' }, body: JSON.stringify({ title: 'Tell me about yourself', questionScript: 'Tell me about yourself and your background.', generateAudio: true })});const question = await response.json();console.log('Question created:', question.data);
response = requests.post( 'https://api.prod.qualifi.hr/qsi/gather/questions', headers={ 'x-api-key': api_key, 'Content-Type': 'application/json' }, json={ 'title': 'Tell me about yourself', 'questionScript': 'Tell me about yourself and your background.', 'generateAudio': True })question = response.json()print('Question created:', question['data'])
Audio generation is asynchronous. The initial response includes the question, and the audioUrl will be populated when audio generation completes. You can use webhooks to be notified when audio is ready.