curl --request POST \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/conversations \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"source_id": "1234567890",
"inbox_id": 1
}
'const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({source_id: '1234567890', inbox_id: 1})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/conversations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/conversations"
payload = {
"source_id": "1234567890",
"inbox_id": 1
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"messages": [
{
"id": 123,
"content": "<string>",
"account_id": 123,
"inbox_id": 123,
"conversation_id": 123,
"message_type": 0,
"created_at": 123,
"updated_at": 123,
"private": true,
"status": "sent",
"source_id": "<string>",
"content_type": "text",
"content_attributes": {},
"sender_type": "contact",
"sender_id": 123,
"external_source_ids": {},
"additional_attributes": {},
"processed_message_content": "<string>",
"sentiment": {},
"conversation": {},
"attachment": {},
"sender": {}
}
],
"account_id": 123,
"uuid": "<string>",
"additional_attributes": {},
"agent_last_seen_at": 123,
"assignee_last_seen_at": 123,
"can_reply": true,
"contact_last_seen_at": 123,
"custom_attributes": {},
"inbox_id": 123,
"labels": [
"<string>"
],
"muted": true,
"snoozed_until": 123,
"status": "open",
"created_at": 123,
"updated_at": 123,
"timestamp": "<string>",
"first_reply_created_at": 123,
"unread_count": 123,
"last_non_activity_message": {
"id": 123,
"content": "<string>",
"account_id": 123,
"inbox_id": 123,
"conversation_id": 123,
"message_type": 0,
"created_at": 123,
"updated_at": 123,
"private": true,
"status": "sent",
"source_id": "<string>",
"content_type": "text",
"content_attributes": {},
"sender_type": "contact",
"sender_id": 123,
"external_source_ids": {},
"additional_attributes": {},
"processed_message_content": "<string>",
"sentiment": {},
"conversation": {},
"attachment": {},
"sender": {}
},
"last_activity_at": 123,
"priority": "<string>",
"waiting_since": 123,
"sla_policy_id": 123,
"applied_sla": {},
"sla_events": [
{}
],
"meta": {
"sender": {
"additional_attributes": {},
"availability_status": "<string>",
"email": "<string>",
"id": 123,
"name": "<string>",
"phone_number": "<string>",
"blocked": true,
"identifier": "<string>",
"thumbnail": "<string>",
"custom_attributes": {},
"last_activity_at": 123,
"created_at": 123
},
"channel": "<string>",
"assignee": {
"id": 123,
"access_token": "<string>",
"account_id": 123,
"available_name": "<string>",
"avatar_url": "<string>",
"confirmed": true,
"display_name": "<string>",
"message_signature": "<string>",
"email": "<string>",
"hmac_identifier": "<string>",
"inviter_id": 123,
"name": "<string>",
"provider": "<string>",
"pubsub_token": "<string>",
"role": "agent",
"ui_settings": {},
"uid": "<string>",
"type": "<string>",
"custom_attributes": {},
"accounts": [
{
"id": 123,
"name": "<string>",
"status": "<string>",
"active_at": "2023-11-07T05:31:56Z",
"role": "administrator",
"permissions": [
"<string>"
],
"availability": "<string>",
"availability_status": "<string>",
"auto_offline": true,
"custom_role_id": 123,
"custom_role": {}
}
]
},
"hmac_verified": true
}
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{}{}Create conversation
Create a conversation. The existing list operation stays on GET.
curl --request POST \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/conversations \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"source_id": "1234567890",
"inbox_id": 1
}
'const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({source_id: '1234567890', inbox_id: 1})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/conversations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/conversations"
payload = {
"source_id": "1234567890",
"inbox_id": 1
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"messages": [
{
"id": 123,
"content": "<string>",
"account_id": 123,
"inbox_id": 123,
"conversation_id": 123,
"message_type": 0,
"created_at": 123,
"updated_at": 123,
"private": true,
"status": "sent",
"source_id": "<string>",
"content_type": "text",
"content_attributes": {},
"sender_type": "contact",
"sender_id": 123,
"external_source_ids": {},
"additional_attributes": {},
"processed_message_content": "<string>",
"sentiment": {},
"conversation": {},
"attachment": {},
"sender": {}
}
],
"account_id": 123,
"uuid": "<string>",
"additional_attributes": {},
"agent_last_seen_at": 123,
"assignee_last_seen_at": 123,
"can_reply": true,
"contact_last_seen_at": 123,
"custom_attributes": {},
"inbox_id": 123,
"labels": [
"<string>"
],
"muted": true,
"snoozed_until": 123,
"status": "open",
"created_at": 123,
"updated_at": 123,
"timestamp": "<string>",
"first_reply_created_at": 123,
"unread_count": 123,
"last_non_activity_message": {
"id": 123,
"content": "<string>",
"account_id": 123,
"inbox_id": 123,
"conversation_id": 123,
"message_type": 0,
"created_at": 123,
"updated_at": 123,
"private": true,
"status": "sent",
"source_id": "<string>",
"content_type": "text",
"content_attributes": {},
"sender_type": "contact",
"sender_id": 123,
"external_source_ids": {},
"additional_attributes": {},
"processed_message_content": "<string>",
"sentiment": {},
"conversation": {},
"attachment": {},
"sender": {}
},
"last_activity_at": 123,
"priority": "<string>",
"waiting_since": 123,
"sla_policy_id": 123,
"applied_sla": {},
"sla_events": [
{}
],
"meta": {
"sender": {
"additional_attributes": {},
"availability_status": "<string>",
"email": "<string>",
"id": 123,
"name": "<string>",
"phone_number": "<string>",
"blocked": true,
"identifier": "<string>",
"thumbnail": "<string>",
"custom_attributes": {},
"last_activity_at": 123,
"created_at": 123
},
"channel": "<string>",
"assignee": {
"id": 123,
"access_token": "<string>",
"account_id": 123,
"available_name": "<string>",
"avatar_url": "<string>",
"confirmed": true,
"display_name": "<string>",
"message_signature": "<string>",
"email": "<string>",
"hmac_identifier": "<string>",
"inviter_id": 123,
"name": "<string>",
"provider": "<string>",
"pubsub_token": "<string>",
"role": "agent",
"ui_settings": {},
"uid": "<string>",
"type": "<string>",
"custom_attributes": {},
"accounts": [
{
"id": 123,
"name": "<string>",
"status": "<string>",
"active_at": "2023-11-07T05:31:56Z",
"role": "administrator",
"permissions": [
"<string>"
],
"availability": "<string>",
"availability_status": "<string>",
"auto_offline": true,
"custom_role_id": 123,
"custom_role": {}
}
]
},
"hmac_verified": true
}
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{}{}Authorizations
Path Parameters
The numeric ID of the account
Body
Conversation source id
"1234567890"
Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email
1
Contact Id for which conversation is created
1
Lets you specify attributes like browser information
{
"browser": "Chrome",
"browser_version": "89.0.4389.82",
"os": "Windows",
"os_version": "10"
}
The object to save custom attributes for conversation, accepts custom attributes key and value
{
"attribute_key": "attribute_value",
"priority_conversation_number": 3
}
Specify the conversation whether it's pending, open, closed
open, resolved, pending "open"
Agent Id for assigning a conversation to an agent
1
Team Id for assigning a conversation to a team\
1
Snoozed until date time
"2030-07-21T17:32:28Z"
The initial message to be sent to the conversation
Show child attributes
Show child attributes
Response
Created
ID of the conversation
Show child attributes
Show child attributes
Account Id
UUID of the conversation
The object containing additional attributes related to the conversation
The last activity at of the agent
The last activity at of the assignee
Whether the conversation can be replied to
The last activity at of the contact
The object to save custom attributes for conversation, accepts custom attributes key and value
ID of the inbox
The labels of the conversation
Whether the conversation is muted
The time at which the conversation will be unmuted
The status of the conversation
open, resolved, pending The time at which conversation was created
The time at which conversation was updated
The time at which conversation was created
The time at which the first reply was created
The number of unread messages
Show child attributes
Show child attributes
The last activity at of the conversation
The priority of the conversation
The time at which the conversation was waiting
The ID of the SLA policy
The applied SLA
Show child attributes
Show child attributes