How to log user and assistant messages ?
# support
s
Hi i’ve setup a fastapi route at /api/vapi/log-conversation to log user and assistant messages. I’d like to reciever every interaction (including transcript and reply) on this endpoint. Can you confirm where in the assistant settings i can add my event callbackurl, or if there’s a best practice to enable webhook logging for full transcription and assistant. I an using ptthon for backend and FASTapi framework Also using ngrok Using mongoDB for logging data
k
Set your FastAPI /API/vapi/log-conversation URL as a webhook in Vapi’s Integrations, subscribe to message and end-of-call-report events, and use them to log each interaction and full transcript into MongoDB via your backend..
s
Please guide me through it cause i am unable to fine where exactly to put it
p
Hey Steve you can use these 4 server messages to best of your use transcript - Sends real-time transcription data as users and assistants speak, including both partial (live typing effect) and final (completed sentence) transcripts with speaker identification. end-of-call-report - Delivers the complete call summary after the conversation ends, containing the full transcript, call analytics, costs, duration, recording URLs, and ending reason - your primary data source for MongoDB storage. status-update - Notifies you of call lifecycle changes (call started, in-progress, ended, failed) allowing you to track call states, measure durations, and trigger different logging behaviors based on call status. conversation-update - Provides updates about conversation flow and context changes during the call, helping you monitor conversation progression, track topic shifts, and maintain session state for analytics
Copy code
[
  "transcript",
  "end-of-call-report",
  "status-update",
  "conversation-update"
]
s
Thanks for the hepl it’s working