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.
conversationId
Id<'conversations'>
required
ID of the conversation to transfer
storeId
Id<'stores'>
required
Target store ID to transfer to
orderId
Id<'orders'>
Optional order ID if conversation is about a specific order
includeHistory
boolean
required
Whether to copy message history to new conversation

Transfer Conversation to Admin

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

Update Chat Settings

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

Get Admin Conversations

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

Block Conversation

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

Unblock Conversation

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

Toggle Store Direct Messaging

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

Get Store Messaging Status

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

Get Chat Statistics

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

Get Eligible Stores for Transfer

Get stores that a customer has orders with, eligible for conversation transfer.
customerId
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.