Mensagens: uma ação
Mensagens são uma ação disparada por uma mudança no estado de usuário (no produto ou de saída), em vez de um CSV desatualizado exportado de outra ferramenta.
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
- Mensagens disparadas no momento em que o estado muda, não em um cronograma de importação
- No produto e de saída a partir de um motor
- Audiências são coortes ao vivo, nunca listas congeladas
Como funciona
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.
Onde aceder
| 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 |
Exemplo
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.