Skip to content
This repository has been archived by the owner on Jan 5, 2025. It is now read-only.

add webhook docs #818

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 2 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
100 changes: 100 additions & 0 deletions docs/api-reference/webhooks/types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,104 @@ When a third-party software agent responds to a previously handed-off conversati
}
```
</Accordion>
-----

`phone.incoming_call_started`

This event is triggered when an incoming call is initiated, providing details about the call’s origin, state, and participants.

<Accordion title="Sample Payload">
```json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ```typescript

{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format all events and make sure there are no syntax errors

event: "phone.incoming_call_started";
organization_id: string;
data: {
type: 'AI' | 'human_agent';
id: string;
direction: 'Incoming';
call_state: string;
call_timestamp: Date;
duration: number | null;
caller: { name: string | null; number: string };
called: { name: string | null; number: string };
};
}
```
</Accordion>

---

`phone.outgoing_call_started`

This event is triggered when an outgoing call is initiated, providing details about the call’s origin, state, and participants.

<Accordion title="Sample Payload">
```json
{
event: "phone.outgoing_call_started";
organization_id: string;
data: {
type: 'human_agent';
id: string;
direction: 'Outgoing';
call_state: string;
call_timestamp: Date;
duration: number | null;
caller: { name: string | null; number: string };
called: { name: string | null; number: string };
};
}
```
</Accordion>

------

---

`phone.incoming_call_ended`

This event is triggered when an incoming call ends, providing details about the call’s origin, state, and participants.

<Accordion title="Sample Payload">
```json
{
event: "phone.incoming_call_ended";
organization_id: string;
data: {
type: 'AI' | 'human_agent';
id: string;
direction: 'Incoming';
call_state: string;
call_timestamp: Date;
duration: number | null;
caller: { name: string | null; number: string };
called: { name: string | null; number: string };
};
}
```
</Accordion>

---

`phone.outgoing_call_ended`

This event is triggered when an outgoing call ends, providing details about the call’s origin, state, and participants.

<Accordion title="Sample Payload">
```json
{
event: "phone.outgoing_call_ended";
organization_id: string;
data: {
type: 'human_agent';
id: string;
direction: 'Outgoing';
call_state: string;
call_timestamp: Date;
duration: number | null;
caller: { name: string | null; number: string };
called: { name: string | null; number: string };
};
}
```
</Accordion>
Loading