Getting Started

API overview

Use the MuChat API to chat with your agents, export conversations, and check service availability.

API access is required for query and export. Your workspace's plan must include API access. The health endpoint is public.

Query uses a channel API key; export uses a platform API key. Export includes conversations from API, widget, standalone and connected messaging channels. See Authentication for the right key for each endpoint.

What is the MuChat API?

Send messages to an AI agent and retrieve conversation transcripts through an HTTPS API. Responses use JSON, errors follow RFC 9457, and conversation exports use cursor pagination. Query also supports streaming with Server-Sent Events (SSE).

Base URL:

https://api.mu.chat

Quick Start

Get your channel API key

Open the dashboard, select your agent, then go to Deploy → API → Setup / Manage and create or copy its channel key.

Store the key in your server's environment variables.

Send your first message

curl --request POST 'https://api.mu.chat/v2/chat' \
  --header 'Authorization: Bearer YOUR_CHANNEL_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"query":"Hello!","external_message_id":"message-001","stream":false}'

The response contains data.message and data.metadata. Read the query reference for the full response schema and examples.

Continue the conversation

Send data.metadata.conversation_id with your next query. Give each new message a new external_message_id; keep the original ID and body when retrying the same request.

Set stream: true to receive streaming events.

Endpoints

MethodEndpointAuthentication
GETHealth — /v2/healthNone
POSTSend a query — /v2/chatChannel API key
GETExport conversations — /v2/agents/{agent_id}/conversations/exportPlatform API key

Query identifies the agent from the channel key. Export requires agent_id in the URL path and a platform key belonging to the agent's organization.

Export conversation text

Create a platform key in Settings → Developer → API keys, then request the first page:

curl --get 'https://api.mu.chat/v2/agents/YOUR_AGENT_ID/conversations/export' \
  --header 'Authorization: Bearer YOUR_PLATFORM_API_KEY' \
  --data-urlencode 'limit=20'

Read data[].messages[].content_text and follow pagination.next_cursor while pagination.has_more is true. The first page returns up to 20 newest threads by creation time. Each row matches a CSV thread and includes its complete public transcript, with messages oldest first. Pagination retrieves older threads. The export reference includes filters, limits, response fields and a complete Python example.

Response Headers

HeaderAvailabilityDescription
X-Request-IDAll three endpointsRequest identifier to include when contacting support.
X-RateLimit-LimitExportMaximum requests in the rate-limit window: 30 per minute per organization.
X-RateLimit-RemainingExportRequests remaining in the current window.
X-RateLimit-ResetExportUnix timestamp in seconds when the current window resets.
Retry-AfterExport 429 / limiter unavailable 503Seconds to wait before retrying.

Health checks whether the API process responds; it does not verify database or AI provider availability. See Error Handling for error responses and retries.

Next Steps

MuChat documentation

On this page