- Authenticates with an API key
- Targets a specific tenant and site
- Uploads or manages reference content
- Sends chat requests
- Tracks quality with feedback, sessions, and statistics
Base URL
Authentication model
All M2M requests require an API key in the request headers.Main resource model
Most M2M integrations work with three identifiers:tenant_id: the workspace-level scopesite_id: the website or chatbot scopesession_id: the conversation scope
- Tenant endpoints are useful for limits and account-level checks
- Site endpoints are used for documents, chat, sessions, and statistics
- Session IDs help you keep conversation continuity for a user or channel
Endpoint families
Tenant endpoints
Use tenant endpoints for environment checks and account-level information. Common use cases:- Verify limits before traffic starts
- Check usage at workspace level
- Confirm tenant-level statistics
Document endpoints
Use document endpoints to load the content the assistant should rely on. Supported flows include:- Upload file document
- Create text document
- Create Q&A document
Chat endpoints
Use chat endpoints to send messages to the assistant. Two main patterns:- Sync chat: request and answer in one round trip
- Async chat: submit request now, poll for completion later
Session and analytics endpoints
Use these endpoints to observe real usage and integration quality. Reference:Recommended implementation flow
For a new integration, use this sequence:- Authenticate with an API key
- Validate tenant connectivity with a read request
- Lock the correct
tenant_idandsite_idin configuration - Upload a small approved document set
- Send a sync chat request as a smoke test
- Add async chat if your workload needs queue-friendly handling
- Collect feedback and read statistics to monitor quality
Sync chat vs async chat
Sync chat
Use sync chat when:- You need the answer immediately
- Request volume is moderate
- Your caller can wait for the response
Async chat
Use async chat when:- You want non-blocking request handling
- Your application already uses job or queue patterns
- You need polling or background processing
POST /m2m/sites/{id}/chat/async- Read
request_id - Poll
GET /m2m/sites/{id}/chat/requests/{requestId} - Stop polling when status is complete or failed
Session strategy
Choose a stablesession_id strategy before going live.
Good examples:
- Per website visitor
- Per authenticated customer
- Per support thread
- Per messaging channel user
Document strategy
Document quality directly affects answer quality. Recommended document rollout:- Start with a small approved set
- Prefer clean policy, support, and FAQ material
- Review results before large-scale ingestion
- Add Q&A entries for repeated direct questions
Error handling model
Use your HTTP client to separate retryable and non-retryable failures. Typical handling:400: fix payload or request structure401: fix API key or authentication setup403: check plan, access, or allowed capability404: check tenant ID, site ID, or resource ownership429: retry with backoff5xx: use bounded retries and alerting
Observability model
Track at minimum:- Success and failure rate by endpoint
- Latency by endpoint
429and5xxtrends- Async completion time
- Chat quality signals from feedback and statistics