Create conversation
Examples
Starting a conversation with a simple message
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"
}
}'
{
"id": "2280c45c-60d5-45a2-b51d-06ea752ca167",
"name": "Email Subject",
"description": "",
"status": "active",
"visibility": "public",
"accessibility": "open",
"featuredParticipants": [
{
"id": "192c4449-9ccd-4747-8969-3bf07696af1c",
"type": "accessKey",
"status": "active",
"displayName": "My first email key",
"avatarUrl": ""
},
{
"id": "2d789fa4-85b7-4e59-b862-48062a0c0aa8",
"type": "contact",
"status": "active",
"displayName": "John Doe",
"avatarUrl": "",
"contact": {
"identifierKey": "emailaddress",
"identifierValue": "john.doe@bird.com",
"platformAddress": "john.doe@bird.com"
}
}
],
"activeParticipantCount": 2,
"pendingParticipantCount": 0,
"initiatingParticipant": {
"id": "192c4449-9ccd-4747-8969-3bf07696af1c",
"type": "accessKey",
"status": "active",
"displayName": "My first email key",
"avatarUrl": ""
},
"channelId": "25431165-c486-4a94-94f6-b3633c9af905",
"lastMessage": {
"id": "1c3a1c2d-2d27-4d5d-b7e4-ce62aecbba06",
"type": "text",
"preview": {
"text": "Hey, listen!"
},
"recipients": [
{
"type": "to",
"id": "2d789fa4-85b7-4e59-b862-48062a0c0aa8",
"identifierKey": "emailaddress",
"identifierValue": "john.doe@bird.com",
"platformAddress": "john.doe@bird.com",
"contactAnnotation": {
"name": "John Doe"
}
}
],
"status": "accepted",
"sender": {
"id": "192c4449-9ccd-4747-8969-3bf07696af1c",
"type": "accessKey",
"status": "active",
"displayName": "My first email key",
"avatarUrl": ""
},
"createdAt": "2024-11-29T13:47:08.59Z"
},
"createdAt": "2024-11-29T13:47:08.546Z",
"updatedAt": "2024-11-29T13:47:08.591Z",
"platformStyle": "email",
"attributes": {
"my-custom-attribute": "123"
}
}
Starting a conversation with an email template message
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"
}
}'
{
"id": "efec8397-c992-4195-9b1e-319b6ba8be26",
"name": "Email Subject",
"description": "",
"status": "active",
"visibility": "public",
"accessibility": "open",
"featuredParticipants": [
{
"id": "68b80b8d-8060-42df-bda3-73505a8fdb84",
"type": "accessKey",
"status": "active",
"displayName": "My first email key",
"avatarUrl": ""
},
{
"id": "8f0b5377-2edc-4116-a8e8-6a475f245a04",
"type": "contact",
"status": "active",
"displayName": "John Doe",
"avatarUrl": "",
"contact": {
"identifierKey": "emailaddress",
"identifierValue": "john.doe@bird.com",
"platformAddress": "john.doe@bird.com"
}
}
],
"activeParticipantCount": 2,
"pendingParticipantCount": 0,
"initiatingParticipant": {
"id": "68b80b8d-8060-42df-bda3-73505a8fdb84",
"type": "accessKey",
"status": "active",
"displayName": "My first email key",
"avatarUrl": ""
},
"channelId": "cb4b1ebc-34e6-5a7a-a375-f6f2f131d88f",
"lastMessage": {
"id": "8849a1da-f8e9-41fa-8e60-8e12b1c6ed1a",
"type": "html",
"preview": {
"text": ""
},
"recipients": [
{
"type": "to",
"id": "8f0b5377-2edc-4116-a8e8-6a475f245a04",
"identifierKey": "emailaddress",
"identifierValue": "john.doe@bird.com",
"platformAddress": "john.doe@bird.com",
"contactAnnotation": {
"name": "John Doe"
}
}
],
"status": "accepted",
"sender": {
"id": "68b80b8d-8060-42df-bda3-73505a8fdb84",
"type": "accessKey",
"status": "active",
"displayName": "My first email key",
"avatarUrl": ""
},
"createdAt": "2024-12-02T13:42:06.876Z"
},
"createdAt": "2024-12-02T13:42:06.686Z",
"updatedAt": "2024-12-02T13:42:06.877Z",
"platformStyle": "email",
"attributes": {
"my-custom-attribute": "123"
}
}
Starting a conversation with a WhatsApp template message
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"
}
}'
{
"id": "50a23da3-2ad9-42dd-94af-65b1b4271cb9",
"name": "Ticket name",
"description": "",
"status": "active",
"visibility": "public",
"accessibility": "open",
"featuredParticipants": [
{
"id": "f9129db4-b39e-4dab-aa2f-e55904e90104",
"type": "accessKey",
"status": "active",
"displayName": "My first key",
"avatarUrl": ""
},
{
"id": "f64db2ae-d6cb-4a3d-b1e1-2401fdf02f27",
"type": "contact",
"status": "active",
"displayName": "John Doe",
"avatarUrl": "",
"contact": {
"identifierKey": "phonenumber",
"identifierValue": "+31612345678",
"platformAddress": "+31612345678"
}
}
],
"activeParticipantCount": 2,
"pendingParticipantCount": 0,
"initiatingParticipant": {
"id": "f9129db4-b39e-4dab-aa2f-e55904e90104",
"type": "accessKey",
"status": "active",
"displayName": "My first key",
"avatarUrl": ""
},
"channelId": "199f0353-fcb8-41b2-afd6-614c6baf3850",
"lastMessage": {
"id": "25b3b6a2-7e1f-49ec-9371-b9a945fd6cec",
"type": "list",
"preview": {
"text": "Message type 'list' was sent."
},
"recipients": [
{
"type": "to",
"id": "f64db2ae-d6cb-4a3d-b1e1-2401fdf02f27",
"identifierKey": "phonenumber",
"identifierValue": "+31612345678",
"platformAddress": "+31612345678",
"contactAnnotation": {
"name": "John Doe"
}
}
],
"status": "accepted",
"sender": {
"id": "f9129db4-b39e-4dab-aa2f-e55904e90104",
"type": "accessKey",
"status": "active",
"displayName": "My first key",
"avatarUrl": ""
},
"createdAt": "2024-12-02T14:52:42.583Z"
},
"createdAt": "2024-12-02T14:52:42.484Z",
"updatedAt": "2024-12-02T14:52:42.583Z",
"platformStyle": "direct",
"attributes": {
"my-custom-attribute": "123"
}
}
Last updated