Sign inGet started

Create conversation

POST
/workspaces/{workspaceId}/conversations
Create a new conversation for a workspace, optionally specifying an initial message to be sent.
Payload permintaan
name
string
wajib
Name of the conversation. If it's an email channel, this will correspond to the email subject.
description
string
Conversation description.
style
string
Possible values: default, directMessage, chatChannel, personalInbox, resource, groupInbox, support
visibility
string
Possible values: public, private, direct, group
accessibility
string
Possible values: open, invite-only, request-to-join, private
participants
array of object
A list of up to 5 conversation participants.
Tampilkan parameter turunan
Create a participant of the type user, access key, flow, agent, bot, or action rule.
participants.id
string
wajib
The ID of the user, access key, flow, agent, bot, or action rule.
participants.type
string
wajib
Participant type.
Possible values: user, accessKey, flow, agent, bot, collaborationAutomation
initiatingParticipant
object
The participant who initiated the conversation. When both initiatingParticipant and initialMessage are provided, the initial message sender takes precedence.
Tampilkan parameter turunan
Create a participant of the type user, access key, flow, agent, bot, or action rule.
initiatingParticipant.id
string
wajib
The ID of the user, access key, flow, agent, bot, or action rule.
initiatingParticipant.type
string
wajib
Participant type.
Possible values: user, accessKey, flow, agent, bot, collaborationAutomation
channelId
wajib
initialMessage
object
Tampilkan parameter turunan
Initial message that will initiate the conversation.
initialMessage.reference
string
A customizable ID assigned to messages you send. This can be used to correlate messages with data from your own integrating services. Must be globally unique within a workspace.
initialMessage.sender
object
Message sender information for email.
Tampilkan parameter turunan
initialMessage.sender.name
string
wajib
Sender name shown in the email "From" header.
initialMessage.sender.email
string
Sender email address.
initialMessage.sender.emailReplyToAddress
string
Sender email address to reply to.
initialMessage.recipients
array of object
List of recipients.
Tampilkan parameter turunan
Create a new recipient by specifying an identifier key and identifier value. For more information on identifier keys and values, please refer to the "Conversation Participants" page.
initialMessage.recipients.identifierKey
string
Identifier key of the contact depending on which channel is being used.
initialMessage.recipients.identifierValue
string
wajib
Identifier of the contact, such as a phone number or email address.
initialMessage.recipients.platformAddressSelector
string
An expression to determine the contact's platform address (such as email or phone number) dynamically when sending messages in advanced use cases.
initialMessage.recipients.type
string
wajib
Whether the email address is in the email's "To", "CC", or "BCC" headers.
Possible values: to, cc, bcc
initialMessage.body
object
wajib
Tampilkan parameter turunan
initialMessage.body.text
object
wajib
Tampilkan parameter turunan
initialMessage.body.text.actions
array of object
Tampilkan parameter turunan
initialMessage.body.text.actions.link
object
wajib
Tampilkan parameter turunan
initialMessage.body.text.actions.link.metadata
object
Tampilkan parameter turunan
initialMessage.body.text.actions.link.metadata.description
object
Tampilkan parameter turunan
initialMessage.body.text.actions.link.metadata.description.label
string
wajib
initialMessage.body.text.actions.link.text
string
wajib
initialMessage.body.text.actions.link.url
string
wajib
initialMessage.body.text.actions.type
string
wajib
Possible values: link
initialMessage.body.text.attachments
array of object
Tampilkan parameter turunan
initialMessage.body.text.attachments.content
string
initialMessage.body.text.attachments.contentId
string
initialMessage.body.text.attachments.contentType
string
initialMessage.body.text.attachments.filename
string
wajib
initialMessage.body.text.attachments.inline
boolean
initialMessage.body.text.attachments.mediaUrl
string
wajib
initialMessage.body.text.metadata
object
Tampilkan parameter turunan
initialMessage.body.text.metadata.apple
object
Tampilkan parameter turunan
initialMessage.body.text.metadata.apple.appClipPreview
boolean
initialMessage.body.text.metadata.apple.appClipRegion
string
initialMessage.body.text.metadata.apple.summaryText
string
initialMessage.body.text.metadata.headers
object
initialMessage.body.text.metadata.line
object
Tampilkan parameter turunan
initialMessage.body.text.metadata.line.emoji
object
Tampilkan parameter turunan
initialMessage.body.text.metadata.line.emoji.items
array of object
Tampilkan parameter turunan
initialMessage.body.text.metadata.line.emoji.items.emojiId
string
wajib
initialMessage.body.text.metadata.line.emoji.items.index
integer
wajib
initialMessage.body.text.metadata.line.emoji.items.length
integer
initialMessage.body.text.metadata.line.emoji.items.productId
string
wajib
initialMessage.body.text.metadata.paymentDetails
object
Tampilkan parameter turunan
initialMessage.body.text.metadata.paymentDetails.amount
string
wajib
initialMessage.body.text.metadata.paymentDetails.currency
string
wajib
initialMessage.body.text.metadata.paymentDetails.sessionIdentifier
string
initialMessage.body.text.metadata.paymentDetails.state
string
wajib
initialMessage.body.text.metadata.subject
string
initialMessage.body.text.metadata.telegram
object
Tampilkan parameter turunan
initialMessage.body.text.metadata.telegram.parseMode
string
initialMessage.body.text.metadata.whatsapp
object
Tampilkan parameter turunan
initialMessage.body.text.metadata.whatsapp.callPermissionExpiration
string
initialMessage.body.text.metadata.whatsapp.callPermissionResponse
string
Possible values: accept, reject
initialMessage.body.text.metadata.whatsapp.previewUrl
boolean
wajib
initialMessage.body.text.metadata.whatsapp.sharedContacts
array of object
Tampilkan parameter turunan
initialMessage.body.text.metadata.whatsapp.sharedContacts.origin
string
wajib
initialMessage.body.text.metadata.whatsapp.sharedContacts.phones
array of object
Tampilkan parameter turunan
initialMessage.body.text.metadata.whatsapp.sharedContacts.phones.phone
string
wajib
initialMessage.body.text.metadata.whatsapp.sharedContacts.phones.type
string
wajib
initialMessage.body.text.metadata.whatsapp.sharedContacts.phones.waId
string
wajib
initialMessage.body.text.metadata.whatsapp.sharedContacts.vcard
string
initialMessage.body.text.text
string
wajib
initialMessage.body.type
string
wajib
Possible values: text
initialMessage.draft
boolean
Whether this message is a draft.
attributes
object
A free-form object containing conversation attributes. You can use this field to store custom information along with the conversation.
Payload respons
accessibility
string
wajib
Possible values: open, invite-only, request-to-join, private
activeParticipantCount
integer
wajib
assigneeId
string
attributes
object
category
string
channelId
string
wajib
createdAt
string
wajib
description
string
directory
string
featuredParticipants
array of object
wajib
Tampilkan atribut turunan
featuredParticipants.avatarUrl
string
featuredParticipants.contact
object
Tampilkan atribut turunan
featuredParticipants.contact.identifierKey
string
wajib
featuredParticipants.contact.identifierValue
string
wajib
featuredParticipants.contact.platformAddress
string
featuredParticipants.contact.platformAddressSelector
string
featuredParticipants.conversationId
string
featuredParticipants.createdAt
string
featuredParticipants.displayName
string
featuredParticipants.id
string
wajib
featuredParticipants.resourceUri
string
featuredParticipants.status
string
Possible values: invited, pending, active, inactive
featuredParticipants.type
string
wajib
Possible values: user, contact, agent, flow, bot, accessKey, channel, connector, collaborationAutomation
featuredParticipants.updatedAt
string
hasDraft
boolean
id
string
wajib
inbox
object
Tampilkan atribut turunan
inbox.id
string
wajib
inbox.identifier
string
wajib
inbox.ownerId
string
wajib
inbox.ownerType
string
wajib
Possible values: user, group
inbox.type
string
wajib
Possible values: personal, shared, support
initiatingParticipant
object
Tampilkan atribut turunan
initiatingParticipant.avatarUrl
string
initiatingParticipant.contact
object
Tampilkan atribut turunan
initiatingParticipant.contact.identifierKey
string
wajib
initiatingParticipant.contact.identifierValue
string
wajib
initiatingParticipant.contact.platformAddress
string
initiatingParticipant.contact.platformAddressSelector
string
initiatingParticipant.conversationId
string
initiatingParticipant.createdAt
string
initiatingParticipant.displayName
string
initiatingParticipant.id
string
wajib
initiatingParticipant.resourceUri
string
initiatingParticipant.status
string
Possible values: invited, pending, active, inactive
initiatingParticipant.type
string
wajib
Possible values: user, contact, agent, flow, bot, accessKey, channel, connector, collaborationAutomation
initiatingParticipant.updatedAt
string
lastMessage
object
Tampilkan atribut turunan
lastMessage.createdAt
string
wajib
lastMessage.draft
boolean
wajib
lastMessage.id
string
wajib
lastMessage.preview
object
wajib
Tampilkan atribut turunan
lastMessage.preview.text
string
lastMessage.recipients
array of object
Tampilkan atribut turunan
lastMessage.recipients.contactAnnotation
object
Annotations add extra information to a sender or receiver. For email messages, the name annotation overrides the display name.
Tampilkan atribut turunan
lastMessage.recipients.contactAnnotation.name
string
lastMessage.recipients.countryCode
string
lastMessage.recipients.id
string
The ID of the contact.
lastMessage.recipients.identifierKey
string
The identifier key for finding the contact (e.g. emailaddress, phonenumber). For WhatsApp channels with BSUID support, use whatsappbsuid to send to a contact by their Business-Scoped User ID.
lastMessage.recipients.identifierValue
string
The identifier value for finding the contact.
lastMessage.recipients.identifiers
array of object
Additional identifiers to augment the contact during resolution.
Tampilkan atribut turunan
lastMessage.recipients.identifiers.identifierKey
string
wajib
The identifier key for finding the contact (e.g. emailaddress, phonenumber).
lastMessage.recipients.identifiers.identifierValue
string
wajib
The identifier value for finding the contact.
lastMessage.recipients.platformAddress
string
The resolved platform address used to deliver the message (e.g. phone number or email address).
lastMessage.recipients.platformAddressSelector
string
An expression that defines how we resolve the platform address from a contact. Optional override for the default resolution logic.
lastMessage.recipients.receiverExpression
string
lastMessage.recipients.receiverValue
string
lastMessage.recipients.type
string
The type of the receiver (e.g. to, cc, bcc for email).
lastMessage.sender
object
Tampilkan atribut turunan
lastMessage.sender.email
string
lastMessage.sender.name
string
lastMessage.sender.avatarUrl
string
lastMessage.sender.contact
object
Tampilkan atribut turunan
lastMessage.sender.contact.identifierKey
string
wajib
lastMessage.sender.contact.identifierValue
string
wajib
lastMessage.sender.contact.platformAddress
string
lastMessage.sender.contact.platformAddressSelector
string
lastMessage.sender.conversationId
string
lastMessage.sender.createdAt
string
lastMessage.sender.displayName
string
lastMessage.sender.id
string
wajib
lastMessage.sender.resourceUri
string
lastMessage.sender.status
string
Possible values: invited, pending, active, inactive
lastMessage.sender.type
string
wajib
Possible values: user, contact, agent, flow, bot, accessKey, channel, connector, collaborationAutomation
lastMessage.sender.updatedAt
string
lastMessage.status
string
wajib
Possible values: accepted, processing, sent, sending_failed, delivered, delivery_failed, deleted
lastMessage.type
string
wajib
Possible values: text, html, image, file, gif, location, carousel, list, section, authentication, action, comment
lastMessageIncomingAt
string
lastMessageOutgoingAt
string
name
string
wajib
participants
array of object
Tampilkan atribut turunan
participants.contact
object
Tampilkan atribut turunan
participants.contact.identifierKey
string
wajib
participants.contact.identifierValue
string
wajib
participants.contact.platformAddress
string
participants.contact.platformAddressSelector
string
participants.id
string
wajib
participants.type
string
wajib
Possible values: user, contact, agent, flow, bot, accessKey, channel, connector, collaborationAutomation
pendingParticipantCount
integer
platformStyle
string
wajib
Possible values: direct, email, direct-multiple, direct-threaded, group-multiple
privateAttributes
string
read
boolean
referral
object
Tampilkan atribut turunan
referral.caption
string
referral.mediaType
string
referral.mediaUrl
string
referral.sourceId
string
wajib
referral.sourceType
string
referral.sourceUrl
string
referral.text
string
referral.timestamp
string
referral.title
string
referral.username
string
resource
object
Tampilkan atribut turunan
resource.id
string
wajib
resource.type
string
wajib
Possible values: task, task-conversation, reimbursement, sales-lead, sales-opportunity, sales-account, expense, project
resourceUri
string
starred
boolean
status
string
wajib
Possible values: deleted, active, closed, spam, archived
style
string
wajib
Possible values: default, directMessage, chatChannel, personalInbox, resource, groupInbox, support
summary
string
tags
array of string
updatedAt
string
wajib
visibility
string
wajib
Possible values: public, private, direct, group
Contoh kode
curl -X POST 'https://api.bird.com/workspaces/{workspaceId}/conversations' \
  -H 'Authorization: AccessKey YOUR_ACCESS_KEY'

Examples

Starting a conversation with a simple message

Contoh kode
curl -X POST "https://api.bird.com/workspaces/a1405560-c8d3-4b1a-877d-3f449ad95352/conversations" \
-H "Content-Type: application/json" \
-H "Authorization: AccessKey abcd" \
-d '{
  "name": "Email Subject",
  "channelId": "25431165-c486-4a94-94f6-b3633c9af905",
  "participants": [
    {
      "type": "contact",
      "identifierKey": "emailaddress",
      "identifierValue": "john.doe@bird.com"
    }
  ],
  "initialMessage": {
    "body": {
      "type": "text",
      "text": {
        "text": "Hey, listen!"
      }
    },
    "recipients": [
      {
        "identifierKey": "emailaddress",
        "identifierValue": "john.doe@bird.com",
        "type": "to"
      }
    ]
  },
  "attributes": {
    "my-custom-attribute": "123"
  }
}'

Starting a conversation with an email template message

Contoh kode
curl -X POST "https://api.bird.com/workspaces/a1405560-c8d3-4b1a-877d-3f449ad95352/conversations" \
-H "Content-Type: application/json" \
-H "Authorization: AccessKey abcd" \
-d '{
  "name": "Email Subject",
  "channelId": "25431165-c486-4a94-94f6-b3633c9af905",
  "participants": [
    {
      "type": "contact",
      "identifierKey": "emailaddress",
      "identifierValue": "john.doe@bird.com"
    }
  ],
  "initialMessage": {
    "template": {
      "projectId": "5d9084b3-7cdb-4c87-bf7c-8871a1f21695",
      "version": "b33761d9-ece1-48e3-b542-b5bbf93bd8c3",
      "locale": "en",
      "parameters": [
        {
          "type": "string",
          "key": "myVariable",
          "value": "yay"
        }
      ]
    },
    "recipients": [
      {
        "identifierKey": "emailaddress",
        "identifierValue": "john.doe@bird.com",
        "type": "to"
      }
    ]
  },
  "attributes": {
    "my-custom-attribute": "123"
  }
}'

Starting a conversation with a WhatsApp template message

Contoh kode
curl -X POST "https://api.bird.com/workspaces/a1405560-c8d3-4b1a-877d-3f449ad95352/conversations" \
-H "Content-Type: application/json" \
-H "Authorization: AccessKey abcd" \
-d '{
  "name": "Ticket name",
  "channelId": "199f0353-fcb8-41b2-afd6-614c6baf3850",
  "participants": [
    {
      "type": "contact",
      "identifierKey": "phonenumber",
      "identifierValue": "+31612345678"
    }
  ],
  "initialMessage": {
    "template": {
      "projectId": "4720942c-9bde-4934-ab77-f600743894a1",
      "version": "5c0e4db5-20f2-4224-86f4-fce052997608",
      "locale": "en",
      "parameters": [
        {
          "type": "string",
          "key": "age",
          "value": "20"
        }
      ]
    },
    "recipients": [
      {
        "identifierKey": "phonenumber",
        "identifierValue": "+31612345678",
        "type": "to"
      }
    ]
  },
  "attributes": {
    "my-custom-attribute": "123"
  }
}'