Send a message in a conversation
curl --request POST \
--url https://api.social-api.ai/v1/inbox/conversations/{conversation_id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "acc_abc123",
"attachment_url": "https://cdn.example.com/photo.jpg",
"attachments": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"caption": "The damaged panel",
"type": "image",
"voice": true
}
],
"buttons": [
{
"title": "View order",
"type": "url",
"payload": "VIEW_ORDER",
"url": "https://shop.example.com/orders/1"
}
],
"cards": [
{
"title": "Product name",
"buttons": [
{
"title": "View order",
"type": "url",
"payload": "VIEW_ORDER",
"url": "https://shop.example.com/orders/1"
}
],
"image_url": "https://cdn.example.com/p.jpg",
"subtitle": "Short description"
}
],
"list_button": "View options",
"list_sections": [
{
"rows": [
{
"id": "menu:review_drafts",
"title": "Review drafts",
"description": "3 posts waiting"
}
],
"title": "This week"
}
],
"message_tag": "HUMAN_AGENT",
"quick_replies": [
{
"title": "Track my order",
"payload": "TRACK_ORDER"
}
],
"reply_to_message_id": "m_1234567890",
"text": "Thanks for your message!"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account_id: 'acc_abc123',
attachment_url: 'https://cdn.example.com/photo.jpg',
attachments: [
{
source: '550e8400-e29b-41d4-a716-446655440000',
source_type: 'media_id',
caption: 'The damaged panel',
type: 'image',
voice: true
}
],
buttons: [
{
title: 'View order',
type: 'url',
payload: 'VIEW_ORDER',
url: 'https://shop.example.com/orders/1'
}
],
cards: [
{
title: 'Product name',
buttons: [
{
title: 'View order',
type: 'url',
payload: 'VIEW_ORDER',
url: 'https://shop.example.com/orders/1'
}
],
image_url: 'https://cdn.example.com/p.jpg',
subtitle: 'Short description'
}
],
list_button: 'View options',
list_sections: [
{
rows: [
{
id: 'menu:review_drafts',
title: 'Review drafts',
description: '3 posts waiting'
}
],
title: 'This week'
}
],
message_tag: 'HUMAN_AGENT',
quick_replies: [{title: 'Track my order', payload: 'TRACK_ORDER'}],
reply_to_message_id: 'm_1234567890',
text: 'Thanks for your message!'
})
};
fetch('https://api.social-api.ai/v1/inbox/conversations/{conversation_id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/inbox/conversations/{conversation_id}/messages"
payload = {
"account_id": "acc_abc123",
"attachment_url": "https://cdn.example.com/photo.jpg",
"attachments": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"caption": "The damaged panel",
"type": "image",
"voice": True
}
],
"buttons": [
{
"title": "View order",
"type": "url",
"payload": "VIEW_ORDER",
"url": "https://shop.example.com/orders/1"
}
],
"cards": [
{
"title": "Product name",
"buttons": [
{
"title": "View order",
"type": "url",
"payload": "VIEW_ORDER",
"url": "https://shop.example.com/orders/1"
}
],
"image_url": "https://cdn.example.com/p.jpg",
"subtitle": "Short description"
}
],
"list_button": "View options",
"list_sections": [
{
"rows": [
{
"id": "menu:review_drafts",
"title": "Review drafts",
"description": "3 posts waiting"
}
],
"title": "This week"
}
],
"message_tag": "HUMAN_AGENT",
"quick_replies": [
{
"title": "Track my order",
"payload": "TRACK_ORDER"
}
],
"reply_to_message_id": "m_1234567890",
"text": "Thanks for your message!"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"message_id": "m_1234567890",
"message_ids": [
"m_1234567890"
],
"success": true
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}Inbox
Send a message in a conversation
Sends an outgoing DM via the connected platform account and records it in the conversation.
POST
/
inbox
/
conversations
/
{conversation_id}
/
messages
Send a message in a conversation
curl --request POST \
--url https://api.social-api.ai/v1/inbox/conversations/{conversation_id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "acc_abc123",
"attachment_url": "https://cdn.example.com/photo.jpg",
"attachments": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"caption": "The damaged panel",
"type": "image",
"voice": true
}
],
"buttons": [
{
"title": "View order",
"type": "url",
"payload": "VIEW_ORDER",
"url": "https://shop.example.com/orders/1"
}
],
"cards": [
{
"title": "Product name",
"buttons": [
{
"title": "View order",
"type": "url",
"payload": "VIEW_ORDER",
"url": "https://shop.example.com/orders/1"
}
],
"image_url": "https://cdn.example.com/p.jpg",
"subtitle": "Short description"
}
],
"list_button": "View options",
"list_sections": [
{
"rows": [
{
"id": "menu:review_drafts",
"title": "Review drafts",
"description": "3 posts waiting"
}
],
"title": "This week"
}
],
"message_tag": "HUMAN_AGENT",
"quick_replies": [
{
"title": "Track my order",
"payload": "TRACK_ORDER"
}
],
"reply_to_message_id": "m_1234567890",
"text": "Thanks for your message!"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account_id: 'acc_abc123',
attachment_url: 'https://cdn.example.com/photo.jpg',
attachments: [
{
source: '550e8400-e29b-41d4-a716-446655440000',
source_type: 'media_id',
caption: 'The damaged panel',
type: 'image',
voice: true
}
],
buttons: [
{
title: 'View order',
type: 'url',
payload: 'VIEW_ORDER',
url: 'https://shop.example.com/orders/1'
}
],
cards: [
{
title: 'Product name',
buttons: [
{
title: 'View order',
type: 'url',
payload: 'VIEW_ORDER',
url: 'https://shop.example.com/orders/1'
}
],
image_url: 'https://cdn.example.com/p.jpg',
subtitle: 'Short description'
}
],
list_button: 'View options',
list_sections: [
{
rows: [
{
id: 'menu:review_drafts',
title: 'Review drafts',
description: '3 posts waiting'
}
],
title: 'This week'
}
],
message_tag: 'HUMAN_AGENT',
quick_replies: [{title: 'Track my order', payload: 'TRACK_ORDER'}],
reply_to_message_id: 'm_1234567890',
text: 'Thanks for your message!'
})
};
fetch('https://api.social-api.ai/v1/inbox/conversations/{conversation_id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/inbox/conversations/{conversation_id}/messages"
payload = {
"account_id": "acc_abc123",
"attachment_url": "https://cdn.example.com/photo.jpg",
"attachments": [
{
"source": "550e8400-e29b-41d4-a716-446655440000",
"source_type": "media_id",
"caption": "The damaged panel",
"type": "image",
"voice": True
}
],
"buttons": [
{
"title": "View order",
"type": "url",
"payload": "VIEW_ORDER",
"url": "https://shop.example.com/orders/1"
}
],
"cards": [
{
"title": "Product name",
"buttons": [
{
"title": "View order",
"type": "url",
"payload": "VIEW_ORDER",
"url": "https://shop.example.com/orders/1"
}
],
"image_url": "https://cdn.example.com/p.jpg",
"subtitle": "Short description"
}
],
"list_button": "View options",
"list_sections": [
{
"rows": [
{
"id": "menu:review_drafts",
"title": "Review drafts",
"description": "3 posts waiting"
}
],
"title": "This week"
}
],
"message_tag": "HUMAN_AGENT",
"quick_replies": [
{
"title": "Track my order",
"payload": "TRACK_ORDER"
}
],
"reply_to_message_id": "m_1234567890",
"text": "Thanks for your message!"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"message_id": "m_1234567890",
"message_ids": [
"m_1234567890"
],
"success": true
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}Authorizations
Body
application/json
Message payload
Optional. Only HUMAN_AGENT is accepted, on Instagram accounts connected with Instagram Login, for replies a member of your team types between 24 hours and 7 days after the person's last message. Workflows, automations, bots and AI agents acting on their own send without it, so they reply within 24 hours of the person's last message. Ask support to enable it for your account. Inside 24 hours the message is sent without the tag.
Example:
"HUMAN_AGENT"
Example:
"Thanks for your message!"
Response
Message sent with ID