Conversation Events Guide
This guide explains how to use Popp AI's conversation webhooks to receive real-time updates about your conversations with candidates.
Overview
Webhooks allow your application to receive automatic notifications when specific events occur in your Popp AI conversations. Each webhook event includes information about what happened and relevant conversation data.
Event Structure
Every webhook event follows this structure:
{
"event": "string",
"data": {
"recordId": "string",
"organizationId": "string",
"conversationStatus": "COMPLETED_SCREENING_FAILED" | "COMPLETED_SCREENING_PASSED",
"scorecardTotalValue": number | null,
"externalId": string | null,
"participantLastName": string | null,
"participantFirsName": string | null,
"externalCampaignId": string | null,
"screeningQuestionsOutcome": [
{
"questionOutcome": "PASSED" | "FAILED",
"screeningQuestion": "string",
"responseSummary": "string"
}
]
}
}Where:
event: Identifies the type of event that occurreddata.recordId: Unique identifier for the specific conversationdata.organizationId: Your organization's unique identifier
Available Events
1. Conversation Started
Event Name: CONVERSATION_STARTED
Triggered when a new conversation begins with a candidate. This event fires when the initial message is successfully sent to the candidate.
2. Conversation Completed
Event Name: CONVERSATION_COMPLETED
Triggered when a conversation with a candidate reaches its conclusion. After receiving this event, you can use the Get Conversation endpoint to retrieve detailed information about the conversation outcome.
The conversation can have different statuses:
COMPLETED_SCREENING_PASSED: Candidate has passed the screeningCOMPLETED_SCREENING_FAILED: Candidate has not met the screening criteriaCLOSED: Conversation was closed for other reasons
For conversations with status COMPLETED_SCREENING_PASSED or COMPLETED_SCREENING_FAILED, you can access the screening results in the screeningQuestionsOutcome field of the conversation response.
3. Conversation Needs Review
Event Name: CONVERSATION_NEEDS_REVIEW
Triggered when the Popp conversation engine identifies that human intervention is needed. Common scenarios include:
- The candidate asks a question that the AI cannot confidently answer
- Complex situations requiring human judgment
- Unusual or unexpected responses that need verification
Implementation Example
Here's a basic example of how to handle these webhook events:
app.post('/webhooks/popp', (req, res) => {
const { event, data } = req.body;
switch (event) {
case 'CONVERSATION_STARTED':
// Handle new conversation
console.log(`New conversation started: ${data.recordId}`);
break;
case 'CONVERSATION_COMPLETED':
// Fetch conversation details
const conversation = await poppApi.getConversation(data.recordId);
// Process completion status
handleCompletedConversation(conversation);
break;
case 'CONVERSATION_NEEDS_REVIEW':
// Alert relevant team members
notifyReviewTeam(data.recordId);
break;
}
res.status(200).send('Webhook received');
});Best Practices
-
Acknowledge Quickly
- Return a 200 status code as soon as you receive the webhook
- Process the event asynchronously if needed
-
Handle Retries
- Implement idempotency checks using the recordId
-
Monitoring
- Log webhook events for debugging
- Set up alerts for failed webhook processing
- Monitor webhook latency
Troubleshooting
Common issues and solutions:
-
Missing Events
- Verify your webhook endpoint is accessible
- Check your webhook logs for failed deliveries
- Ensure your endpoint consistently returns 200 status codes
-
Processing Errors
- Log the full event data for debugging
- Implement error handling for the
getConversationAPI calls - Set up monitoring for webhook processing failures
Need Help?
If you encounter any issues or need additional assistance:
- Review your webhook logs
- Check your API credentials
- Contact Popp AI support with specific event details
Remember to include your organizationId and relevant recordId values when seeking support.
Updated 3 months ago
