Live sessions API
List live sessions
Returns
200 with the fields below.
Your organization's calls that are live right now.
6 properties
The live session's id. It is also the call's id.
The agent on the call.
`active` while the call is live, `ended` after.
ISO 8601 time the session started.
The conversation so far, in order. Each entry has `role`, `content` and a `timestamp`.
The conversation so far as plain text.
How many sessions are listed.
curl "https://api.dialgem.com/v1/agent/sessions" \
-H "X-API-Key: $DIALGEM_API_KEY"{
"sessions": [
{
"session_id": "session_123",
"agent_id": "agent_123",
"status": "string",
"started_at": "string",
"conversation": [
{}
],
"transcript": "string"
}
],
"count": 0
}Update live session
Change a live call's prompt and/or variables. It applies from the agent's **next turn**.
Path parameters
Request body application/json
Returns
200 with the fields below.
The live session that was changed.
The session's state, `active` while the call is live.
Which settings changed: `system_prompt`, `dynamic_variables`, or both.
When the change takes effect. Always `next_turn`.
curl -X PATCH "https://api.dialgem.com/v1/agent/sessions/SESSION_ID" \
-H "X-API-Key: $DIALGEM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"system_prompt": "string"
}'{
"session_id": "session_123",
"status": "string",
"updated": [
"string"
],
"applies_from": "string"
}Make the agent say something
Make the agent say `text` on the live call, in its own voice. Answers at once with `status: speaking`.
Path parameters
Request body application/json
Default false
Returns
200 with the fields below.
Always `speaking`: the agent has been told to say the line.
curl -X POST "https://api.dialgem.com/v1/agent/sessions/SESSION_ID/say" \
-H "X-API-Key: $DIALGEM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "string"
}'{
"status": "string"
}Release live session
Hand a taken-over call back to the agent, whoever has it (for when the socket that took it is gone).
Path parameters
Returns
200 with the fields below.
`handed_back` when the call went back to the agent, or `not_taken_over` when nobody had it.
Why the call was handed back. Present only with `handed_back`.
curl -X POST "https://api.dialgem.com/v1/agent/sessions/SESSION_ID/release" \
-H "X-API-Key: $DIALGEM_API_KEY"{
"status": "string",
"reason": "string"
}