Skip to main content

Detect Scam Dialog

API URL: wss://api.hiyaapi.com/v1/voice-scam-protection/detect-scam-dialog

This API analyzes the call based on its speech content.

See the overview page for general information about the voice scam protection APIs.

Example session

# 1. → Client sends initial metadata
{ "sampleRate": 8000, "direction": "Incoming" }

# 2. ← Server sends session metadata event
{"type": "sessionMetadata", "sessionId": "838e90ff-ddaf-4c73-8bac-1e380137d99e"}

# 3. → Client sends audio frame
# 4. → Client sends audio frame
# 5. → Client sends audio frame

# 6. ← Server sends transcript line
{ "type": "transcript", "speaker": "USER", "transcript": "hello who is this" }

# 7. ← Server sends result event
{
"type": "result",
"scamDialogRisk": "NEUTRAL",
"confidence": "LOW"
}

# 8. → Client sends audio frame
# 9. → Client sends audio frame

# 10. ← Server sends transcript line
{ "type": "transcript", "speaker": "SUBJECT", "transcript": "hello this is your bank we have frozen your bank account" }
{ "type": "transcript", "speaker": "SUBJECT", "transcript": "i am going to need your social security number to unlock it" }

# 11. ← Server sends result event
{
"type": "result",
"scamDialogRisk": "SCAM",
"confidence": "HIGH"
}