Create a conversation
Create a conversation on behalf of a company admin. The admin whose email you pass in user.email becomes the creator and is always added as a participant.
It requires a Bearer token for a company admin (for example a company API token) whose role includes the messaging update permission. If user.email does not match an admin of the company, the request returns 403.
Set conversation.type to choose what to create:
ChannelConversation: a named channel.recipientsis ignored. Members are the acting admin plus everyone matchingconversation.filter.DirectConversation: a one-to-one conversation with a company member or a contact.GroupConversation: a named conversation with several participants.SmsConversationandEmailConversation: a conversation with contacts over SMS or email.
For every type except a channel, if a conversation of that type already exists with exactly the same participants, it is returned instead of a new one. A conversation stays initiated until its first message. Any initiated conversation the acting admin created with the same name is deleted first.
Identify each participant in recipients by uid, the recipient ID of an existing company member or contact. To find a company member by email or phone instead, pass email or phone with receivable_type: UserCompany. Any other recipient given by email or phone becomes one of the acting admin’s contacts, found or created; this applies only to direct, group, SMS, and email conversations.
A conversation that fails validation, such as a channel without a name, is not saved. The response is still a 200, with id set to null.
Authorizations
Bearer token authentication
Body
Response
The conversation was created, or an existing conversation with the same participants was found.
A conversation as seen by the acting recipient. Per-recipient fields such as unread, pinned, and muted describe that recipient's view of the conversation. recipients lists at most six active participants; total_recipients is the full count.
The conversation type, for example GroupConversation.
The short conversation kind (direct, group, channel, or downline), or null for SMS, email, and bot conversations.
One of initiated, open, archived, or closed. A new conversation stays initiated until its first message.
internal for conversations between company members, external for conversations with contacts.
Whether the acting recipient can post in the conversation.
The acting recipient's unsent draft in this conversation, or null.
The recipient who created a conversation.