Opens a long-lived connection that sends you the conversation's score every time it changes. This is the simplest way to show a live warning: keep it open for the length of the call.
This is one of a group of endpoints that work together. The setup guide walks through all of them in order.
The response is a server-sent events stream (text/event-stream). The first event is always the current state. The stream closes after the ended event. Up to 5 listeners can follow one conversation at once.
Open this from your server, never a web page. It needs your API key, and a browser's EventSource can't send the header anyway. Relay what you need to your own app.
GET https://api.spoofey.com/v1/fraud/:id/eventsPath
| Path param | Required | Type | Notes |
|---|---|---|---|
id |
Yes | string | The conversation's id. |
Events
| Event | Data |
|---|---|
score |
{ "trigger", "conversation" }. The score changed. trigger is snapshot (the first event), cues (the instant check), model (our AI's read), classification or final. conversation is the same object Get a conversation's score returns. |
utterance |
{ "speaker", "text", "source" }. Something was said. source is api or stt (transcribed from the audio stream). |
suspended |
{ "reason", "conversation" }. Scoring paused because your balance ran out. |
ended |
{ "reason", "conversation" }. The conversation is over. reason is ended_by_client, idle or max_duration. |
A : keep-alive comment line is sent every 20 seconds so proxies keep the connection open.
Example
curl https://api.spoofey.com/v1/fraud/5fa8406c-0601-4eba-aa70-797917434f29/events \
-H "Authorization: Bearer sk_live_..."Response
200 and a stream of events, here shortened:
event: score
data: {"type":"score","trigger":"snapshot","conversation":{"id":"5fa8406c-…","risk_score":0,"band":"low"}}
event: utterance
data: {"type":"utterance","speaker":"remote","text":"Read me the verification code we just sent.","source":"api"}
event: score
data: {"type":"score","trigger":"cues","conversation":{"id":"5fa8406c-…","risk_score":64,"band":"high"}}
event: score
data: {"type":"score","trigger":"model","conversation":{"id":"5fa8406c-…","risk_score":93,"band":"critical","scam_type":"bank_impersonation"}}Errors
| Status | Code | When |
|---|---|---|
404 |
not_found |
No conversation of yours has that id. |
429 |
too_many_listeners |
5 listeners are already following this conversation. |