Nhắn tin: một hành động
Nhắn tin là một hành động được kích hoạt bởi sự thay đổi trong trạng thái người dùng (trong sản phẩm hoặc gửi ra ngoài), thay vì một file CSV cũ xuất từ công cụ khác.
At a glance
- Host
https://api.prodantix.com- REST
GET /v1/messages,POST /v1/messages/read- Send
composeMessageover GraphQL- Live updates
messageon the tenant room
- Tin nhắn được kích hoạt ngay khi trạng thái thay đổi, không theo lịch nhập
- Trong sản phẩm và gửi ra ngoài từ một engine
- Đối tượng là các nhóm trực tiếp, không bao giờ là danh sách đóng băng
Cách hoạt động
A message is composed against an audience (a cohort, a segment, or a single distinct id) and dispatched on a channel. In-app messages land in a per-user inbox the client reads on demand; a delivery also emits on the realtime tenant room, so an open session can surface it without polling.
Truy cập ở đâu
| Surface | Operation |
|---|---|
| REST | GET /v1/messages · POST /v1/messages/read |
| GraphQL | messaging query · composeMessage mutation |
| Realtime | message on a tenant room |
| MCP | prodantix.messages.list · .compose |
Ví dụ
curl "https://api.prodantix.com/v1/messages?distinct_id=u_8f3a" \
-H "Authorization: Bearer $PRODANTIX_KEY"const inbox = await prodantix.messages.inbox({ distinctId: 'u_8f3a' });
await prodantix.messages.markRead(inbox[0].id);final inbox = await prodantix.messages.inbox(distinctId: 'u_8f3a');
await prodantix.messages.markRead(inbox.first.id);inbox = prodantix.messages.inbox(distinct_id="u_8f3a")
prodantix.messages.mark_read(inbox[0]["id"])Composing to a cohort
mutation Compose($projectId: String!) {
composeMessage(
projectId: $projectId
input: {
title: "Your trial ends soon"
body: "Your trial ends in three days."
channel: "in_app"
targetKind: "segment"
segment: { event: "checkout_started", lookbackDays: 30 }
}
) {
id
status
recipientCount
}
}The support chat widget
A two-way support thread mounts from @prodantix/sdk/chat, a separate entry point so a site that only wants analytics pays nothing for it. It renders in a closed shadow DOM, so the host page cannot style or read it, and ships under 15 kB gzipped.
import { mountChat } from '@prodantix/sdk/chat';
mountChat({
apiKey: PRODANTIX_PUBLIC_KEY,
host: 'https://eu.api.prodantix.com',
distinctId: currentUser.id,
});AI answering
On an AI-entitled plan, an agent can ask the AI to draft a reply into their composer to review and send: it suggests, a human decides. A project can also opt into auto-reply, which sends the AI draft directly on a brand-new thread with no agent yet, off by default. Either way an AI turn is always labelled as one, never as a person, and the model sees only that thread and the customer's own state.