Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 31 additions & 11 deletions fern/server-url/events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ All messages sent to your Server URL are `POST` requests with this body shape:
}
```

Common metadata included on most events:
- `phoneNumber`, `timestamp`
- `artifact` (recording, transcript, messages, etc.)
- `assistant`, `customer`, `call`, `chat`

Most events are informational and do not require a response. Responses are only expected for these types sent to your Server URL:
- "assistant-request"
- "tool-calls"
Expand Down Expand Up @@ -168,13 +173,14 @@ Or return an error message to be spoken to the caller:
"type": "end-of-call-report",
"endedReason": "hangup",
"call": { /* Call Object */ },
"recordingUrl": "https://.../recordings/1234.wav",
"summary": "The user asked about the weather...",
"transcript": "AI: How can I help? User: What's the weather? ...",
"messages": [
{ "role": "assistant", "message": "How can I help?" },
{ "role": "user", "message": "What's the weather?" }
]
"artifact": {
"recording": { /* Recording object with URLs */ },
"transcript": "AI: How can I help? User: What's the weather? ...",
"messages": [
{ "role": "assistant", "message": "How can I help?" },
{ "role": "user", "message": "What's the weather?" }
]
}
}
}
```
Expand All @@ -200,7 +206,8 @@ Sent when an update is committed to the conversation history.
{
"message": {
"type": "conversation-update",
"messages": [ /* current conversation messages */ ]
"messages": [ /* current conversation messages */ ],
"messagesOpenAIFormatted": [ /* openai-formatted messages */ ]
}
}
```
Expand All @@ -216,7 +223,9 @@ Partial and final transcripts from the transcriber.
"role": "user",
"transcriptType": "partial",
"transcript": "I'd like to book...",
"isFiltered": false
"isFiltered": false,
"detectedThreats": [],
"originalTranscript": "I'd like to book..."
}
}
```
Expand Down Expand Up @@ -301,7 +310,8 @@ Sent when the transcriber switches based on detected language.
```json
{
"message": {
"type": "language-change-detected"
"type": "language-change-detected",
"language": "es"
}
}
```
Expand All @@ -320,6 +330,15 @@ When requested in `assistant.serverMessages`, hangup and forwarding are delegate
}
```

```json
{
"message": {
"type": "phone-call-control",
"request": "hang-up"
}
}
```

### Knowledge Base Request (Custom)

If using `assistant.knowledgeBase.provider = "custom-knowledge-base"`.
Expand All @@ -328,7 +347,8 @@ If using `assistant.knowledgeBase.provider = "custom-knowledge-base"`.
{
"message": {
"type": "knowledge-base-request",
"messages": [ /* conversation so far */ ]
"messages": [ /* conversation so far */ ],
"messagesOpenAIFormatted": [ /* openai-formatted messages */ ]
}
}
```
Expand Down
Loading