Skip to main content
POST
/
communication
/
threads
cURL
curl --request POST \
  --url https://app.masivo.ai/api/storefront/v1/communication/threads \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-account-id: <x-account-id>' \
  --data '
{
  "ticket_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "review_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "customer_id": "<string>",
  "inbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "channel_account_id": "<string>",
  "external_thread_id": "<string>",
  "status": "open",
  "assignee_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "metadata": {}
}
'
import requests

url = "https://app.masivo.ai/api/storefront/v1/communication/threads"

payload = {
"ticket_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"review_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "<string>",
"inbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_account_id": "<string>",
"external_thread_id": "<string>",
"status": "open",
"assignee_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {}
}
headers = {
"x-account-id": "<x-account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'x-account-id': '<x-account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ticket_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
review_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer_id: '<string>',
inbox_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
channel_account_id: '<string>',
external_thread_id: '<string>',
status: 'open',
assignee_user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
metadata: {}
})
};

fetch('https://app.masivo.ai/api/storefront/v1/communication/threads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://app.masivo.ai/api/storefront/v1/communication/threads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ticket_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'review_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customer_id' => '<string>',
'inbox_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'channel_account_id' => '<string>',
'external_thread_id' => '<string>',
'status' => 'open',
'assignee_user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'metadata' => [

]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-account-id: <x-account-id>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://app.masivo.ai/api/storefront/v1/communication/threads"

payload := strings.NewReader("{\n \"ticket_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"review_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_id\": \"<string>\",\n \"inbox_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"channel_account_id\": \"<string>\",\n \"external_thread_id\": \"<string>\",\n \"status\": \"open\",\n \"assignee_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {}\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-account-id", "<x-account-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://app.masivo.ai/api/storefront/v1/communication/threads")
.header("x-account-id", "<x-account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ticket_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"review_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_id\": \"<string>\",\n \"inbox_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"channel_account_id\": \"<string>\",\n \"external_thread_id\": \"<string>\",\n \"status\": \"open\",\n \"assignee_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.masivo.ai/api/storefront/v1/communication/threads")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-account-id"] = '<x-account-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ticket_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"review_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_id\": \"<string>\",\n \"inbox_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"channel_account_id\": \"<string>\",\n \"external_thread_id\": \"<string>\",\n \"status\": \"open\",\n \"assignee_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "ticket_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "review_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "customer_id": "<string>",
    "inbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "channel_account_id": "<string>",
    "external_thread_id": "<string>",
    "assignee_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "latest_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "latest_message_at": "2023-11-07T05:31:56Z",
    "latest_message_preview": "<string>",
    "unread_count": 123,
    "metadata": {},
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "closed_at": "2023-11-07T05:31:56Z",
    "deleted_at": "2023-11-07T05:31:56Z"
  }
}
{
"error": "<string>",
"details": "<string>"
}
{
"error": "<string>",
"details": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-account-id
string<uuid>
required

The account that owns the communication thread

Body

application/json
channel
enum<string>
required
Available options:
email,
whatsapp,
chat,
review,
system,
other
ticket_id
string<uuid> | null
review_id
string<uuid> | null
customer_id
string | null
inbox_id
string<uuid> | null
channel_account_id
string | null
external_thread_id
string | null
status
enum<string>
default:open
Available options:
open,
closed
assignee_user_id
string<uuid> | null
metadata
object

Response

Communication thread created

data
object