Retrieve a conversation
curl --request GET \
--url https://api.nylon.dev/v1/inbox/conversations/{conversationId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nylon.dev/v1/inbox/conversations/{conversationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nylon.dev/v1/inbox/conversations/{conversationId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nylon.dev/v1/inbox/conversations/{conversationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.nylon.dev/v1/inbox/conversations/{conversationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"profile_id": "<string>",
"network": "instagram",
"kind": "dm",
"status": "open",
"unread_count": 123,
"last_message": {
"text": "<string>",
"at": "2023-11-07T05:31:56Z"
},
"profile_external_id": "102938475610111",
"external_id": "<string>",
"participant": {
"id": "<string>",
"name": "<string>",
"handle": "<string>",
"avatar_url": "<string>"
},
"url": "<string>",
"referral": {},
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required."
}
}{
"error": {
"code": "not_found",
"message": "Post could not be found."
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry after the window resets."
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required.",
"details": [
{
"message": "Instagram requires at least 1 media item — text-only posts are not supported.",
"field": "profile_ids",
"network": "instagram",
"code": "invalid_request"
}
]
}
}Inbox
Retrieve a conversation
One thread and its unread count.
GET
https://api.nylon.dev
/
v1
/
inbox
/
conversations
/
{conversationId}
Retrieve a conversation
curl --request GET \
--url https://api.nylon.dev/v1/inbox/conversations/{conversationId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nylon.dev/v1/inbox/conversations/{conversationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nylon.dev/v1/inbox/conversations/{conversationId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nylon.dev/v1/inbox/conversations/{conversationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.nylon.dev/v1/inbox/conversations/{conversationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"profile_id": "<string>",
"network": "instagram",
"kind": "dm",
"status": "open",
"unread_count": 123,
"last_message": {
"text": "<string>",
"at": "2023-11-07T05:31:56Z"
},
"profile_external_id": "102938475610111",
"external_id": "<string>",
"participant": {
"id": "<string>",
"name": "<string>",
"handle": "<string>",
"avatar_url": "<string>"
},
"url": "<string>",
"referral": {},
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required."
}
}{
"error": {
"code": "not_found",
"message": "Post could not be found."
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry after the window resets."
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required.",
"details": [
{
"message": "Instagram requires at least 1 media item — text-only posts are not supported.",
"field": "profile_ids",
"network": "instagram",
"code": "invalid_request"
}
]
}
}Authorizations
An API key beginning with nylon_live_.
Path Parameters
The Nylon id of the conversation.
Example:
"cly8a1b2c0001x8b3d4e5f0gg"
Response
The conversation.
Hide child attributes
Hide child attributes
The connected account this thread is on.
A network Nylon publishes to.
Available options:
facebook, instagram, x, linkedin, pinterest, bluesky, threads, tiktok, youtube, google_business, mastodon, discord, dribbble, kick, twitch, whop, devto Example:
"instagram"
A comment thread is public; a dm is not.
Available options:
dm, comment, mention Available options:
open, closed Cleared only by POST .../read, never by reading the messages.
That account's id on the network itself — a Page id, an Instagram account id — so a thread can be matched to an account without a second call.
Example:
"102938475610111"
The thread's id on the network.
Where to open this on the network itself.
How the conversation started, when the network says so — an ad, a ref link, a post.
⌘I