[{"data":1,"prerenderedAt":3266},["ShallowReactive",2],{"navigation_docs_en":3,"-en-api-guides-sync-calls-crm":705,"-en-api-guides-sync-calls-crm-surround":3261},[4,8,26,52,101,131,181,219,237,247,269,291,562,572,612,661,691],{"title":5,"path":6,"stem":7},"Introduction","\u002Fen\u002Fintroduction","en\u002F01.introduction",{"title":9,"path":10,"stem":11,"children":12},"Getting started","\u002Fen\u002Fgetting-started","en\u002F02.getting-started\u002Findex",[13,14,18,22],{"title":9,"path":10,"stem":11},{"title":15,"path":16,"stem":17},"Initial setup","\u002Fen\u002Fgetting-started\u002Finitial-setup","en\u002F02.getting-started\u002F01.initial-setup",{"title":19,"path":20,"stem":21},"Create your first agent","\u002Fen\u002Fgetting-started\u002Ffirst-agent","en\u002F02.getting-started\u002F02.first-agent",{"title":23,"path":24,"stem":25},"Run a test call","\u002Fen\u002Fgetting-started\u002Ftest-call","en\u002F02.getting-started\u002F03.test-call",{"title":27,"path":28,"stem":29,"children":30},"Concepts","\u002Fen\u002Fconcepts","en\u002F03.concepts\u002Findex",[31,32,36,40,44,48],{"title":27,"path":28,"stem":29},{"title":33,"path":34,"stem":35},"Voice agent","\u002Fen\u002Fconcepts\u002Fagent","en\u002F03.concepts\u002F01.agent",{"title":37,"path":38,"stem":39},"Flow","\u002Fen\u002Fconcepts\u002Fflow","en\u002F03.concepts\u002F02.flow",{"title":41,"path":42,"stem":43},"Runtime","\u002Fen\u002Fconcepts\u002Fruntime","en\u002F03.concepts\u002F03.runtime",{"title":45,"path":46,"stem":47},"Organization and permissions","\u002Fen\u002Fconcepts\u002Forganization","en\u002F03.concepts\u002F04.organization",{"title":49,"path":50,"stem":51},"Prompt Builder","\u002Fen\u002Fconcepts\u002Fprompt-builder","en\u002F03.concepts\u002F05.prompt-builder",{"title":53,"path":54,"stem":55,"children":56},"Guides","\u002Fen\u002Fguides","en\u002F04.guides\u002Findex",[57,58,61,65,69,73,77,81,85,89,93,97],{"title":53,"path":54,"stem":55},{"title":19,"path":59,"stem":60},"\u002Fen\u002Fguides\u002Fcreate-first-agent","en\u002F04.guides\u002F01.create-first-agent",{"title":62,"path":63,"stem":64},"Use the Flow Builder","\u002Fen\u002Fguides\u002Fuse-flow-builder","en\u002F04.guides\u002F02.use-flow-builder",{"title":66,"path":67,"stem":68},"Publish and receive calls","\u002Fen\u002Fguides\u002Fpublish-agent","en\u002F04.guides\u002F03.publish-agent",{"title":70,"path":71,"stem":72},"Test an agent","\u002Fen\u002Fguides\u002Ftest-agent","en\u002F04.guides\u002F04.test-agent",{"title":74,"path":75,"stem":76},"Transfer to a human","\u002Fen\u002Fguides\u002Ftransfer-to-human","en\u002F04.guides\u002F05.transfer-to-human",{"title":78,"path":79,"stem":80},"Book meetings with Cal.com","\u002Fen\u002Fguides\u002Fbook-meetings","en\u002F04.guides\u002F06.book-meetings",{"title":82,"path":83,"stem":84},"Send SMS","\u002Fen\u002Fguides\u002Fsend-sms","en\u002F04.guides\u002F07.send-sms",{"title":86,"path":87,"stem":88},"Configure a phone book","\u002Fen\u002Fguides\u002Fconfigure-phone-book","en\u002F04.guides\u002F08.configure-phone-book",{"title":90,"path":91,"stem":92},"Embed the voice widget","\u002Fen\u002Fguides\u002Fembed-widget","en\u002F04.guides\u002F09.embed-widget",{"title":94,"path":95,"stem":96},"Record calls","\u002Fen\u002Fguides\u002Frecord-calls","en\u002F04.guides\u002F10.record-calls",{"title":98,"path":99,"stem":100},"Redact personal data","\u002Fen\u002Fguides\u002Fredact-personal-data","en\u002F04.guides\u002F11.redact-personal-data",{"title":102,"path":103,"stem":104,"children":105},"Flow Builder","\u002Fen\u002Fflow-builder","en\u002F05.flow-builder\u002Findex",[106,107,111,115,119,123,127],{"title":102,"path":103,"stem":104},{"title":108,"path":109,"stem":110},"Builder interface","\u002Fen\u002Fflow-builder\u002Finterface","en\u002F05.flow-builder\u002F01.interface",{"title":112,"path":113,"stem":114},"Flow structure","\u002Fen\u002Fflow-builder\u002Fstructure","en\u002F05.flow-builder\u002F02.structure",{"title":116,"path":117,"stem":118},"Flow variables","\u002Fen\u002Fflow-builder\u002Fvariables","en\u002F05.flow-builder\u002F03.variables",{"title":120,"path":121,"stem":122},"Conditions and paths","\u002Fen\u002Fflow-builder\u002Fbranches","en\u002F05.flow-builder\u002F04.branches",{"title":124,"path":125,"stem":126},"Test a flow","\u002Fen\u002Fflow-builder\u002Ftesting","en\u002F05.flow-builder\u002F05.testing",{"title":128,"path":129,"stem":130},"Validation and publishing","\u002Fen\u002Fflow-builder\u002Fvalidation-publishing","en\u002F05.flow-builder\u002F06.validation-publishing",{"title":132,"path":133,"stem":134,"children":135},"Nodes","\u002Fen\u002Fnodes","en\u002F06.nodes\u002Findex",[136,137,141,145,149,153,157,161,165,169,173,177],{"title":132,"path":133,"stem":134},{"title":138,"path":139,"stem":140},"Conversation","\u002Fen\u002Fnodes\u002Fconversation","en\u002F06.nodes\u002F01.conversation",{"title":142,"path":143,"stem":144},"Message","\u002Fen\u002Fnodes\u002Fmessage","en\u002F06.nodes\u002F02.message",{"title":146,"path":147,"stem":148},"Split path","\u002Fen\u002Fnodes\u002Fsplit-path","en\u002F06.nodes\u002F03.split-path",{"title":150,"path":151,"stem":152},"Jump to","\u002Fen\u002Fnodes\u002Fjump-to","en\u002F06.nodes\u002F04.jump-to",{"title":154,"path":155,"stem":156},"Trigger subflow","\u002Fen\u002Fnodes\u002Ftrigger-subflow","en\u002F06.nodes\u002F05.trigger-subflow",{"title":158,"path":159,"stem":160},"Custom action","\u002Fen\u002Fnodes\u002Fcustom-action","en\u002F06.nodes\u002F06.custom-action",{"title":162,"path":163,"stem":164},"Send SMS during the call","\u002Fen\u002Fnodes\u002Fsend-sms-during-call","en\u002F06.nodes\u002F07.send-sms-during-call",{"title":166,"path":167,"stem":168},"Transfer","\u002Fen\u002Fnodes\u002Ftransfer","en\u002F06.nodes\u002F08.transfer",{"title":170,"path":171,"stem":172},"Booking","\u002Fen\u002Fnodes\u002Fbooking","en\u002F06.nodes\u002F09.booking",{"title":174,"path":175,"stem":176},"End call","\u002Fen\u002Fnodes\u002Fend-call","en\u002F06.nodes\u002F10.end-call",{"title":178,"path":179,"stem":180},"Nodes coming soon","\u002Fen\u002Fnodes\u002Fcoming-soon","en\u002F06.nodes\u002F11.coming-soon",{"title":182,"path":183,"stem":184,"children":185},"Actions","\u002Fen\u002Factions","en\u002F07.actions\u002Findex",[186,187,191,195,199,203,207,211,215],{"title":182,"path":183,"stem":184},{"title":188,"path":189,"stem":190},"Call transfers","\u002Fen\u002Factions\u002Fcall-transfers","en\u002F07.actions\u002F01.call-transfers",{"title":192,"path":193,"stem":194},"IVR","\u002Fen\u002Factions\u002Fivr","en\u002F07.actions\u002F02.ivr",{"title":196,"path":197,"stem":198},"SMS during the call","\u002Fen\u002Factions\u002Fduring-call-sms","en\u002F07.actions\u002F03.during-call-sms",{"title":200,"path":201,"stem":202},"Post-call SMS","\u002Fen\u002Factions\u002Fpost-call-sms","en\u002F07.actions\u002F04.post-call-sms",{"title":204,"path":205,"stem":206},"Custom actions","\u002Fen\u002Factions\u002Fcustom-actions","en\u002F07.actions\u002F05.custom-actions",{"title":208,"path":209,"stem":210},"Information extractors","\u002Fen\u002Factions\u002Finformation-extractors","en\u002F07.actions\u002F06.information-extractors",{"title":212,"path":213,"stem":214},"Custom evaluations","\u002Fen\u002Factions\u002Fcustom-evaluations","en\u002F07.actions\u002F07.custom-evaluations",{"title":216,"path":217,"stem":218},"Real-time booking","\u002Fen\u002Factions\u002Freal-time-booking","en\u002F07.actions\u002F08.real-time-booking",{"title":220,"path":221,"stem":222,"children":223},"Knowledge base","\u002Fen\u002Fknowledge-base","en\u002F08.knowledge-base\u002Findex",[224,225,229,233],{"title":220,"path":221,"stem":222},{"title":226,"path":227,"stem":228},"Sources","\u002Fen\u002Fknowledge-base\u002Fsources","en\u002F08.knowledge-base\u002F01.sources",{"title":230,"path":231,"stem":232},"Citations","\u002Fen\u002Fknowledge-base\u002Fcitations","en\u002F08.knowledge-base\u002F02.citations",{"title":234,"path":235,"stem":236},"Shared memory","\u002Fen\u002Fknowledge-base\u002Fshared-memory","en\u002F08.knowledge-base\u002F03.shared-memory",{"title":238,"path":239,"stem":240,"children":241},"Test Center","\u002Fen\u002Ftest-center","en\u002F09.test-center\u002Findex",[242,243],{"title":238,"path":239,"stem":240},{"title":244,"path":245,"stem":246},"Evaluations","\u002Fen\u002Ftest-center\u002Fevaluations","en\u002F09.test-center\u002F01.evaluations",{"title":248,"path":249,"stem":250,"children":251},"History and analytics","\u002Fen\u002Fhistory","en\u002F10.history\u002Findex",[252,253,257,261,265],{"title":248,"path":249,"stem":250},{"title":254,"path":255,"stem":256},"Overview","\u002Fen\u002Fhistory\u002Fdashboard","en\u002F10.history\u002F01.dashboard",{"title":258,"path":259,"stem":260},"Calls","\u002Fen\u002Fhistory\u002Fcalls","en\u002F10.history\u002F02.calls",{"title":262,"path":263,"stem":264},"Recordings","\u002Fen\u002Fhistory\u002Frecordings","en\u002F10.history\u002F03.recordings",{"title":266,"path":267,"stem":268},"Analytics","\u002Fen\u002Fhistory\u002Fanalytics","en\u002F10.history\u002F04.analytics",{"title":270,"path":271,"stem":272,"children":273},"WhatsApp","\u002Fen\u002Fwhatsapp","en\u002F11.whatsapp\u002Findex",[274,275,279,283,287],{"title":270,"path":271,"stem":272},{"title":276,"path":277,"stem":278},"Connect the number","\u002Fen\u002Fwhatsapp\u002Fconnect","en\u002F11.whatsapp\u002F01.connect",{"title":280,"path":281,"stem":282},"Templates","\u002Fen\u002Fwhatsapp\u002Ftemplates","en\u002F11.whatsapp\u002F02.templates",{"title":284,"path":285,"stem":286},"Conversations","\u002Fen\u002Fwhatsapp\u002Fconversations","en\u002F11.whatsapp\u002F03.conversations",{"title":288,"path":289,"stem":290},"Voice calls","\u002Fen\u002Fwhatsapp\u002Fcalls","en\u002F11.whatsapp\u002F04.calls",{"title":292,"path":293,"stem":294,"children":295},"API","\u002Fen\u002Fapi","en\u002F12.api\u002Findex",[296,297,301,305,309,313,317,321,536,554,558],{"title":292,"path":293,"stem":294},{"title":298,"path":299,"stem":300},"Getting started with the API","\u002Fen\u002Fapi\u002Fgetting-started","en\u002F12.api\u002F01.getting-started",{"title":302,"path":303,"stem":304},"DISKA API","\u002Fen\u002Fapi\u002Fapi-channel","en\u002F12.api\u002F02.api-channel",{"title":306,"path":307,"stem":308},"Authentication","\u002Fen\u002Fapi\u002Fauthentication","en\u002F12.api\u002F03.authentication",{"title":310,"path":311,"stem":312},"Webhooks","\u002Fen\u002Fapi\u002Fwebhooks","en\u002F12.api\u002F04.webhooks",{"title":314,"path":315,"stem":316},"Endpoints","\u002Fen\u002Fapi\u002Fendpoints","en\u002F12.api\u002F05.endpoints",{"title":318,"path":319,"stem":320},"Realtime","\u002Fen\u002Fapi\u002Frealtime","en\u002F12.api\u002F06.realtime",{"title":322,"path":323,"stem":324,"children":325},"API reference","\u002Fen\u002Fapi\u002Freference","en\u002F12.api\u002F07.reference\u002Findex",[326,327,337,363,380,398,440,466,475,485,511],{"title":322,"path":323,"stem":324},{"title":328,"path":329,"stem":330,"children":331},"Identity","\u002Fen\u002Fapi\u002Freference\u002Fidentity","en\u002F12.api\u002F07.reference\u002F01.identity\u002Findex",[332,333],{"title":328,"path":329,"stem":330},{"title":334,"path":335,"stem":336},"Get the key and organization","\u002Fen\u002Fapi\u002Freference\u002Fidentity\u002Fget-identity","en\u002F12.api\u002F07.reference\u002F01.identity\u002F01.get-identity",{"title":338,"path":339,"stem":340,"children":341},"Agents","\u002Fen\u002Fapi\u002Freference\u002Fagents","en\u002F12.api\u002F07.reference\u002F02.agents\u002Findex",[342,343,347,351,355,359],{"title":338,"path":339,"stem":340},{"title":344,"path":345,"stem":346},"List agents","\u002Fen\u002Fapi\u002Freference\u002Fagents\u002Flist-agents","en\u002F12.api\u002F07.reference\u002F02.agents\u002F01.list-agents",{"title":348,"path":349,"stem":350},"Get an agent","\u002Fen\u002Fapi\u002Freference\u002Fagents\u002Fget-agent","en\u002F12.api\u002F07.reference\u002F02.agents\u002F02.get-agent",{"title":352,"path":353,"stem":354},"Update an agent","\u002Fen\u002Fapi\u002Freference\u002Fagents\u002Fupdate-agent","en\u002F12.api\u002F07.reference\u002F02.agents\u002F03.update-agent",{"title":356,"path":357,"stem":358},"Create an agent","\u002Fen\u002Fapi\u002Freference\u002Fagents\u002Fcreate-agent","en\u002F12.api\u002F07.reference\u002F02.agents\u002F04.create-agent",{"title":360,"path":361,"stem":362},"Publish an agent","\u002Fen\u002Fapi\u002Freference\u002Fagents\u002Fpublish-agent","en\u002F12.api\u002F07.reference\u002F02.agents\u002F05.publish-agent",{"title":258,"path":364,"stem":365,"children":366},"\u002Fen\u002Fapi\u002Freference\u002Fcalls","en\u002F12.api\u002F07.reference\u002F03.calls\u002Findex",[367,368,372,376],{"title":258,"path":364,"stem":365},{"title":369,"path":370,"stem":371},"List calls","\u002Fen\u002Fapi\u002Freference\u002Fcalls\u002Flist-calls","en\u002F12.api\u002F07.reference\u002F03.calls\u002F01.list-calls",{"title":373,"path":374,"stem":375},"Get a call","\u002Fen\u002Fapi\u002Freference\u002Fcalls\u002Fget-call","en\u002F12.api\u002F07.reference\u002F03.calls\u002F02.get-call",{"title":377,"path":378,"stem":379},"Download the recording","\u002Fen\u002Fapi\u002Freference\u002Fcalls\u002Fget-call-recording","en\u002F12.api\u002F07.reference\u002F03.calls\u002F03.get-call-recording",{"title":381,"path":382,"stem":383,"children":384},"Outbound calls","\u002Fen\u002Fapi\u002Freference\u002Foutbound-calls","en\u002F12.api\u002F07.reference\u002F04.outbound-calls\u002Findex",[385,386,390,394],{"title":381,"path":382,"stem":383},{"title":387,"path":388,"stem":389},"Make an outbound call","\u002Fen\u002Fapi\u002Freference\u002Foutbound-calls\u002Fcreate-outbound-call","en\u002F12.api\u002F07.reference\u002F04.outbound-calls\u002F01.create-outbound-call",{"title":391,"path":392,"stem":393},"Get an outbound call","\u002Fen\u002Fapi\u002Freference\u002Foutbound-calls\u002Fget-outbound-call","en\u002F12.api\u002F07.reference\u002F04.outbound-calls\u002F02.get-outbound-call",{"title":395,"path":396,"stem":397},"Hang up an outbound call","\u002Fen\u002Fapi\u002Freference\u002Foutbound-calls\u002Fhang-up-outbound-call","en\u002F12.api\u002F07.reference\u002F04.outbound-calls\u002F03.hang-up-outbound-call",{"title":399,"path":400,"stem":401,"children":402},"Campaigns","\u002Fen\u002Fapi\u002Freference\u002Fcampaigns","en\u002F12.api\u002F07.reference\u002F05.campaigns\u002Findex",[403,404,408,412,416,420,424,428,432,436],{"title":399,"path":400,"stem":401},{"title":405,"path":406,"stem":407},"List campaigns","\u002Fen\u002Fapi\u002Freference\u002Fcampaigns\u002Flist-campaigns","en\u002F12.api\u002F07.reference\u002F05.campaigns\u002F01.list-campaigns",{"title":409,"path":410,"stem":411},"Create a campaign","\u002Fen\u002Fapi\u002Freference\u002Fcampaigns\u002Fcreate-campaign","en\u002F12.api\u002F07.reference\u002F05.campaigns\u002F02.create-campaign",{"title":413,"path":414,"stem":415},"Get a campaign","\u002Fen\u002Fapi\u002Freference\u002Fcampaigns\u002Fget-campaign","en\u002F12.api\u002F07.reference\u002F05.campaigns\u002F03.get-campaign",{"title":417,"path":418,"stem":419},"Add recipients","\u002Fen\u002Fapi\u002Freference\u002Fcampaigns\u002Fadd-campaign-recipients","en\u002F12.api\u002F07.reference\u002F05.campaigns\u002F04.add-campaign-recipients",{"title":421,"path":422,"stem":423},"List recipients","\u002Fen\u002Fapi\u002Freference\u002Fcampaigns\u002Flist-campaign-recipients","en\u002F12.api\u002F07.reference\u002F05.campaigns\u002F05.list-campaign-recipients",{"title":425,"path":426,"stem":427},"Start a campaign","\u002Fen\u002Fapi\u002Freference\u002Fcampaigns\u002Fstart-campaign","en\u002F12.api\u002F07.reference\u002F05.campaigns\u002F06.start-campaign",{"title":429,"path":430,"stem":431},"Pause a campaign","\u002Fen\u002Fapi\u002Freference\u002Fcampaigns\u002Fpause-campaign","en\u002F12.api\u002F07.reference\u002F05.campaigns\u002F07.pause-campaign",{"title":433,"path":434,"stem":435},"Resume a campaign","\u002Fen\u002Fapi\u002Freference\u002Fcampaigns\u002Fresume-campaign","en\u002F12.api\u002F07.reference\u002F05.campaigns\u002F08.resume-campaign",{"title":437,"path":438,"stem":439},"Cancel a campaign","\u002Fen\u002Fapi\u002Freference\u002Fcampaigns\u002Fcancel-campaign","en\u002F12.api\u002F07.reference\u002F05.campaigns\u002F09.cancel-campaign",{"title":441,"path":442,"stem":443,"children":444},"Chat","\u002Fen\u002Fapi\u002Freference\u002Fchats","en\u002F12.api\u002F07.reference\u002F06.chats\u002Findex",[445,446,450,454,458,462],{"title":441,"path":442,"stem":443},{"title":447,"path":448,"stem":449},"Create a chat","\u002Fen\u002Fapi\u002Freference\u002Fchats\u002Fcreate-chat","en\u002F12.api\u002F07.reference\u002F06.chats\u002F01.create-chat",{"title":451,"path":452,"stem":453},"Send a message","\u002Fen\u002Fapi\u002Freference\u002Fchats\u002Fsend-chat-message","en\u002F12.api\u002F07.reference\u002F06.chats\u002F02.send-chat-message",{"title":455,"path":456,"stem":457},"Get a chat","\u002Fen\u002Fapi\u002Freference\u002Fchats\u002Fget-chat","en\u002F12.api\u002F07.reference\u002F06.chats\u002F03.get-chat",{"title":459,"path":460,"stem":461},"List chats","\u002Fen\u002Fapi\u002Freference\u002Fchats\u002Flist-chats","en\u002F12.api\u002F07.reference\u002F06.chats\u002F04.list-chats",{"title":463,"path":464,"stem":465},"End a chat","\u002Fen\u002Fapi\u002Freference\u002Fchats\u002Fend-chat","en\u002F12.api\u002F07.reference\u002F06.chats\u002F05.end-chat",{"title":266,"path":467,"stem":468,"children":469},"\u002Fen\u002Fapi\u002Freference\u002Fanalytics","en\u002F12.api\u002F07.reference\u002F07.analytics\u002Findex",[470,471],{"title":266,"path":467,"stem":468},{"title":472,"path":473,"stem":474},"Analytics overview","\u002Fen\u002Fapi\u002Freference\u002Fanalytics\u002Fget-overview","en\u002F12.api\u002F07.reference\u002F07.analytics\u002F01.get-overview",{"title":476,"path":477,"stem":478,"children":479},"Phone numbers","\u002Fen\u002Fapi\u002Freference\u002Fphone-numbers","en\u002F12.api\u002F07.reference\u002F08.phone-numbers\u002Findex",[480,481],{"title":476,"path":477,"stem":478},{"title":482,"path":483,"stem":484},"List phone numbers","\u002Fen\u002Fapi\u002Freference\u002Fphone-numbers\u002Flist-phone-numbers","en\u002F12.api\u002F07.reference\u002F08.phone-numbers\u002F01.list-phone-numbers",{"title":486,"path":487,"stem":488,"children":489},"Knowledge","\u002Fen\u002Fapi\u002Freference\u002Fknowledge","en\u002F12.api\u002F07.reference\u002F09.knowledge\u002Findex",[490,491,495,499,503,507],{"title":486,"path":487,"stem":488},{"title":492,"path":493,"stem":494},"List knowledge bases","\u002Fen\u002Fapi\u002Freference\u002Fknowledge\u002Flist-knowledge-bases","en\u002F12.api\u002F07.reference\u002F09.knowledge\u002F01.list-knowledge-bases",{"title":496,"path":497,"stem":498},"Create a knowledge base","\u002Fen\u002Fapi\u002Freference\u002Fknowledge\u002Fcreate-knowledge-base","en\u002F12.api\u002F07.reference\u002F09.knowledge\u002F02.create-knowledge-base",{"title":500,"path":501,"stem":502},"Add a text document","\u002Fen\u002Fapi\u002Freference\u002Fknowledge\u002Fadd-text-document","en\u002F12.api\u002F07.reference\u002F09.knowledge\u002F03.add-text-document",{"title":504,"path":505,"stem":506},"Import a web page","\u002Fen\u002Fapi\u002Freference\u002Fknowledge\u002Fimport-url","en\u002F12.api\u002F07.reference\u002F09.knowledge\u002F04.import-url",{"title":508,"path":509,"stem":510},"Upload a PDF","\u002Fen\u002Fapi\u002Freference\u002Fknowledge\u002Fupload-pdf","en\u002F12.api\u002F07.reference\u002F09.knowledge\u002F05.upload-pdf",{"title":310,"path":512,"stem":513,"children":514},"\u002Fen\u002Fapi\u002Freference\u002Fwebhooks","en\u002F12.api\u002F07.reference\u002F10.webhooks\u002Findex",[515,516,520,524,528,532],{"title":310,"path":512,"stem":513},{"title":517,"path":518,"stem":519},"List webhook endpoints","\u002Fen\u002Fapi\u002Freference\u002Fwebhooks\u002Flist-webhook-endpoints","en\u002F12.api\u002F07.reference\u002F10.webhooks\u002F01.list-webhook-endpoints",{"title":521,"path":522,"stem":523},"Create a webhook endpoint","\u002Fen\u002Fapi\u002Freference\u002Fwebhooks\u002Fcreate-webhook-endpoint","en\u002F12.api\u002F07.reference\u002F10.webhooks\u002F02.create-webhook-endpoint",{"title":525,"path":526,"stem":527},"Update a webhook endpoint","\u002Fen\u002Fapi\u002Freference\u002Fwebhooks\u002Fupdate-webhook-endpoint","en\u002F12.api\u002F07.reference\u002F10.webhooks\u002F03.update-webhook-endpoint",{"title":529,"path":530,"stem":531},"Delete a webhook endpoint","\u002Fen\u002Fapi\u002Freference\u002Fwebhooks\u002Fdelete-webhook-endpoint","en\u002F12.api\u002F07.reference\u002F10.webhooks\u002F04.delete-webhook-endpoint",{"title":533,"path":534,"stem":535},"Test a webhook endpoint","\u002Fen\u002Fapi\u002Freference\u002Fwebhooks\u002Ftest-webhook-endpoint","en\u002F12.api\u002F07.reference\u002F10.webhooks\u002F05.test-webhook-endpoint",{"title":537,"path":538,"stem":539,"children":540},"API guides","\u002Fen\u002Fapi\u002Fguides","en\u002F12.api\u002F08.guides\u002Findex",[541,542,546,550],{"title":537,"path":538,"stem":539},{"title":543,"path":544,"stem":545},"Sync calls with your CRM","\u002Fen\u002Fapi\u002Fguides\u002Fsync-calls-crm","en\u002F12.api\u002F08.guides\u002F01.sync-calls-crm",{"title":547,"path":548,"stem":549},"Export the call history","\u002Fen\u002Fapi\u002Fguides\u002Fexport-call-history","en\u002F12.api\u002F08.guides\u002F02.export-call-history",{"title":551,"path":552,"stem":553},"Feed knowledge from your website","\u002Fen\u002Fapi\u002Fguides\u002Fknowledge-from-website","en\u002F12.api\u002F08.guides\u002F03.knowledge-from-website",{"title":555,"path":556,"stem":557},"Versioning and changelog","\u002Fen\u002Fapi\u002Fchangelog","en\u002F12.api\u002F09.changelog",{"title":559,"path":560,"stem":561},"OAuth for partner platforms","\u002Fen\u002Fapi\u002Foauth","en\u002F12.api\u002F10.oauth",{"title":563,"path":564,"stem":565,"children":566},"Integrations","\u002Fen\u002Fintegrations","en\u002F13.integrations\u002Findex",[567,568],{"title":563,"path":564,"stem":565},{"title":569,"path":570,"stem":571},"Cal.com","\u002Fen\u002Fintegrations\u002Fcalcom","en\u002F13.integrations\u002F01.calcom",{"title":573,"path":574,"stem":575,"children":576},"Telephony","\u002Fen\u002Ftelephony","en\u002F14.telephony\u002Findex",[577,578,581,585,589,593,596,600,604,608],{"title":573,"path":574,"stem":575},{"title":476,"path":579,"stem":580},"\u002Fen\u002Ftelephony\u002Fnumbers","en\u002F14.telephony\u002F01.numbers",{"title":582,"path":583,"stem":584},"Connect over SIP","\u002Fen\u002Ftelephony\u002Fsip-trunk","en\u002F14.telephony\u002F02.sip-trunk",{"title":586,"path":587,"stem":588},"Phone calls","\u002Fen\u002Ftelephony\u002Fphone-calls","en\u002F14.telephony\u002F03.phone-calls",{"title":590,"path":591,"stem":592},"Call settings","\u002Fen\u002Ftelephony\u002Fcall-settings","en\u002F14.telephony\u002F04.call-settings",{"title":399,"path":594,"stem":595},"\u002Fen\u002Ftelephony\u002Fcampaigns","en\u002F14.telephony\u002F05.campaigns",{"title":597,"path":598,"stem":599},"Simultaneous calls","\u002Fen\u002Ftelephony\u002Fconcurrency","en\u002F14.telephony\u002F06.concurrency",{"title":601,"path":602,"stem":603},"Transfers","\u002Fen\u002Ftelephony\u002Ftransfers","en\u002F14.telephony\u002F07.transfers",{"title":605,"path":606,"stem":607},"Agent webhooks","\u002Fen\u002Ftelephony\u002Fwebhooks","en\u002F14.telephony\u002F08.webhooks",{"title":609,"path":610,"stem":611},"Errors and end reasons","\u002Fen\u002Ftelephony\u002Ferrors","en\u002F14.telephony\u002F09.errors",{"title":613,"path":614,"stem":615,"children":616},"Settings","\u002Fen\u002Fsettings","en\u002F15.settings\u002Findex",[617,618,622,626,630,634,638,642,646,650,653,657],{"title":613,"path":614,"stem":615},{"title":619,"path":620,"stem":621},"Profile","\u002Fen\u002Fsettings\u002Fpersonal-profile","en\u002F15.settings\u002F01.personal-profile",{"title":623,"path":624,"stem":625},"Credentials","\u002Fen\u002Fsettings\u002Fcredentials","en\u002F15.settings\u002F02.credentials",{"title":627,"path":628,"stem":629},"Password","\u002Fen\u002Fsettings\u002Fpassword","en\u002F15.settings\u002F03.password",{"title":631,"path":632,"stem":633},"Two-factor authentication","\u002Fen\u002Fsettings\u002Ftwo-factor","en\u002F15.settings\u002F04.two-factor",{"title":635,"path":636,"stem":637},"Active sessions","\u002Fen\u002Fsettings\u002Fsessions","en\u002F15.settings\u002F05.sessions",{"title":639,"path":640,"stem":641},"Company","\u002Fen\u002Fsettings\u002Fcompany","en\u002F15.settings\u002F06.company",{"title":643,"path":644,"stem":645},"Organization","\u002Fen\u002Fsettings\u002Forganization","en\u002F15.settings\u002F07.organization",{"title":647,"path":648,"stem":649},"Members","\u002Fen\u002Fsettings\u002Fmembers","en\u002F15.settings\u002F08.members",{"title":563,"path":651,"stem":652},"\u002Fen\u002Fsettings\u002Fintegrations","en\u002F15.settings\u002F09.integrations",{"title":654,"path":655,"stem":656},"API keys","\u002Fen\u002Fsettings\u002Fapi-keys","en\u002F15.settings\u002F10.api-keys",{"title":658,"path":659,"stem":660},"Connected apps and OAuth apps","\u002Fen\u002Fsettings\u002Fconnected-apps","en\u002F15.settings\u002F11.connected-apps",{"title":662,"path":663,"stem":664,"children":665},"Common problems","\u002Fen\u002Ftroubleshooting","en\u002F16.troubleshooting\u002Findex",[666,667,671,675,679,683,687],{"title":662,"path":663,"stem":664},{"title":668,"path":669,"stem":670},"Agent not answering","\u002Fen\u002Ftroubleshooting\u002Fagent-not-answering","en\u002F16.troubleshooting\u002F01.agent-not-answering",{"title":672,"path":673,"stem":674},"Calls drop","\u002Fen\u002Ftroubleshooting\u002Fcalls-drop","en\u002F16.troubleshooting\u002F02.calls-drop",{"title":676,"path":677,"stem":678},"Flow not publishing","\u002Fen\u002Ftroubleshooting\u002Fflow-not-publishing","en\u002F16.troubleshooting\u002F03.flow-not-publishing",{"title":680,"path":681,"stem":682},"Knowledge not answering","\u002Fen\u002Ftroubleshooting\u002Fkb-not-answering","en\u002F16.troubleshooting\u002F04.kb-not-answering",{"title":684,"path":685,"stem":686},"Integration not connecting","\u002Fen\u002Ftroubleshooting\u002Fintegration-not-connecting","en\u002F16.troubleshooting\u002F05.integration-not-connecting",{"title":688,"path":689,"stem":690},"Tests failing","\u002Fen\u002Ftroubleshooting\u002Ftests-failing","en\u002F16.troubleshooting\u002F06.tests-failing",{"title":692,"path":693,"stem":694,"children":695,"page":704},"Legal","\u002Fen\u002Flegal","en\u002F17.legal",[696,700],{"title":697,"path":698,"stem":699},"Privacy Policy","\u002Fen\u002Flegal\u002Fprivacy","en\u002F17.legal\u002F01.privacy",{"title":701,"path":702,"stem":703},"Terms and Conditions","\u002Fen\u002Flegal\u002Fterms","en\u002F17.legal\u002F02.terms",false,{"id":706,"title":543,"body":707,"description":3255,"extension":3256,"links":3257,"meta":3258,"navigation":854,"path":544,"seo":3259,"stem":545,"__hash__":3260},"docs_en\u002Fen\u002F12.api\u002F08.guides\u002F01.sync-calls-crm.md",{"type":708,"value":709,"toc":3247},"minimark",[710,719,735,738,743,788,792,2695,2698,2765,2775,2784,2838,2841,2845,2911,2931,2935,2980,2997,3003,3007,3016,3199,3206,3210,3243],[711,712,713,714,718],"p",{},"In this guide, each completed call reaches your server by ",[715,716,717],"a",{"href":311},"webhook",", without polling. The receiver:",[720,721,722,726,729,732],"ol",{},[723,724,725],"li",{},"checks the signature;",[723,727,728],{},"ignores retries;",[723,730,731],{},"answers right away;",[723,733,734],{},"in a queue, reads the call's detail and creates or updates the contact and the activity in your CRM.",[711,736,737],{},"A daily reconciliation catches anything that was missed.",[739,740,742],"h2",{"id":741},"before-you-start","Before you start",[744,745,746,770,777],"ul",{},[723,747,748,749,752,753,757,758,762,763,757,766,769],{},"An ",[715,750,751],{"href":307},"API key"," with the ",[754,755,756],"strong",{},"Webhooks — gestão"," (",[759,760,761],"code",{},"webhooks:manage",") and ",[754,764,765],{},"Chamadas e transcrições",[759,767,768],{},"calls:read",") scopes.",[723,771,772,773,776],{},"A server reachable from the internet over ",[759,774,775],{},"https:\u002F\u002F",".",[723,778,779,780,783,784,787],{},"Python 3.11 or later with ",[759,781,782],{},"flask"," and ",[759,785,786],{},"requests",", or Node.js 18 or later.",[739,789,791],{"id":790},"_1-write-the-receiver","1. Write the receiver",[793,794,795,1297],"code-group",{},[796,797,803],"pre",{"className":798,"code":799,"filename":800,"language":801,"meta":802,"style":802},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import hashlib\nimport hmac\nimport json\nimport os\nimport queue\nimport threading\nimport time\n\nimport requests\nfrom flask import Flask, request\n\nAPI = \"https:\u002F\u002Fapi.diska.ai\u002Fv1\"\nAPI_KEY = os.environ[\"DISKA_API_KEY\"]\nSECRET = os.environ[\"DISKA_WEBHOOK_SECRET\"]\n\napp = Flask(__name__)\njobs: queue.Queue = queue.Queue()\nseen: set[str] = set()  # in production: a table with X-Diska-Delivery as a unique key\n\n\ndef is_valid(timestamp: str, body: bytes, signature: str) -> bool:\n    if not timestamp.isdigit() or abs(time.time() - int(timestamp)) > 300:\n        return False\n    expected = hmac.new(SECRET.encode(), f\"{timestamp}.\".encode() + body, hashlib.sha256).hexdigest()\n    return hmac.compare_digest(f\"sha256={expected}\", signature)\n\n\n@app.post(\"\u002Fhooks\u002Fdiska\")\ndef receive():\n    body = request.get_data()  # the raw body, before parsing the JSON\n    timestamp = request.headers.get(\"X-Diska-Timestamp\", \"\")\n    if not is_valid(timestamp, body, request.headers.get(\"X-Diska-Signature\", \"\")):\n        return \"\", 401\n    delivery = request.headers.get(\"X-Diska-Delivery\", \"\")\n    if delivery in seen:\n        return \"\", 200  # a retry of a delivery you already received\n    seen.add(delivery)\n    event = json.loads(body)\n    if event.get(\"event\") == \"call.completed\":\n        jobs.put(event)  # process outside the request: answer within 10 seconds\n    return \"\", 200\n\n\ndef crm_upsert(phone: str | None, name: str | None, activity: dict) -> None:\n    # Replace with your CRM's API call: look the contact up by phone,\n    # create it if it does not exist and add the activity with the call id.\n    print(\"CRM\", phone, name, activity)\n\n\ndef sync_call(event: dict) -> None:\n    response = requests.get(\n        f\"{API}\u002Fcalls\u002F{event['call_id']}\",\n        headers={\"Authorization\": f\"Bearer {API_KEY}\"},\n        timeout=30,\n    )\n    response.raise_for_status()\n    call = response.json()\n    crm_upsert(\n        phone=event.get(\"caller_contact\"),\n        name=call.get(\"caller_name\"),\n        activity={\n            \"diska_call_id\": call[\"id\"],\n            \"started_at\": call[\"started_at\"],\n            \"duration_seconds\": call[\"duration_seconds\"],\n            \"agent\": call[\"agent_name\"],\n            \"summary\": call[\"summary\"],\n            \"sentiment\": event.get(\"sentiment\"),\n            \"data\": event.get(\"extracted_data\", {}),\n        },\n    )\n\n\ndef worker() -> None:\n    while True:\n        event = jobs.get()\n        try:\n            sync_call(event)\n        except Exception as exc:  # the daily reconciliation catches what fails here\n            print(\"sync failed\", event[\"call_id\"], exc)\n        finally:\n            jobs.task_done()\n\n\nthreading.Thread(target=worker, daemon=True).start()\n","Python","python","",[759,804,805,813,819,825,831,837,843,849,856,862,868,873,879,885,891,896,902,908,914,919,924,930,936,942,948,954,959,964,970,976,982,988,994,1000,1006,1012,1018,1024,1030,1036,1042,1048,1053,1058,1064,1070,1076,1082,1087,1092,1098,1104,1110,1116,1122,1128,1134,1140,1146,1152,1158,1164,1170,1176,1182,1188,1194,1200,1206,1212,1217,1222,1227,1233,1239,1245,1251,1257,1263,1269,1275,1281,1286,1291],{"__ignoreMap":802},[806,807,810],"span",{"class":808,"line":809},"line",1,[806,811,812],{},"import hashlib\n",[806,814,816],{"class":808,"line":815},2,[806,817,818],{},"import hmac\n",[806,820,822],{"class":808,"line":821},3,[806,823,824],{},"import json\n",[806,826,828],{"class":808,"line":827},4,[806,829,830],{},"import os\n",[806,832,834],{"class":808,"line":833},5,[806,835,836],{},"import queue\n",[806,838,840],{"class":808,"line":839},6,[806,841,842],{},"import threading\n",[806,844,846],{"class":808,"line":845},7,[806,847,848],{},"import time\n",[806,850,852],{"class":808,"line":851},8,[806,853,855],{"emptyLinePlaceholder":854},true,"\n",[806,857,859],{"class":808,"line":858},9,[806,860,861],{},"import requests\n",[806,863,865],{"class":808,"line":864},10,[806,866,867],{},"from flask import Flask, request\n",[806,869,871],{"class":808,"line":870},11,[806,872,855],{"emptyLinePlaceholder":854},[806,874,876],{"class":808,"line":875},12,[806,877,878],{},"API = \"https:\u002F\u002Fapi.diska.ai\u002Fv1\"\n",[806,880,882],{"class":808,"line":881},13,[806,883,884],{},"API_KEY = os.environ[\"DISKA_API_KEY\"]\n",[806,886,888],{"class":808,"line":887},14,[806,889,890],{},"SECRET = os.environ[\"DISKA_WEBHOOK_SECRET\"]\n",[806,892,894],{"class":808,"line":893},15,[806,895,855],{"emptyLinePlaceholder":854},[806,897,899],{"class":808,"line":898},16,[806,900,901],{},"app = Flask(__name__)\n",[806,903,905],{"class":808,"line":904},17,[806,906,907],{},"jobs: queue.Queue = queue.Queue()\n",[806,909,911],{"class":808,"line":910},18,[806,912,913],{},"seen: set[str] = set()  # in production: a table with X-Diska-Delivery as a unique key\n",[806,915,917],{"class":808,"line":916},19,[806,918,855],{"emptyLinePlaceholder":854},[806,920,922],{"class":808,"line":921},20,[806,923,855],{"emptyLinePlaceholder":854},[806,925,927],{"class":808,"line":926},21,[806,928,929],{},"def is_valid(timestamp: str, body: bytes, signature: str) -> bool:\n",[806,931,933],{"class":808,"line":932},22,[806,934,935],{},"    if not timestamp.isdigit() or abs(time.time() - int(timestamp)) > 300:\n",[806,937,939],{"class":808,"line":938},23,[806,940,941],{},"        return False\n",[806,943,945],{"class":808,"line":944},24,[806,946,947],{},"    expected = hmac.new(SECRET.encode(), f\"{timestamp}.\".encode() + body, hashlib.sha256).hexdigest()\n",[806,949,951],{"class":808,"line":950},25,[806,952,953],{},"    return hmac.compare_digest(f\"sha256={expected}\", signature)\n",[806,955,957],{"class":808,"line":956},26,[806,958,855],{"emptyLinePlaceholder":854},[806,960,962],{"class":808,"line":961},27,[806,963,855],{"emptyLinePlaceholder":854},[806,965,967],{"class":808,"line":966},28,[806,968,969],{},"@app.post(\"\u002Fhooks\u002Fdiska\")\n",[806,971,973],{"class":808,"line":972},29,[806,974,975],{},"def receive():\n",[806,977,979],{"class":808,"line":978},30,[806,980,981],{},"    body = request.get_data()  # the raw body, before parsing the JSON\n",[806,983,985],{"class":808,"line":984},31,[806,986,987],{},"    timestamp = request.headers.get(\"X-Diska-Timestamp\", \"\")\n",[806,989,991],{"class":808,"line":990},32,[806,992,993],{},"    if not is_valid(timestamp, body, request.headers.get(\"X-Diska-Signature\", \"\")):\n",[806,995,997],{"class":808,"line":996},33,[806,998,999],{},"        return \"\", 401\n",[806,1001,1003],{"class":808,"line":1002},34,[806,1004,1005],{},"    delivery = request.headers.get(\"X-Diska-Delivery\", \"\")\n",[806,1007,1009],{"class":808,"line":1008},35,[806,1010,1011],{},"    if delivery in seen:\n",[806,1013,1015],{"class":808,"line":1014},36,[806,1016,1017],{},"        return \"\", 200  # a retry of a delivery you already received\n",[806,1019,1021],{"class":808,"line":1020},37,[806,1022,1023],{},"    seen.add(delivery)\n",[806,1025,1027],{"class":808,"line":1026},38,[806,1028,1029],{},"    event = json.loads(body)\n",[806,1031,1033],{"class":808,"line":1032},39,[806,1034,1035],{},"    if event.get(\"event\") == \"call.completed\":\n",[806,1037,1039],{"class":808,"line":1038},40,[806,1040,1041],{},"        jobs.put(event)  # process outside the request: answer within 10 seconds\n",[806,1043,1045],{"class":808,"line":1044},41,[806,1046,1047],{},"    return \"\", 200\n",[806,1049,1051],{"class":808,"line":1050},42,[806,1052,855],{"emptyLinePlaceholder":854},[806,1054,1056],{"class":808,"line":1055},43,[806,1057,855],{"emptyLinePlaceholder":854},[806,1059,1061],{"class":808,"line":1060},44,[806,1062,1063],{},"def crm_upsert(phone: str | None, name: str | None, activity: dict) -> None:\n",[806,1065,1067],{"class":808,"line":1066},45,[806,1068,1069],{},"    # Replace with your CRM's API call: look the contact up by phone,\n",[806,1071,1073],{"class":808,"line":1072},46,[806,1074,1075],{},"    # create it if it does not exist and add the activity with the call id.\n",[806,1077,1079],{"class":808,"line":1078},47,[806,1080,1081],{},"    print(\"CRM\", phone, name, activity)\n",[806,1083,1085],{"class":808,"line":1084},48,[806,1086,855],{"emptyLinePlaceholder":854},[806,1088,1090],{"class":808,"line":1089},49,[806,1091,855],{"emptyLinePlaceholder":854},[806,1093,1095],{"class":808,"line":1094},50,[806,1096,1097],{},"def sync_call(event: dict) -> None:\n",[806,1099,1101],{"class":808,"line":1100},51,[806,1102,1103],{},"    response = requests.get(\n",[806,1105,1107],{"class":808,"line":1106},52,[806,1108,1109],{},"        f\"{API}\u002Fcalls\u002F{event['call_id']}\",\n",[806,1111,1113],{"class":808,"line":1112},53,[806,1114,1115],{},"        headers={\"Authorization\": f\"Bearer {API_KEY}\"},\n",[806,1117,1119],{"class":808,"line":1118},54,[806,1120,1121],{},"        timeout=30,\n",[806,1123,1125],{"class":808,"line":1124},55,[806,1126,1127],{},"    )\n",[806,1129,1131],{"class":808,"line":1130},56,[806,1132,1133],{},"    response.raise_for_status()\n",[806,1135,1137],{"class":808,"line":1136},57,[806,1138,1139],{},"    call = response.json()\n",[806,1141,1143],{"class":808,"line":1142},58,[806,1144,1145],{},"    crm_upsert(\n",[806,1147,1149],{"class":808,"line":1148},59,[806,1150,1151],{},"        phone=event.get(\"caller_contact\"),\n",[806,1153,1155],{"class":808,"line":1154},60,[806,1156,1157],{},"        name=call.get(\"caller_name\"),\n",[806,1159,1161],{"class":808,"line":1160},61,[806,1162,1163],{},"        activity={\n",[806,1165,1167],{"class":808,"line":1166},62,[806,1168,1169],{},"            \"diska_call_id\": call[\"id\"],\n",[806,1171,1173],{"class":808,"line":1172},63,[806,1174,1175],{},"            \"started_at\": call[\"started_at\"],\n",[806,1177,1179],{"class":808,"line":1178},64,[806,1180,1181],{},"            \"duration_seconds\": call[\"duration_seconds\"],\n",[806,1183,1185],{"class":808,"line":1184},65,[806,1186,1187],{},"            \"agent\": call[\"agent_name\"],\n",[806,1189,1191],{"class":808,"line":1190},66,[806,1192,1193],{},"            \"summary\": call[\"summary\"],\n",[806,1195,1197],{"class":808,"line":1196},67,[806,1198,1199],{},"            \"sentiment\": event.get(\"sentiment\"),\n",[806,1201,1203],{"class":808,"line":1202},68,[806,1204,1205],{},"            \"data\": event.get(\"extracted_data\", {}),\n",[806,1207,1209],{"class":808,"line":1208},69,[806,1210,1211],{},"        },\n",[806,1213,1215],{"class":808,"line":1214},70,[806,1216,1127],{},[806,1218,1220],{"class":808,"line":1219},71,[806,1221,855],{"emptyLinePlaceholder":854},[806,1223,1225],{"class":808,"line":1224},72,[806,1226,855],{"emptyLinePlaceholder":854},[806,1228,1230],{"class":808,"line":1229},73,[806,1231,1232],{},"def worker() -> None:\n",[806,1234,1236],{"class":808,"line":1235},74,[806,1237,1238],{},"    while True:\n",[806,1240,1242],{"class":808,"line":1241},75,[806,1243,1244],{},"        event = jobs.get()\n",[806,1246,1248],{"class":808,"line":1247},76,[806,1249,1250],{},"        try:\n",[806,1252,1254],{"class":808,"line":1253},77,[806,1255,1256],{},"            sync_call(event)\n",[806,1258,1260],{"class":808,"line":1259},78,[806,1261,1262],{},"        except Exception as exc:  # the daily reconciliation catches what fails here\n",[806,1264,1266],{"class":808,"line":1265},79,[806,1267,1268],{},"            print(\"sync failed\", event[\"call_id\"], exc)\n",[806,1270,1272],{"class":808,"line":1271},80,[806,1273,1274],{},"        finally:\n",[806,1276,1278],{"class":808,"line":1277},81,[806,1279,1280],{},"            jobs.task_done()\n",[806,1282,1284],{"class":808,"line":1283},82,[806,1285,855],{"emptyLinePlaceholder":854},[806,1287,1289],{"class":808,"line":1288},83,[806,1290,855],{"emptyLinePlaceholder":854},[806,1292,1294],{"class":808,"line":1293},84,[806,1295,1296],{},"threading.Thread(target=worker, daemon=True).start()\n",[796,1298,1303],{"className":1299,"code":1300,"filename":1301,"language":1302,"meta":802,"style":802},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Node.js 18 or later, in a .mjs file\nimport crypto from 'node:crypto'\nimport http from 'node:http'\n\nconst API = 'https:\u002F\u002Fapi.diska.ai\u002Fv1'\nconst { DISKA_API_KEY, DISKA_WEBHOOK_SECRET } = process.env\nconst seen = new Set() \u002F\u002F in production: a table with X-Diska-Delivery as a unique key\n\nfunction isValid(timestamp, rawBody, signature) {\n  if (!\u002F^\\d+$\u002F.test(timestamp || '') || Math.abs(Date.now() \u002F 1000 - Number(timestamp)) > 300) return false\n  const expected = 'sha256=' + crypto.createHmac('sha256', DISKA_WEBHOOK_SECRET)\n    .update(`${timestamp}.`).update(rawBody).digest('hex')\n  const a = Buffer.from(expected)\n  const b = Buffer.from(signature || '')\n  return a.length === b.length && crypto.timingSafeEqual(a, b)\n}\n\nasync function crmUpsert(phone, name, activity) {\n  \u002F\u002F Replace with your CRM's API call: look the contact up by phone,\n  \u002F\u002F create it if it does not exist and add the activity with the call id.\n  console.log('CRM', phone, name, activity)\n}\n\nasync function syncCall(event) {\n  const response = await fetch(`${API}\u002Fcalls\u002F${event.call_id}`, {\n    headers: { Authorization: `Bearer ${DISKA_API_KEY}` }\n  })\n  if (!response.ok) throw new Error(`HTTP ${response.status}`)\n  const call = await response.json()\n  await crmUpsert(event.caller_contact, call.caller_name, {\n    diska_call_id: call.id,\n    started_at: call.started_at,\n    duration_seconds: call.duration_seconds,\n    agent: call.agent_name,\n    summary: call.summary,\n    sentiment: event.sentiment,\n    data: event.extracted_data ?? {}\n  })\n}\n\nhttp.createServer((req, res) => {\n  if (req.method !== 'POST' || req.url !== '\u002Fhooks\u002Fdiska') return res.writeHead(404).end()\n  const chunks = []\n  req.on('data', chunk => chunks.push(chunk))\n  req.on('end', () => {\n    const rawBody = Buffer.concat(chunks) \u002F\u002F the raw body, before parsing the JSON\n    if (!isValid(req.headers['x-diska-timestamp'], rawBody, req.headers['x-diska-signature'])) return res.writeHead(401).end()\n    res.writeHead(200).end() \u002F\u002F answer now; process afterwards\n    const delivery = req.headers['x-diska-delivery']\n    if (seen.has(delivery)) return \u002F\u002F a retry of a delivery you already received\n    seen.add(delivery)\n    const event = JSON.parse(rawBody)\n    if (event.event === 'call.completed') {\n      syncCall(event).catch(err => console.error('sync failed', event.call_id, err)) \u002F\u002F the reconciliation catches what fails\n    }\n  })\n}).listen(Number(process.env.PORT || 3000))\n","Node.js","js",[759,1304,1305,1311,1335,1351,1355,1374,1404,1426,1430,1461,1564,1610,1661,1684,1710,1751,1756,1760,1790,1795,1800,1834,1838,1842,1860,1903,1934,1941,1987,2008,2037,2054,2070,2086,2102,2118,2135,2155,2161,2165,2169,2198,2265,2277,2318,2343,2369,2448,2473,2500,2526,2542,2564,2590,2648,2653,2659],{"__ignoreMap":802},[806,1306,1307],{"class":808,"line":809},[806,1308,1310],{"class":1309},"sHwdD","\u002F\u002F Node.js 18 or later, in a .mjs file\n",[806,1312,1313,1317,1321,1324,1328,1332],{"class":808,"line":815},[806,1314,1316],{"class":1315},"s7zQu","import",[806,1318,1320],{"class":1319},"sTEyZ"," crypto ",[806,1322,1323],{"class":1315},"from",[806,1325,1327],{"class":1326},"sMK4o"," '",[806,1329,1331],{"class":1330},"sfazB","node:crypto",[806,1333,1334],{"class":1326},"'\n",[806,1336,1337,1339,1342,1344,1346,1349],{"class":808,"line":821},[806,1338,1316],{"class":1315},[806,1340,1341],{"class":1319}," http ",[806,1343,1323],{"class":1315},[806,1345,1327],{"class":1326},[806,1347,1348],{"class":1330},"node:http",[806,1350,1334],{"class":1326},[806,1352,1353],{"class":808,"line":827},[806,1354,855],{"emptyLinePlaceholder":854},[806,1356,1357,1361,1364,1367,1369,1372],{"class":808,"line":833},[806,1358,1360],{"class":1359},"spNyl","const",[806,1362,1363],{"class":1319}," API ",[806,1365,1366],{"class":1326},"=",[806,1368,1327],{"class":1326},[806,1370,1371],{"class":1330},"https:\u002F\u002Fapi.diska.ai\u002Fv1",[806,1373,1334],{"class":1326},[806,1375,1376,1378,1381,1384,1387,1390,1393,1396,1399,1401],{"class":808,"line":839},[806,1377,1360],{"class":1359},[806,1379,1380],{"class":1326}," {",[806,1382,1383],{"class":1319}," DISKA_API_KEY",[806,1385,1386],{"class":1326},",",[806,1388,1389],{"class":1319}," DISKA_WEBHOOK_SECRET ",[806,1391,1392],{"class":1326},"}",[806,1394,1395],{"class":1326}," =",[806,1397,1398],{"class":1319}," process",[806,1400,776],{"class":1326},[806,1402,1403],{"class":1319},"env\n",[806,1405,1406,1408,1411,1413,1416,1420,1423],{"class":808,"line":845},[806,1407,1360],{"class":1359},[806,1409,1410],{"class":1319}," seen ",[806,1412,1366],{"class":1326},[806,1414,1415],{"class":1326}," new",[806,1417,1419],{"class":1418},"s2Zo4"," Set",[806,1421,1422],{"class":1319},"() ",[806,1424,1425],{"class":1309},"\u002F\u002F in production: a table with X-Diska-Delivery as a unique key\n",[806,1427,1428],{"class":808,"line":851},[806,1429,855],{"emptyLinePlaceholder":854},[806,1431,1432,1435,1438,1441,1445,1447,1450,1452,1455,1458],{"class":808,"line":858},[806,1433,1434],{"class":1359},"function",[806,1436,1437],{"class":1418}," isValid",[806,1439,1440],{"class":1326},"(",[806,1442,1444],{"class":1443},"sHdIc","timestamp",[806,1446,1386],{"class":1326},[806,1448,1449],{"class":1443}," rawBody",[806,1451,1386],{"class":1326},[806,1453,1454],{"class":1443}," signature",[806,1456,1457],{"class":1326},")",[806,1459,1460],{"class":1326}," {\n",[806,1462,1463,1466,1469,1472,1475,1478,1481,1484,1487,1489,1491,1494,1496,1498,1501,1504,1507,1510,1513,1515,1518,1520,1523,1525,1528,1530,1532,1536,1539,1542,1544,1546,1549,1552,1555,1557,1560],{"class":808,"line":864},[806,1464,1465],{"class":1315},"  if",[806,1467,757],{"class":1468},"swJcz",[806,1470,1471],{"class":1326},"!",[806,1473,1474],{"class":1326},"\u002F",[806,1476,1477],{"class":1315},"^",[806,1479,1480],{"class":1330},"\\d",[806,1482,1483],{"class":1326},"+",[806,1485,1486],{"class":1315},"$",[806,1488,1474],{"class":1326},[806,1490,776],{"class":1326},[806,1492,1493],{"class":1418},"test",[806,1495,1440],{"class":1468},[806,1497,1444],{"class":1319},[806,1499,1500],{"class":1326}," ||",[806,1502,1503],{"class":1326}," ''",[806,1505,1506],{"class":1468},") ",[806,1508,1509],{"class":1326},"||",[806,1511,1512],{"class":1319}," Math",[806,1514,776],{"class":1326},[806,1516,1517],{"class":1418},"abs",[806,1519,1440],{"class":1468},[806,1521,1522],{"class":1319},"Date",[806,1524,776],{"class":1326},[806,1526,1527],{"class":1418},"now",[806,1529,1422],{"class":1468},[806,1531,1474],{"class":1326},[806,1533,1535],{"class":1534},"sbssI"," 1000",[806,1537,1538],{"class":1326}," -",[806,1540,1541],{"class":1418}," Number",[806,1543,1440],{"class":1468},[806,1545,1444],{"class":1319},[806,1547,1548],{"class":1468},")) ",[806,1550,1551],{"class":1326},">",[806,1553,1554],{"class":1534}," 300",[806,1556,1506],{"class":1468},[806,1558,1559],{"class":1315},"return",[806,1561,1563],{"class":1562},"sfNiH"," false\n",[806,1565,1566,1569,1572,1574,1576,1579,1582,1585,1588,1590,1593,1595,1597,1600,1602,1604,1607],{"class":808,"line":870},[806,1567,1568],{"class":1359},"  const",[806,1570,1571],{"class":1319}," expected",[806,1573,1395],{"class":1326},[806,1575,1327],{"class":1326},[806,1577,1578],{"class":1330},"sha256=",[806,1580,1581],{"class":1326},"'",[806,1583,1584],{"class":1326}," +",[806,1586,1587],{"class":1319}," crypto",[806,1589,776],{"class":1326},[806,1591,1592],{"class":1418},"createHmac",[806,1594,1440],{"class":1468},[806,1596,1581],{"class":1326},[806,1598,1599],{"class":1330},"sha256",[806,1601,1581],{"class":1326},[806,1603,1386],{"class":1326},[806,1605,1606],{"class":1319}," DISKA_WEBHOOK_SECRET",[806,1608,1609],{"class":1468},")\n",[806,1611,1612,1615,1618,1620,1623,1625,1627,1629,1632,1634,1636,1638,1640,1643,1645,1647,1650,1652,1654,1657,1659],{"class":808,"line":875},[806,1613,1614],{"class":1326},"    .",[806,1616,1617],{"class":1418},"update",[806,1619,1440],{"class":1468},[806,1621,1622],{"class":1326},"`${",[806,1624,1444],{"class":1319},[806,1626,1392],{"class":1326},[806,1628,776],{"class":1330},[806,1630,1631],{"class":1326},"`",[806,1633,1457],{"class":1468},[806,1635,776],{"class":1326},[806,1637,1617],{"class":1418},[806,1639,1440],{"class":1468},[806,1641,1642],{"class":1319},"rawBody",[806,1644,1457],{"class":1468},[806,1646,776],{"class":1326},[806,1648,1649],{"class":1418},"digest",[806,1651,1440],{"class":1468},[806,1653,1581],{"class":1326},[806,1655,1656],{"class":1330},"hex",[806,1658,1581],{"class":1326},[806,1660,1609],{"class":1468},[806,1662,1663,1665,1668,1670,1673,1675,1677,1679,1682],{"class":808,"line":881},[806,1664,1568],{"class":1359},[806,1666,1667],{"class":1319}," a",[806,1669,1395],{"class":1326},[806,1671,1672],{"class":1319}," Buffer",[806,1674,776],{"class":1326},[806,1676,1323],{"class":1418},[806,1678,1440],{"class":1468},[806,1680,1681],{"class":1319},"expected",[806,1683,1609],{"class":1468},[806,1685,1686,1688,1691,1693,1695,1697,1699,1701,1704,1706,1708],{"class":808,"line":887},[806,1687,1568],{"class":1359},[806,1689,1690],{"class":1319}," b",[806,1692,1395],{"class":1326},[806,1694,1672],{"class":1319},[806,1696,776],{"class":1326},[806,1698,1323],{"class":1418},[806,1700,1440],{"class":1468},[806,1702,1703],{"class":1319},"signature",[806,1705,1500],{"class":1326},[806,1707,1503],{"class":1326},[806,1709,1609],{"class":1468},[806,1711,1712,1715,1717,1719,1722,1725,1727,1729,1731,1734,1736,1738,1741,1743,1745,1747,1749],{"class":808,"line":893},[806,1713,1714],{"class":1315},"  return",[806,1716,1667],{"class":1319},[806,1718,776],{"class":1326},[806,1720,1721],{"class":1319},"length",[806,1723,1724],{"class":1326}," ===",[806,1726,1690],{"class":1319},[806,1728,776],{"class":1326},[806,1730,1721],{"class":1319},[806,1732,1733],{"class":1326}," &&",[806,1735,1587],{"class":1319},[806,1737,776],{"class":1326},[806,1739,1740],{"class":1418},"timingSafeEqual",[806,1742,1440],{"class":1468},[806,1744,715],{"class":1319},[806,1746,1386],{"class":1326},[806,1748,1690],{"class":1319},[806,1750,1609],{"class":1468},[806,1752,1753],{"class":808,"line":898},[806,1754,1755],{"class":1326},"}\n",[806,1757,1758],{"class":808,"line":904},[806,1759,855],{"emptyLinePlaceholder":854},[806,1761,1762,1765,1768,1771,1773,1776,1778,1781,1783,1786,1788],{"class":808,"line":910},[806,1763,1764],{"class":1359},"async",[806,1766,1767],{"class":1359}," function",[806,1769,1770],{"class":1418}," crmUpsert",[806,1772,1440],{"class":1326},[806,1774,1775],{"class":1443},"phone",[806,1777,1386],{"class":1326},[806,1779,1780],{"class":1443}," name",[806,1782,1386],{"class":1326},[806,1784,1785],{"class":1443}," activity",[806,1787,1457],{"class":1326},[806,1789,1460],{"class":1326},[806,1791,1792],{"class":808,"line":916},[806,1793,1794],{"class":1309},"  \u002F\u002F Replace with your CRM's API call: look the contact up by phone,\n",[806,1796,1797],{"class":808,"line":921},[806,1798,1799],{"class":1309},"  \u002F\u002F create it if it does not exist and add the activity with the call id.\n",[806,1801,1802,1805,1807,1810,1812,1814,1817,1819,1821,1824,1826,1828,1830,1832],{"class":808,"line":926},[806,1803,1804],{"class":1319},"  console",[806,1806,776],{"class":1326},[806,1808,1809],{"class":1418},"log",[806,1811,1440],{"class":1468},[806,1813,1581],{"class":1326},[806,1815,1816],{"class":1330},"CRM",[806,1818,1581],{"class":1326},[806,1820,1386],{"class":1326},[806,1822,1823],{"class":1319}," phone",[806,1825,1386],{"class":1326},[806,1827,1780],{"class":1319},[806,1829,1386],{"class":1326},[806,1831,1785],{"class":1319},[806,1833,1609],{"class":1468},[806,1835,1836],{"class":808,"line":932},[806,1837,1755],{"class":1326},[806,1839,1840],{"class":808,"line":938},[806,1841,855],{"emptyLinePlaceholder":854},[806,1843,1844,1846,1848,1851,1853,1856,1858],{"class":808,"line":944},[806,1845,1764],{"class":1359},[806,1847,1767],{"class":1359},[806,1849,1850],{"class":1418}," syncCall",[806,1852,1440],{"class":1326},[806,1854,1855],{"class":1443},"event",[806,1857,1457],{"class":1326},[806,1859,1460],{"class":1326},[806,1861,1862,1864,1867,1869,1872,1875,1877,1879,1881,1883,1886,1889,1891,1893,1896,1899,1901],{"class":808,"line":950},[806,1863,1568],{"class":1359},[806,1865,1866],{"class":1319}," response",[806,1868,1395],{"class":1326},[806,1870,1871],{"class":1315}," await",[806,1873,1874],{"class":1418}," fetch",[806,1876,1440],{"class":1468},[806,1878,1622],{"class":1326},[806,1880,292],{"class":1319},[806,1882,1392],{"class":1326},[806,1884,1885],{"class":1330},"\u002Fcalls\u002F",[806,1887,1888],{"class":1326},"${",[806,1890,1855],{"class":1319},[806,1892,776],{"class":1326},[806,1894,1895],{"class":1319},"call_id",[806,1897,1898],{"class":1326},"}`",[806,1900,1386],{"class":1326},[806,1902,1460],{"class":1326},[806,1904,1905,1908,1911,1913,1916,1918,1921,1924,1926,1929,1931],{"class":808,"line":956},[806,1906,1907],{"class":1468},"    headers",[806,1909,1910],{"class":1326},":",[806,1912,1380],{"class":1326},[806,1914,1915],{"class":1468}," Authorization",[806,1917,1910],{"class":1326},[806,1919,1920],{"class":1326}," `",[806,1922,1923],{"class":1330},"Bearer ",[806,1925,1888],{"class":1326},[806,1927,1928],{"class":1319},"DISKA_API_KEY",[806,1930,1898],{"class":1326},[806,1932,1933],{"class":1326}," }\n",[806,1935,1936,1939],{"class":808,"line":961},[806,1937,1938],{"class":1326},"  }",[806,1940,1609],{"class":1468},[806,1942,1943,1945,1947,1949,1952,1954,1957,1959,1962,1964,1967,1969,1971,1974,1976,1978,1980,1983,1985],{"class":808,"line":966},[806,1944,1465],{"class":1315},[806,1946,757],{"class":1468},[806,1948,1471],{"class":1326},[806,1950,1951],{"class":1319},"response",[806,1953,776],{"class":1326},[806,1955,1956],{"class":1319},"ok",[806,1958,1506],{"class":1468},[806,1960,1961],{"class":1315},"throw",[806,1963,1415],{"class":1326},[806,1965,1966],{"class":1418}," Error",[806,1968,1440],{"class":1468},[806,1970,1631],{"class":1326},[806,1972,1973],{"class":1330},"HTTP ",[806,1975,1888],{"class":1326},[806,1977,1951],{"class":1319},[806,1979,776],{"class":1326},[806,1981,1982],{"class":1319},"status",[806,1984,1898],{"class":1326},[806,1986,1609],{"class":1468},[806,1988,1989,1991,1994,1996,1998,2000,2002,2005],{"class":808,"line":972},[806,1990,1568],{"class":1359},[806,1992,1993],{"class":1319}," call",[806,1995,1395],{"class":1326},[806,1997,1871],{"class":1315},[806,1999,1866],{"class":1319},[806,2001,776],{"class":1326},[806,2003,2004],{"class":1418},"json",[806,2006,2007],{"class":1468},"()\n",[806,2009,2010,2013,2015,2017,2019,2021,2024,2026,2028,2030,2033,2035],{"class":808,"line":978},[806,2011,2012],{"class":1315},"  await",[806,2014,1770],{"class":1418},[806,2016,1440],{"class":1468},[806,2018,1855],{"class":1319},[806,2020,776],{"class":1326},[806,2022,2023],{"class":1319},"caller_contact",[806,2025,1386],{"class":1326},[806,2027,1993],{"class":1319},[806,2029,776],{"class":1326},[806,2031,2032],{"class":1319},"caller_name",[806,2034,1386],{"class":1326},[806,2036,1460],{"class":1326},[806,2038,2039,2042,2044,2046,2048,2051],{"class":808,"line":984},[806,2040,2041],{"class":1468},"    diska_call_id",[806,2043,1910],{"class":1326},[806,2045,1993],{"class":1319},[806,2047,776],{"class":1326},[806,2049,2050],{"class":1319},"id",[806,2052,2053],{"class":1326},",\n",[806,2055,2056,2059,2061,2063,2065,2068],{"class":808,"line":990},[806,2057,2058],{"class":1468},"    started_at",[806,2060,1910],{"class":1326},[806,2062,1993],{"class":1319},[806,2064,776],{"class":1326},[806,2066,2067],{"class":1319},"started_at",[806,2069,2053],{"class":1326},[806,2071,2072,2075,2077,2079,2081,2084],{"class":808,"line":996},[806,2073,2074],{"class":1468},"    duration_seconds",[806,2076,1910],{"class":1326},[806,2078,1993],{"class":1319},[806,2080,776],{"class":1326},[806,2082,2083],{"class":1319},"duration_seconds",[806,2085,2053],{"class":1326},[806,2087,2088,2091,2093,2095,2097,2100],{"class":808,"line":1002},[806,2089,2090],{"class":1468},"    agent",[806,2092,1910],{"class":1326},[806,2094,1993],{"class":1319},[806,2096,776],{"class":1326},[806,2098,2099],{"class":1319},"agent_name",[806,2101,2053],{"class":1326},[806,2103,2104,2107,2109,2111,2113,2116],{"class":808,"line":1008},[806,2105,2106],{"class":1468},"    summary",[806,2108,1910],{"class":1326},[806,2110,1993],{"class":1319},[806,2112,776],{"class":1326},[806,2114,2115],{"class":1319},"summary",[806,2117,2053],{"class":1326},[806,2119,2120,2123,2125,2128,2130,2133],{"class":808,"line":1014},[806,2121,2122],{"class":1468},"    sentiment",[806,2124,1910],{"class":1326},[806,2126,2127],{"class":1319}," event",[806,2129,776],{"class":1326},[806,2131,2132],{"class":1319},"sentiment",[806,2134,2053],{"class":1326},[806,2136,2137,2140,2142,2144,2146,2149,2152],{"class":808,"line":1020},[806,2138,2139],{"class":1468},"    data",[806,2141,1910],{"class":1326},[806,2143,2127],{"class":1319},[806,2145,776],{"class":1326},[806,2147,2148],{"class":1319},"extracted_data",[806,2150,2151],{"class":1326}," ??",[806,2153,2154],{"class":1326}," {}\n",[806,2156,2157,2159],{"class":808,"line":1026},[806,2158,1938],{"class":1326},[806,2160,1609],{"class":1468},[806,2162,2163],{"class":808,"line":1032},[806,2164,1755],{"class":1326},[806,2166,2167],{"class":808,"line":1038},[806,2168,855],{"emptyLinePlaceholder":854},[806,2170,2171,2174,2176,2179,2181,2183,2186,2188,2191,2193,2196],{"class":808,"line":1044},[806,2172,2173],{"class":1319},"http",[806,2175,776],{"class":1326},[806,2177,2178],{"class":1418},"createServer",[806,2180,1440],{"class":1319},[806,2182,1440],{"class":1326},[806,2184,2185],{"class":1443},"req",[806,2187,1386],{"class":1326},[806,2189,2190],{"class":1443}," res",[806,2192,1457],{"class":1326},[806,2194,2195],{"class":1359}," =>",[806,2197,1460],{"class":1326},[806,2199,2200,2202,2204,2206,2208,2211,2214,2216,2219,2221,2223,2226,2228,2231,2233,2235,2238,2240,2242,2244,2246,2248,2251,2253,2256,2258,2260,2263],{"class":808,"line":1050},[806,2201,1465],{"class":1315},[806,2203,757],{"class":1468},[806,2205,2185],{"class":1319},[806,2207,776],{"class":1326},[806,2209,2210],{"class":1319},"method",[806,2212,2213],{"class":1326}," !==",[806,2215,1327],{"class":1326},[806,2217,2218],{"class":1330},"POST",[806,2220,1581],{"class":1326},[806,2222,1500],{"class":1326},[806,2224,2225],{"class":1319}," req",[806,2227,776],{"class":1326},[806,2229,2230],{"class":1319},"url",[806,2232,2213],{"class":1326},[806,2234,1327],{"class":1326},[806,2236,2237],{"class":1330},"\u002Fhooks\u002Fdiska",[806,2239,1581],{"class":1326},[806,2241,1506],{"class":1468},[806,2243,1559],{"class":1315},[806,2245,2190],{"class":1319},[806,2247,776],{"class":1326},[806,2249,2250],{"class":1418},"writeHead",[806,2252,1440],{"class":1468},[806,2254,2255],{"class":1534},"404",[806,2257,1457],{"class":1468},[806,2259,776],{"class":1326},[806,2261,2262],{"class":1418},"end",[806,2264,2007],{"class":1468},[806,2266,2267,2269,2272,2274],{"class":808,"line":1055},[806,2268,1568],{"class":1359},[806,2270,2271],{"class":1319}," chunks",[806,2273,1395],{"class":1326},[806,2275,2276],{"class":1468}," []\n",[806,2278,2279,2282,2284,2287,2289,2291,2294,2296,2298,2301,2303,2305,2307,2310,2312,2315],{"class":808,"line":1060},[806,2280,2281],{"class":1319},"  req",[806,2283,776],{"class":1326},[806,2285,2286],{"class":1418},"on",[806,2288,1440],{"class":1468},[806,2290,1581],{"class":1326},[806,2292,2293],{"class":1330},"data",[806,2295,1581],{"class":1326},[806,2297,1386],{"class":1326},[806,2299,2300],{"class":1443}," chunk",[806,2302,2195],{"class":1359},[806,2304,2271],{"class":1319},[806,2306,776],{"class":1326},[806,2308,2309],{"class":1418},"push",[806,2311,1440],{"class":1468},[806,2313,2314],{"class":1319},"chunk",[806,2316,2317],{"class":1468},"))\n",[806,2319,2320,2322,2324,2326,2328,2330,2332,2334,2336,2339,2341],{"class":808,"line":1066},[806,2321,2281],{"class":1319},[806,2323,776],{"class":1326},[806,2325,2286],{"class":1418},[806,2327,1440],{"class":1468},[806,2329,1581],{"class":1326},[806,2331,2262],{"class":1330},[806,2333,1581],{"class":1326},[806,2335,1386],{"class":1326},[806,2337,2338],{"class":1326}," ()",[806,2340,2195],{"class":1359},[806,2342,1460],{"class":1326},[806,2344,2345,2348,2350,2352,2354,2356,2359,2361,2364,2366],{"class":808,"line":1072},[806,2346,2347],{"class":1359},"    const",[806,2349,1449],{"class":1319},[806,2351,1395],{"class":1326},[806,2353,1672],{"class":1319},[806,2355,776],{"class":1326},[806,2357,2358],{"class":1418},"concat",[806,2360,1440],{"class":1468},[806,2362,2363],{"class":1319},"chunks",[806,2365,1506],{"class":1468},[806,2367,2368],{"class":1309},"\u002F\u002F the raw body, before parsing the JSON\n",[806,2370,2371,2374,2376,2378,2381,2383,2385,2387,2390,2393,2395,2398,2400,2403,2405,2407,2409,2411,2413,2415,2417,2419,2422,2424,2427,2429,2431,2433,2435,2437,2440,2442,2444,2446],{"class":808,"line":1078},[806,2372,2373],{"class":1315},"    if",[806,2375,757],{"class":1468},[806,2377,1471],{"class":1326},[806,2379,2380],{"class":1418},"isValid",[806,2382,1440],{"class":1468},[806,2384,2185],{"class":1319},[806,2386,776],{"class":1326},[806,2388,2389],{"class":1319},"headers",[806,2391,2392],{"class":1468},"[",[806,2394,1581],{"class":1326},[806,2396,2397],{"class":1330},"x-diska-timestamp",[806,2399,1581],{"class":1326},[806,2401,2402],{"class":1468},"]",[806,2404,1386],{"class":1326},[806,2406,1449],{"class":1319},[806,2408,1386],{"class":1326},[806,2410,2225],{"class":1319},[806,2412,776],{"class":1326},[806,2414,2389],{"class":1319},[806,2416,2392],{"class":1468},[806,2418,1581],{"class":1326},[806,2420,2421],{"class":1330},"x-diska-signature",[806,2423,1581],{"class":1326},[806,2425,2426],{"class":1468},"])) ",[806,2428,1559],{"class":1315},[806,2430,2190],{"class":1319},[806,2432,776],{"class":1326},[806,2434,2250],{"class":1418},[806,2436,1440],{"class":1468},[806,2438,2439],{"class":1534},"401",[806,2441,1457],{"class":1468},[806,2443,776],{"class":1326},[806,2445,2262],{"class":1418},[806,2447,2007],{"class":1468},[806,2449,2450,2453,2455,2457,2459,2462,2464,2466,2468,2470],{"class":808,"line":1084},[806,2451,2452],{"class":1319},"    res",[806,2454,776],{"class":1326},[806,2456,2250],{"class":1418},[806,2458,1440],{"class":1468},[806,2460,2461],{"class":1534},"200",[806,2463,1457],{"class":1468},[806,2465,776],{"class":1326},[806,2467,2262],{"class":1418},[806,2469,1422],{"class":1468},[806,2471,2472],{"class":1309},"\u002F\u002F answer now; process afterwards\n",[806,2474,2475,2477,2480,2482,2484,2486,2488,2490,2492,2495,2497],{"class":808,"line":1089},[806,2476,2347],{"class":1359},[806,2478,2479],{"class":1319}," delivery",[806,2481,1395],{"class":1326},[806,2483,2225],{"class":1319},[806,2485,776],{"class":1326},[806,2487,2389],{"class":1319},[806,2489,2392],{"class":1468},[806,2491,1581],{"class":1326},[806,2493,2494],{"class":1330},"x-diska-delivery",[806,2496,1581],{"class":1326},[806,2498,2499],{"class":1468},"]\n",[806,2501,2502,2504,2506,2509,2511,2514,2516,2519,2521,2523],{"class":808,"line":1094},[806,2503,2373],{"class":1315},[806,2505,757],{"class":1468},[806,2507,2508],{"class":1319},"seen",[806,2510,776],{"class":1326},[806,2512,2513],{"class":1418},"has",[806,2515,1440],{"class":1468},[806,2517,2518],{"class":1319},"delivery",[806,2520,1548],{"class":1468},[806,2522,1559],{"class":1315},[806,2524,2525],{"class":1309}," \u002F\u002F a retry of a delivery you already received\n",[806,2527,2528,2531,2533,2536,2538,2540],{"class":808,"line":1100},[806,2529,2530],{"class":1319},"    seen",[806,2532,776],{"class":1326},[806,2534,2535],{"class":1418},"add",[806,2537,1440],{"class":1468},[806,2539,2518],{"class":1319},[806,2541,1609],{"class":1468},[806,2543,2544,2546,2548,2550,2553,2555,2558,2560,2562],{"class":808,"line":1106},[806,2545,2347],{"class":1359},[806,2547,2127],{"class":1319},[806,2549,1395],{"class":1326},[806,2551,2552],{"class":1319}," JSON",[806,2554,776],{"class":1326},[806,2556,2557],{"class":1418},"parse",[806,2559,1440],{"class":1468},[806,2561,1642],{"class":1319},[806,2563,1609],{"class":1468},[806,2565,2566,2568,2570,2572,2574,2576,2578,2580,2583,2585,2587],{"class":808,"line":1112},[806,2567,2373],{"class":1315},[806,2569,757],{"class":1468},[806,2571,1855],{"class":1319},[806,2573,776],{"class":1326},[806,2575,1855],{"class":1319},[806,2577,1724],{"class":1326},[806,2579,1327],{"class":1326},[806,2581,2582],{"class":1330},"call.completed",[806,2584,1581],{"class":1326},[806,2586,1506],{"class":1468},[806,2588,2589],{"class":1326},"{\n",[806,2591,2592,2595,2597,2599,2601,2603,2606,2608,2611,2613,2616,2618,2621,2623,2625,2628,2630,2632,2634,2636,2638,2640,2643,2645],{"class":808,"line":1118},[806,2593,2594],{"class":1418},"      syncCall",[806,2596,1440],{"class":1468},[806,2598,1855],{"class":1319},[806,2600,1457],{"class":1468},[806,2602,776],{"class":1326},[806,2604,2605],{"class":1418},"catch",[806,2607,1440],{"class":1468},[806,2609,2610],{"class":1443},"err",[806,2612,2195],{"class":1359},[806,2614,2615],{"class":1319}," console",[806,2617,776],{"class":1326},[806,2619,2620],{"class":1418},"error",[806,2622,1440],{"class":1468},[806,2624,1581],{"class":1326},[806,2626,2627],{"class":1330},"sync failed",[806,2629,1581],{"class":1326},[806,2631,1386],{"class":1326},[806,2633,2127],{"class":1319},[806,2635,776],{"class":1326},[806,2637,1895],{"class":1319},[806,2639,1386],{"class":1326},[806,2641,2642],{"class":1319}," err",[806,2644,1548],{"class":1468},[806,2646,2647],{"class":1309},"\u002F\u002F the reconciliation catches what fails\n",[806,2649,2650],{"class":808,"line":1124},[806,2651,2652],{"class":1326},"    }\n",[806,2654,2655,2657],{"class":808,"line":1130},[806,2656,1938],{"class":1326},[806,2658,1609],{"class":1468},[806,2660,2661,2663,2665,2667,2670,2672,2675,2678,2680,2683,2685,2688,2690,2693],{"class":808,"line":1136},[806,2662,1392],{"class":1326},[806,2664,1457],{"class":1319},[806,2666,776],{"class":1326},[806,2668,2669],{"class":1418},"listen",[806,2671,1440],{"class":1319},[806,2673,2674],{"class":1418},"Number",[806,2676,2677],{"class":1319},"(process",[806,2679,776],{"class":1326},[806,2681,2682],{"class":1319},"env",[806,2684,776],{"class":1326},[806,2686,2687],{"class":1319},"PORT ",[806,2689,1509],{"class":1326},[806,2691,2692],{"class":1534}," 3000",[806,2694,2317],{"class":1319},[711,2696,2697],{},"What the receiver does, in order:",[744,2699,2700,2713,2722,2731,2743],{},[723,2701,2702,2705,2706,2708,2709,776],{},[754,2703,2704],{},"Checks the signature"," over the raw body, with the endpoint's secret. A request without a valid signature gets ",[759,2707,2439],{},". See ",[715,2710,2712],{"href":2711},"\u002Fen\u002Fapi\u002Fwebhooks#verify-the-signature","Verify the signature",[723,2714,2715,2718,2719,776],{},[754,2716,2717],{},"Ignores retries."," A repeated delivery carries the same ",[759,2720,2721],{},"X-Diska-Delivery",[723,2723,2724,2727,2728,2730],{},[754,2725,2726],{},"Answers right away"," with ",[759,2729,2461],{},", and processes afterwards: Diska waits at most 10 seconds.",[723,2732,2733,2736,2737,2742],{},[754,2734,2735],{},"Reads the call's detail"," at ",[715,2738,2739],{"href":374},[759,2740,2741],{},"GET \u002Fv1\u002Fcalls\u002F{call_id}",", for the summary, the duration and the caller's name. The event already carries the sentiment and the extracted data.",[723,2744,2745,2748,2749,2752,2753,2756,2757,2760,2761,2764],{},[754,2746,2747],{},"Calls your CRM"," in ",[759,2750,2751],{},"crm_upsert"," \u002F ",[759,2754,2755],{},"crmUpsert",". Replace the ",[759,2758,2759],{},"print"," with your CRM's API, and use ",[759,2762,2763],{},"diska_call_id"," as the activity's unique key so it is never created twice.",[711,2766,2767,2768,2771,2772,2774],{},"The test event (",[759,2769,2770],{},"ping",") also gets ",[759,2773,2461],{},", so step 3 works.",[711,2776,2777,2778,783,2780,2783],{},"To run the receiver, with the ",[759,2779,1928],{},[759,2781,2782],{},"DISKA_WEBHOOK_SECRET"," variables set:",[796,2785,2789],{"className":2786,"code":2787,"language":2788,"meta":802,"style":802},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pip install flask requests\nflask --app receiver run --port 3000   # Python\nnode receiver.mjs                      # Node.js (port 3000)\n","bash",[759,2790,2791,2806,2827],{"__ignoreMap":802},[806,2792,2793,2797,2800,2803],{"class":808,"line":809},[806,2794,2796],{"class":2795},"sBMFI","pip",[806,2798,2799],{"class":1330}," install",[806,2801,2802],{"class":1330}," flask",[806,2804,2805],{"class":1330}," requests\n",[806,2807,2808,2810,2813,2816,2819,2822,2824],{"class":808,"line":815},[806,2809,782],{"class":2795},[806,2811,2812],{"class":1330}," --app",[806,2814,2815],{"class":1330}," receiver",[806,2817,2818],{"class":1330}," run",[806,2820,2821],{"class":1330}," --port",[806,2823,2692],{"class":1534},[806,2825,2826],{"class":1309},"   # Python\n",[806,2828,2829,2832,2835],{"class":808,"line":821},[806,2830,2831],{"class":2795},"node",[806,2833,2834],{"class":1330}," receiver.mjs",[806,2836,2837],{"class":1309},"                      # Node.js (port 3000)\n",[711,2839,2840],{},"In production, put it behind your web server or proxy, with HTTPS.",[739,2842,2844],{"id":2843},"_2-register-the-endpoint","2. Register the endpoint",[796,2846,2848],{"className":2786,"code":2847,"language":2788,"meta":802,"style":802},"curl -X POST https:\u002F\u002Fapi.diska.ai\u002Fv1\u002Fwebhook-endpoints \\\n  -H \"Authorization: Bearer $DISKA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"url\": \"https:\u002F\u002Fyour-system.com\u002Fhooks\u002Fdiska\", \"description\": \"CRM\", \"events\": [\"call.completed\"]}'\n",[759,2849,2850,2867,2886,2899],{"__ignoreMap":802},[806,2851,2852,2855,2858,2861,2864],{"class":808,"line":809},[806,2853,2854],{"class":2795},"curl",[806,2856,2857],{"class":1330}," -X",[806,2859,2860],{"class":1330}," POST",[806,2862,2863],{"class":1330}," https:\u002F\u002Fapi.diska.ai\u002Fv1\u002Fwebhook-endpoints",[806,2865,2866],{"class":1319}," \\\n",[806,2868,2869,2872,2875,2878,2881,2884],{"class":808,"line":815},[806,2870,2871],{"class":1330},"  -H",[806,2873,2874],{"class":1326}," \"",[806,2876,2877],{"class":1330},"Authorization: Bearer ",[806,2879,2880],{"class":1319},"$DISKA_API_KEY",[806,2882,2883],{"class":1326},"\"",[806,2885,2866],{"class":1319},[806,2887,2888,2890,2892,2895,2897],{"class":808,"line":821},[806,2889,2871],{"class":1330},[806,2891,2874],{"class":1326},[806,2893,2894],{"class":1330},"Content-Type: application\u002Fjson",[806,2896,2883],{"class":1326},[806,2898,2866],{"class":1319},[806,2900,2901,2904,2906,2909],{"class":808,"line":827},[806,2902,2903],{"class":1330},"  -d",[806,2905,1327],{"class":1326},[806,2907,2908],{"class":1330},"{\"url\": \"https:\u002F\u002Fyour-system.com\u002Fhooks\u002Fdiska\", \"description\": \"CRM\", \"events\": [\"call.completed\"]}",[806,2910,1334],{"class":1326},[711,2912,2913,2914,757,2917,1506,2920,2923,2924,2926,2927,2930],{},"The response carries the ",[759,2915,2916],{},"secret",[759,2918,2919],{},"dskw_…",[754,2921,2922],{},"only this once",". Save it in ",[759,2925,2782],{}," and restart the receiver. Keep the ",[759,2928,2929],{},"endpoint.id"," too.",[739,2932,2934],{"id":2933},"_3-test","3. Test",[796,2936,2938],{"className":2786,"code":2937,"language":2788,"meta":802,"style":802},"curl -X POST https:\u002F\u002Fapi.diska.ai\u002Fv1\u002Fwebhook-endpoints\u002F\u003Cendpoint_id>\u002Ftest \\\n  -H \"Authorization: Bearer $DISKA_API_KEY\"\n",[759,2939,2940,2967],{"__ignoreMap":802},[806,2941,2942,2944,2946,2948,2951,2954,2957,2960,2962,2965],{"class":808,"line":809},[806,2943,2854],{"class":2795},[806,2945,2857],{"class":1330},[806,2947,2860],{"class":1330},[806,2949,2950],{"class":1330}," https:\u002F\u002Fapi.diska.ai\u002Fv1\u002Fwebhook-endpoints\u002F",[806,2952,2953],{"class":1326},"\u003C",[806,2955,2956],{"class":1330},"endpoint_i",[806,2958,2959],{"class":1319},"d",[806,2961,1551],{"class":1326},[806,2963,2964],{"class":1330},"\u002Ftest",[806,2966,2866],{"class":1319},[806,2968,2969,2971,2973,2975,2977],{"class":808,"line":815},[806,2970,2871],{"class":1330},[806,2972,2874],{"class":1326},[806,2974,2877],{"class":1330},[806,2976,2880],{"class":1319},[806,2978,2979],{"class":1326},"\"\n",[711,2981,2982,2983,2986,2987,2990,2991,2993,2994,2996],{},"The response should carry ",[759,2984,2985],{},"\"status\": \"delivered\"",". If it says ",[759,2988,2989],{},"failed",", the ",[759,2992,2620],{}," field says why: unreachable URL, invalid certificate, or the receiver answered ",[759,2995,2439],{}," because the secret is wrong.",[711,2998,2999,3000,3002],{},"Then call the agent's number and end the call normally. When post-call processing finishes, the receiver gets ",[759,3001,2582],{}," and the contact shows up in your CRM.",[739,3004,3006],{"id":3005},"_4-reconcile-once-a-day","4. Reconcile once a day",[711,3008,3009,3010,3015],{},"Deliveries are best effort: if your server is down during the retries, the event is lost. The source of truth is ",[715,3011,3012],{"href":370},[759,3013,3014],{},"GET \u002Fv1\u002Fcalls",". This script walks the completed calls of the last few days:",[793,3017,3018],{},[796,3019,3021],{"className":798,"code":3020,"filename":800,"language":801,"meta":802,"style":802},"import os\nimport time\nfrom datetime import datetime, timedelta, timezone\n\nimport requests\n\nAPI = \"https:\u002F\u002Fapi.diska.ai\u002Fv1\"\nsession = requests.Session()\nsession.headers[\"Authorization\"] = f\"Bearer {os.environ['DISKA_API_KEY']}\"\n\n\ndef get(path: str, params: dict | None = None) -> dict:\n    while True:\n        response = session.get(f\"{API}{path}\", params=params, timeout=60)\n        if response.status_code == 429:  # rate limit: wait as long as the API says\n            time.sleep(int(response.headers.get(\"Retry-After\", \"5\")))\n            continue\n        response.raise_for_status()\n        return response.json()\n\n\ndef calls_since(since: datetime):\n    \"\"\"Completed calls since `since`, most recent first.\"\"\"\n    params = {\"cursor\": \"start\", \"limit\": 200, \"status\": \"completed\"}\n    while True:\n        page = get(\"\u002Fcalls\", params)\n        for call in page[\"items\"]:\n            if call[\"started_at\"] and datetime.fromisoformat(call[\"started_at\"]) \u003C since:\n                return  # the list is newest first: you can stop here\n            yield call\n        if not page[\"next_cursor\"]:\n            return\n        params[\"cursor\"] = page[\"next_cursor\"]\n\n\nsince = datetime.now(timezone.utc) - timedelta(days=2)  # a little more than the time between runs\nfor call in calls_since(since):\n    print(\"check in the CRM:\", call[\"id\"], call[\"started_at\"])  # create the activity if it does not exist yet\n",[759,3022,3023,3027,3031,3036,3040,3044,3048,3052,3057,3062,3066,3070,3075,3079,3084,3089,3094,3099,3104,3109,3113,3117,3122,3127,3132,3136,3141,3146,3151,3156,3161,3166,3171,3176,3180,3184,3189,3194],{"__ignoreMap":802},[806,3024,3025],{"class":808,"line":809},[806,3026,830],{},[806,3028,3029],{"class":808,"line":815},[806,3030,848],{},[806,3032,3033],{"class":808,"line":821},[806,3034,3035],{},"from datetime import datetime, timedelta, timezone\n",[806,3037,3038],{"class":808,"line":827},[806,3039,855],{"emptyLinePlaceholder":854},[806,3041,3042],{"class":808,"line":833},[806,3043,861],{},[806,3045,3046],{"class":808,"line":839},[806,3047,855],{"emptyLinePlaceholder":854},[806,3049,3050],{"class":808,"line":845},[806,3051,878],{},[806,3053,3054],{"class":808,"line":851},[806,3055,3056],{},"session = requests.Session()\n",[806,3058,3059],{"class":808,"line":858},[806,3060,3061],{},"session.headers[\"Authorization\"] = f\"Bearer {os.environ['DISKA_API_KEY']}\"\n",[806,3063,3064],{"class":808,"line":864},[806,3065,855],{"emptyLinePlaceholder":854},[806,3067,3068],{"class":808,"line":870},[806,3069,855],{"emptyLinePlaceholder":854},[806,3071,3072],{"class":808,"line":875},[806,3073,3074],{},"def get(path: str, params: dict | None = None) -> dict:\n",[806,3076,3077],{"class":808,"line":881},[806,3078,1238],{},[806,3080,3081],{"class":808,"line":887},[806,3082,3083],{},"        response = session.get(f\"{API}{path}\", params=params, timeout=60)\n",[806,3085,3086],{"class":808,"line":893},[806,3087,3088],{},"        if response.status_code == 429:  # rate limit: wait as long as the API says\n",[806,3090,3091],{"class":808,"line":898},[806,3092,3093],{},"            time.sleep(int(response.headers.get(\"Retry-After\", \"5\")))\n",[806,3095,3096],{"class":808,"line":904},[806,3097,3098],{},"            continue\n",[806,3100,3101],{"class":808,"line":910},[806,3102,3103],{},"        response.raise_for_status()\n",[806,3105,3106],{"class":808,"line":916},[806,3107,3108],{},"        return response.json()\n",[806,3110,3111],{"class":808,"line":921},[806,3112,855],{"emptyLinePlaceholder":854},[806,3114,3115],{"class":808,"line":926},[806,3116,855],{"emptyLinePlaceholder":854},[806,3118,3119],{"class":808,"line":932},[806,3120,3121],{},"def calls_since(since: datetime):\n",[806,3123,3124],{"class":808,"line":938},[806,3125,3126],{},"    \"\"\"Completed calls since `since`, most recent first.\"\"\"\n",[806,3128,3129],{"class":808,"line":944},[806,3130,3131],{},"    params = {\"cursor\": \"start\", \"limit\": 200, \"status\": \"completed\"}\n",[806,3133,3134],{"class":808,"line":950},[806,3135,1238],{},[806,3137,3138],{"class":808,"line":956},[806,3139,3140],{},"        page = get(\"\u002Fcalls\", params)\n",[806,3142,3143],{"class":808,"line":961},[806,3144,3145],{},"        for call in page[\"items\"]:\n",[806,3147,3148],{"class":808,"line":966},[806,3149,3150],{},"            if call[\"started_at\"] and datetime.fromisoformat(call[\"started_at\"]) \u003C since:\n",[806,3152,3153],{"class":808,"line":972},[806,3154,3155],{},"                return  # the list is newest first: you can stop here\n",[806,3157,3158],{"class":808,"line":978},[806,3159,3160],{},"            yield call\n",[806,3162,3163],{"class":808,"line":984},[806,3164,3165],{},"        if not page[\"next_cursor\"]:\n",[806,3167,3168],{"class":808,"line":990},[806,3169,3170],{},"            return\n",[806,3172,3173],{"class":808,"line":996},[806,3174,3175],{},"        params[\"cursor\"] = page[\"next_cursor\"]\n",[806,3177,3178],{"class":808,"line":1002},[806,3179,855],{"emptyLinePlaceholder":854},[806,3181,3182],{"class":808,"line":1008},[806,3183,855],{"emptyLinePlaceholder":854},[806,3185,3186],{"class":808,"line":1014},[806,3187,3188],{},"since = datetime.now(timezone.utc) - timedelta(days=2)  # a little more than the time between runs\n",[806,3190,3191],{"class":808,"line":1020},[806,3192,3193],{},"for call in calls_since(since):\n",[806,3195,3196],{"class":808,"line":1026},[806,3197,3198],{},"    print(\"check in the CRM:\", call[\"id\"], call[\"started_at\"])  # create the activity if it does not exist yet\n",[711,3200,3201,3202,3205],{},"Run it once a day, for example with ",[759,3203,3204],{},"cron",", and create the activity in your CRM for any call that is not there. Because the list is newest first, the script stops at the first call older than the cut-off date.",[739,3207,3209],{"id":3208},"for-production","For production",[744,3211,3212,3218,3221,3224],{},[723,3213,3214,3215,3217],{},"Keep the processed ",[759,3216,2721],{}," values in a table, not in memory: the receiver can restart.",[723,3219,3220],{},"Use a persistent queue (for example Redis or SQS) instead of the in-memory one.",[723,3222,3223],{},"Log sync failures: the reconciliation recovers them, but you want to know they happened.",[723,3225,3226,3227,3232,3233,783,3236,3239,3240,776],{},"Watch the endpoint: ",[715,3228,3229],{"href":518},[759,3230,3231],{},"GET \u002Fv1\u002Fwebhook-endpoints"," shows ",[759,3234,3235],{},"failure_count",[759,3237,3238],{},"active",". After 20 consecutive failures the endpoint is disabled; once fixed, re-enable it with ",[759,3241,3242],{},"{\"active\": true}",[3244,3245,3246],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":802,"searchDepth":815,"depth":815,"links":3248},[3249,3250,3251,3252,3253,3254],{"id":741,"depth":815,"text":742},{"id":790,"depth":815,"text":791},{"id":2843,"depth":815,"text":2844},{"id":2933,"depth":815,"text":2934},{"id":3005,"depth":815,"text":3006},{"id":3208,"depth":815,"text":3209},"Each completed call reaches your server by webhook and creates or updates the contact and the activity in your CRM.","md",null,{},{"title":543,"description":3255},"Zf-LeJ-8SCs2Im0-tSusC56j_oPueS2T3PcloloSB8g",[3262,3264],{"title":537,"path":538,"stem":539,"description":3263,"children":-1},"Complete integrations with the DISKA API, step by step, with code tested in Python and JavaScript.",{"title":547,"path":548,"stem":549,"description":3265,"children":-1},"The whole history to CSV, or with transcripts to JSONL, using cursor pagination.",1795253317558]