Skip to main content

List conversations

Retrieves a paginated list of conversations. Standard users see only conversations belonging to their own genies. Admin users see all conversations.
resource
string
required
conversations
action
string
required
all
data
object
const response = await ApiService.invoke({
  resource: "conversations",
  action: "all",
  data: {
    agentId: "agent-uuid",
    limit: 20,
    offset: 0,
  },
});

Response

conversations
Conversation[]
Array of conversation objects, each joined with basic genie info.
count
number
Estimated total number of matching conversations.
limit
number
The limit that was applied.
offset
number
The offset that was applied.

Get conversation

Retrieves a single conversation by ID. Standard users can only access conversations for their own genies.
resource
string
required
conversations
action
string
required
get
id
string
required
The conversation ID.
const response = await ApiService.invoke({
  resource: "conversations",
  action: "get",
  id: "123",
});

Response

Returns the full conversation object directly in data.
id
number
Unique conversation identifier.
agent_id
string | null
ID of the genie this conversation belongs to.
elevenlabs_id
string | null
ElevenLabs conversation ID.
status
string | null
Conversation status.
metadata
object | null
Arbitrary metadata associated with the conversation.
viewed
boolean
Whether the conversation has been viewed.
created_at
string
ISO 8601 timestamp.

Sync conversations

Triggers a sync of conversations from ElevenLabs for a specific genie. This delegates to the handle-conversation edge function.
resource
string
required
conversations
action
string
required
sync
data
object
required
const response = await ApiService.invoke({
  resource: "conversations",
  action: "sync",
  data: {
    agentId: "agent-uuid",
  },
});

Response

success
boolean
true if the sync completed without errors.
synced
boolean
true if new conversation data was pulled from ElevenLabs.
conversation
object
The synced conversation record with the latest data from ElevenLabs.
Sync pulls the latest conversation data from ElevenLabs, including updated transcripts, status, and metadata. The authenticated user must own the genie specified by agentId. A 403 FORBIDDEN error is returned otherwise.

Analyze conversation

Runs an analysis on a specific conversation. This delegates to the handle-conversation edge function.
resource
string
required
conversations
action
string
required
analyze
id
string
required
The conversation ID to analyze.
data
object
Additional parameters to pass to the analysis function.
const response = await ApiService.invoke({
  resource: "conversations",
  action: "analyze",
  id: "123",
  data: {
    // optional analysis parameters
  },
});

Response

Returns a detailed analysis object generated by the handle-conversation edge function.
analysis
object
The analysis result for the conversation.
Analysis is performed asynchronously via OpenAI. For longer conversations, the response may take several seconds to return while the analysis is generated.

Update conversation

Updates metadata or fields on an existing conversation. Standard users can only update their own conversations.
resource
string
required
conversations
action
string
required
update
id
string
required
The conversation ID to update.
data
object
required
Fields to update. Can be provided directly or nested under an updates key.
const response = await ApiService.invoke({
  resource: "conversations",
  action: "update",
  id: "123",
  data: {
    viewed: true,
    metadata: { notes: "Follow up required" },
  },
});

Response

Returns the updated conversation object directly in data.

Delete conversation

Permanently deletes a conversation. Standard users can only delete their own conversations. Admin users can delete any conversation.
resource
string
required
conversations
action
string
required
delete
id
string
required
The conversation ID to delete.
const response = await ApiService.invoke({
  resource: "conversations",
  action: "delete",
  id: "123",
});

Response

success
boolean
true if the conversation was deleted.
id
string
The ID of the deleted conversation.
This action is permanent and cannot be undone.