Get conversations for contacts
curl --request POST \
--url https://core-api.getaptly.com/api/contacts/conversations \
--header 'Content-Type: application/json' \
--header 'x-token: <api-key>' \
--data '
{
"personIds": [
"contact-1",
"contact-2"
],
"status": "all",
"skip": 0,
"limit": 20
}
'import requests
url = "https://core-api.getaptly.com/api/contacts/conversations"
payload = {
"personIds": ["contact-1", "contact-2"],
"status": "all",
"skip": 0,
"limit": 20
}
headers = {
"x-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({personIds: ['contact-1', 'contact-2'], status: 'all', skip: 0, limit: 20})
};
fetch('https://core-api.getaptly.com/api/contacts/conversations', 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://core-api.getaptly.com/api/contacts/conversations",
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([
'personIds' => [
'contact-1',
'contact-2'
],
'status' => 'all',
'skip' => 0,
'limit' => 20
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-token: <api-key>"
],
]);
$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://core-api.getaptly.com/api/contacts/conversations"
payload := strings.NewReader("{\n \"personIds\": [\n \"contact-1\",\n \"contact-2\"\n ],\n \"status\": \"all\",\n \"skip\": 0,\n \"limit\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-token", "<api-key>")
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://core-api.getaptly.com/api/contacts/conversations")
.header("x-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"personIds\": [\n \"contact-1\",\n \"contact-2\"\n ],\n \"status\": \"all\",\n \"skip\": 0,\n \"limit\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api.getaptly.com/api/contacts/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"personIds\": [\n \"contact-1\",\n \"contact-2\"\n ],\n \"status\": \"all\",\n \"skip\": 0,\n \"limit\": 20\n}"
response = http.request(request)
puts response.read_body{
"personIds": [
"<string>"
],
"conversations": [
{
"_id": "<string>",
"subject": "<string>",
"description": "<string>",
"messageCount": 123,
"type": "<string>",
"status": 123,
"assigneeId": "<string>",
"participants": [
"<string>"
],
"channel": {
"id": "<string>",
"type": "<string>"
},
"metrics": {
"lastMessageAt": "2023-11-07T05:31:56Z",
"lastActivityAt": "2023-11-07T05:31:56Z",
"lastMessageDirection": "in"
}
}
],
"hasMore": true,
"skip": 123,
"limit": 123
}Contacts
Get conversations for contacts
Find real email, SMS, and call conversations by the contacts’ stored email addresses and phone numbers, without a helpdesk ticket requirement. Includes open and closed threads by default, with no recent-date cutoff. Excludes junk/deleted streams and synthetic bulk-campaign activity. Newest message first, across accessible inboxes. API keys have company scope; delegate tokens need contacts:* read scope and follow current membership, inbox/team/monitor and contact-type sharing permissions (respecting channel opt-outs). Every contact must be active and in the authenticated company. Empty addresses return an empty page.
POST
/
api
/
contacts
/
conversations
Get conversations for contacts
curl --request POST \
--url https://core-api.getaptly.com/api/contacts/conversations \
--header 'Content-Type: application/json' \
--header 'x-token: <api-key>' \
--data '
{
"personIds": [
"contact-1",
"contact-2"
],
"status": "all",
"skip": 0,
"limit": 20
}
'import requests
url = "https://core-api.getaptly.com/api/contacts/conversations"
payload = {
"personIds": ["contact-1", "contact-2"],
"status": "all",
"skip": 0,
"limit": 20
}
headers = {
"x-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({personIds: ['contact-1', 'contact-2'], status: 'all', skip: 0, limit: 20})
};
fetch('https://core-api.getaptly.com/api/contacts/conversations', 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://core-api.getaptly.com/api/contacts/conversations",
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([
'personIds' => [
'contact-1',
'contact-2'
],
'status' => 'all',
'skip' => 0,
'limit' => 20
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-token: <api-key>"
],
]);
$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://core-api.getaptly.com/api/contacts/conversations"
payload := strings.NewReader("{\n \"personIds\": [\n \"contact-1\",\n \"contact-2\"\n ],\n \"status\": \"all\",\n \"skip\": 0,\n \"limit\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-token", "<api-key>")
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://core-api.getaptly.com/api/contacts/conversations")
.header("x-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"personIds\": [\n \"contact-1\",\n \"contact-2\"\n ],\n \"status\": \"all\",\n \"skip\": 0,\n \"limit\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api.getaptly.com/api/contacts/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"personIds\": [\n \"contact-1\",\n \"contact-2\"\n ],\n \"status\": \"all\",\n \"skip\": 0,\n \"limit\": 20\n}"
response = http.request(request)
puts response.read_body{
"personIds": [
"<string>"
],
"conversations": [
{
"_id": "<string>",
"subject": "<string>",
"description": "<string>",
"messageCount": 123,
"type": "<string>",
"status": 123,
"assigneeId": "<string>",
"participants": [
"<string>"
],
"channel": {
"id": "<string>",
"type": "<string>"
},
"metrics": {
"lastMessageAt": "2023-11-07T05:31:56Z",
"lastActivityAt": "2023-11-07T05:31:56Z",
"lastMessageDirection": "in"
}
}
],
"hasMore": true,
"skip": 123,
"limit": 123
}Authorizations
ApiKeyHeaderDelegateToken
Body
application/json
Required array length:
1 - 20 elementsRequired string length:
1 - 128Available options:
all, open, closed Channel meta.id; narrows authorized inboxes, never expands access.
Subject contains text; comma-separated literal alternatives.
Maximum string length:
200Required range:
0 <= x <= 100000Required range:
1 <= x <= 60