Skip to main content

Overview

Admin Chat API provides administrative functions for managing customer conversations, transferring chats between stores and admin support, and monitoring chat system health. Location: convex/admins/chat.ts

Transfer Conversation to Store

Transfer an admin conversation to a specific store for direct customer support.
Id<'conversations'>
required
ID of the conversation to transfer
Id<'stores'>
required
Target store ID to transfer to
Id<'orders'>
Optional order ID if conversation is about a specific order
boolean
required
Whether to copy message history to new conversation

Transfer Conversation to Admin

Transfer a store conversation back to admin support.
Id<'conversations'>
required
ID of the conversation to transfer
string
Optional reason for transfer

Update Chat Settings

Update global chat system settings.
boolean
Enable/disable direct messaging between customers and stores
number
Maximum image size in MB for chat messages
Array<string>
Allowed image MIME types
boolean
Enable/disable admin support chat

Get Admin Conversations

Retrieve admin conversations with customer and order information.
'active' | 'archived' | 'closed'
Filter by conversation status (default: “active”)
number
Maximum number of conversations to return (default: 50)

Block Conversation

Block a conversation from receiving new messages.
Id<'conversations'>
required
ID of the conversation to block
string
Reason for blocking the conversation

Unblock Conversation

Unblock a previously blocked conversation.
Id<'conversations'>
required
ID of the conversation to unblock

Toggle Store Direct Messaging

Enable or disable direct messaging for a specific store.
Id<'stores'>
required
Store ID to update messaging settings for
boolean
required
Whether to enable direct messaging

Get Store Messaging Status

Check the messaging status for a specific store.
Id<'stores'>
required
Store ID to check status for

Get Chat Statistics

Retrieve comprehensive chat system statistics.
number
Start date filter (Unix timestamp)
number
End date filter (Unix timestamp)

Get Eligible Stores for Transfer

Get stores that a customer has orders with, eligible for conversation transfer.
Id<'customers'>
required
Customer ID to check eligible stores for
All admin chat functions require admin authentication and will throw an error if called by non-admin users.
Conversation transfers create new conversations and archive the original ones. Message history can optionally be copied to the new conversation.