Konwersacje z klientami
Endpointy „Konwersacje z klientami” Zanfia Workspace API — ze schematami i przykładami kodu.
Skrzynka wiadomości prywatnych między Twoim zespołem a klientami. Konwersacje adresowane są przez id klienta; klucz API działa jako jego użytkownik workspace, więc wywołujący musi być aktywnym członkiem zespołu. Endpoint broadcast wysyła prawdziwe wiadomości do wszystkich wskazanych klientów - używaj go rozważnie. Wszystkie endpointy wymagają nagłówka Authorization: Bearer — zobacz Uwierzytelnianie.
Lista konwersacji
/conversationsAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Query Parameters
Page size (max 50, default 25).
Opaque cursor from a previous page.
true keeps only threads with unread customer messages (filters the fetched page).
Response Body
application/json
application/json
curl -X GET "https://example.com/conversations"{ "conversations": [ { "clientId": "string", "workspaceId": "string", "customerName": "string", "customerAvatarUrl": "string", "unreadForStaff": true, "needsReply": true, "lastMessageAt": "string", "lastMessage": { "messageId": "string", "text": "string", "senderId": "string", "fromStaff": true, "sentAt": "string", "type": "text", "deleted": true, "broadcastId": "string" }, "createdAt": "string", "lastCustomerMessageAt": "string", "lastStaffMessageAt": "string" } ], "nextCursor": "string"}{ "error": "string"}Wyślij wiadomość zbiorczą
/conversations/broadcastAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
⚠️ Sends content as a DM to EVERY listed client (≤ 5000 recipients). Fan-out runs async via the background runner; poll the conversations list to observe delivery.
Response Body
application/json
application/json
curl -X POST "https://example.com/conversations/broadcast" \ -H "Content-Type: application/json" \ -d '{ "recipientIds": [ "string" ], "content": "string" }'{ "broadcast": { "id": "string", "workspaceId": "string", "createdBy": "string", "content": "string", "recipientCount": 0, "status": "pending", "processedCount": 0, "skippedCount": 0, "failedCount": 0, "notifyByEmail": true, "createdAt": "string", "completedAt": "string", "triggerRunId": "string" }}{ "error": "string"}Pobierz konwersację
/conversations/{clientId}Authorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Client id
Response Body
application/json
application/json
curl -X GET "https://example.com/conversations/string"{ "conversation": { "clientId": "string", "workspaceId": "string", "customerName": "string", "customerAvatarUrl": "string", "unreadForStaff": true, "needsReply": true, "lastMessageAt": "string", "lastMessage": { "messageId": "string", "text": "string", "senderId": "string", "fromStaff": true, "sentAt": "string", "type": "text", "deleted": true, "broadcastId": "string" }, "createdAt": "string", "lastCustomerMessageAt": "string", "lastStaffMessageAt": "string" }}{ "error": "string"}Lista wiadomości
/conversations/{clientId}/messagesAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Client id
Query Parameters
Page size (max 100, default 25).
Opaque cursor from a previous page.
Response Body
application/json
application/json
curl -X GET "https://example.com/conversations/string/messages"{ "messages": [ { "id": "string", "conversationId": "string", "senderId": "string", "senderRole": "customer", "senderName": "string", "senderAvatarUrl": "string", "content": "string", "type": "text", "attachments": [ { "id": "string", "originalName": "string", "shortName": "string", "size": 0, "contentType": "string", "duration": 0, "extension": "string", "url": "string", "thumbUrl": "string", "createdBy": "string", "voice": { "waveform": [ 0 ], "canonicalUrl": "string", "processingStatus": "ready" } } ], "reactions": [ { "emoji": "string", "userId": "string", "addedAt": 0 } ], "createdAt": "string", "editedAt": "string", "deletedAt": "string", "broadcastId": "string" } ], "nextCursor": "string"}{ "error": "string"}Wyślij wiadomość
/conversations/{clientId}/messagesAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Client id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/conversations/string/messages" \ -H "Content-Type: application/json" \ -d '{ "content": "string" }'{ "conversation": { "id": "string", "workspaceId": "string", "customerName": "string", "customerAvatarUrl": "string", "lastMessage": { "text": "string", "senderId": "string", "sentAt": "string", "type": "text", "messageId": "string", "deleted": true }, "createdAt": "string", "updatedAt": "string", "lastCustomerMessageAt": "string", "lastStaffMessageAt": "string" }, "message": { "id": "string", "conversationId": "string", "senderId": "string", "senderRole": "customer", "senderName": "string", "senderAvatarUrl": "string", "content": "string", "type": "text", "attachments": [ { "id": "string", "originalName": "string", "shortName": "string", "size": 0, "contentType": "string", "duration": 0, "extension": "string", "url": "string", "thumbUrl": "string", "createdBy": "string", "voice": { "waveform": [ 0 ], "canonicalUrl": "string", "processingStatus": "ready" } } ], "reactions": [ { "emoji": "string", "userId": "string", "addedAt": 0 } ], "createdAt": "string", "editedAt": "string", "deletedAt": "string", "broadcastId": "string" }}{ "error": "string"}Edytuj wiadomość
/conversations/{clientId}/messages/{messageId}Authorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Client id
Message id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X PATCH "https://example.com/conversations/string/messages/string" \ -H "Content-Type: application/json" \ -d '{ "content": "string" }'{ "message": { "id": "string", "conversationId": "string", "senderId": "string", "senderRole": "customer", "senderName": "string", "senderAvatarUrl": "string", "content": "string", "type": "text", "attachments": [ { "id": "string", "originalName": "string", "shortName": "string", "size": 0, "contentType": "string", "duration": 0, "extension": "string", "url": "string", "thumbUrl": "string", "createdBy": "string", "voice": { "waveform": [ 0 ], "canonicalUrl": "string", "processingStatus": "ready" } } ], "reactions": [ { "emoji": "string", "userId": "string", "addedAt": 0 } ], "createdAt": "string", "editedAt": "string", "deletedAt": "string", "broadcastId": "string" }}{ "error": "string"}Usuń wiadomość
/conversations/{clientId}/messages/{messageId}Authorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Client id
Message id
Response Body
application/json
application/json
curl -X DELETE "https://example.com/conversations/string/messages/string"{ "message": { "id": "string", "conversationId": "string", "senderId": "string", "senderRole": "customer", "senderName": "string", "senderAvatarUrl": "string", "content": "string", "type": "text", "attachments": [ { "id": "string", "originalName": "string", "shortName": "string", "size": 0, "contentType": "string", "duration": 0, "extension": "string", "url": "string", "thumbUrl": "string", "createdBy": "string", "voice": { "waveform": [ 0 ], "canonicalUrl": "string", "processingStatus": "ready" } } ], "reactions": [ { "emoji": "string", "userId": "string", "addedAt": 0 } ], "createdAt": "string", "editedAt": "string", "deletedAt": "string", "broadcastId": "string" }}{ "error": "string"}Przełącz reakcję
/conversations/{clientId}/messages/{messageId}/reactionsAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Client id
Message id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Toggles the caller's reaction: present → removed, absent → added.
Response Body
application/json
application/json
curl -X POST "https://example.com/conversations/string/messages/string/reactions" \ -H "Content-Type: application/json" \ -d '{ "emoji": "string" }'{ "message": { "id": "string", "conversationId": "string", "senderId": "string", "senderRole": "customer", "senderName": "string", "senderAvatarUrl": "string", "content": "string", "type": "text", "attachments": [ { "id": "string", "originalName": "string", "shortName": "string", "size": 0, "contentType": "string", "duration": 0, "extension": "string", "url": "string", "thumbUrl": "string", "createdBy": "string", "voice": { "waveform": [ 0 ], "canonicalUrl": "string", "processingStatus": "ready" } } ], "reactions": [ { "emoji": "string", "userId": "string", "addedAt": 0 } ], "createdAt": "string", "editedAt": "string", "deletedAt": "string", "broadcastId": "string" }}{ "error": "string"}Oznacz jako przeczytane
/conversations/{clientId}/readAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Client id
Response Body
application/json
application/json
curl -X POST "https://example.com/conversations/string/read"{ "readAt": 0}{ "error": "string"}Czy ten artykuł był pomocny?

