curl --request POST \
--url https://api.nylon.dev/v1/connections/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "102938475610111",
"access_token": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({external_id: '102938475610111', access_token: '<string>'})
};
fetch('https://api.nylon.dev/v1/connections/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nylon.dev/v1/connections/import"
payload = {
"external_id": "102938475610111",
"access_token": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nylon.dev/v1/connections/import",
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([
'external_id' => '102938475610111',
'access_token' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/connections/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"102938475610111\",\n \"access_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "cly7p2q4k0001x8b3f2n9d0aa",
"network": "instagram",
"external_id": "17841400000000000",
"name": "Nylon Studio",
"status": "active",
"suspended": false,
"connected_at": "2026-05-14T10:20:00.000Z",
"handle": "nylonstudio",
"avatar_url": "https://cdn.example.com/avatar.jpg",
"profile_url": "https://www.instagram.com/nylonstudio"
}
}{
"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"
}
]
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required."
}
}{
"error": {
"code": "payment_required",
"message": "Nylon Studio is beyond your free allowance and your subscription is not active. Restart billing to publish through them again."
}
}{
"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"
}
]
}
}Import a connection
Connects a Facebook Page or Instagram account from an access token you already hold, without sending the customer through an authorization screen again.
This is for one situation: a platform moving existing connections onto
Nylon. POST /v1/connections is the normal way in, and it asks a human
to approve, because that is the only way a token can be granted. Use
this only for tokens that were already granted to the Meta app Nylon is
configured with — your own, under Platform keys.
The token is verified against Meta before anything is stored, so a stale one is refused here rather than at the first publish. Re-running an import refreshes the connection instead of duplicating it.
curl --request POST \
--url https://api.nylon.dev/v1/connections/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "102938475610111",
"access_token": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({external_id: '102938475610111', access_token: '<string>'})
};
fetch('https://api.nylon.dev/v1/connections/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nylon.dev/v1/connections/import"
payload = {
"external_id": "102938475610111",
"access_token": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nylon.dev/v1/connections/import",
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([
'external_id' => '102938475610111',
'access_token' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/connections/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"102938475610111\",\n \"access_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "cly7p2q4k0001x8b3f2n9d0aa",
"network": "instagram",
"external_id": "17841400000000000",
"name": "Nylon Studio",
"status": "active",
"suspended": false,
"connected_at": "2026-05-14T10:20:00.000Z",
"handle": "nylonstudio",
"avatar_url": "https://cdn.example.com/avatar.jpg",
"profile_url": "https://www.instagram.com/nylonstudio"
}
}{
"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"
}
]
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required."
}
}{
"error": {
"code": "payment_required",
"message": "Nylon Studio is beyond your free allowance and your subscription is not active. Restart billing to publish through them again."
}
}{
"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_.
Body
facebook, instagram The account's id on the network — a Page id, an Instagram account id.
"102938475610111"
The Page access token. Instagram authenticates with the token of the Page it is linked to, so both networks want the Page's.
The Page an Instagram account is linked to. Worked out from the token when omitted.
Response
The connected account.
Hide child attributes
Hide child attributes
Stable Nylon identifier for the connected profile. This is what you address a post to.
"cly7p2q4k0001x8b3f2n9d0aa"
A network Nylon publishes to.
facebook, instagram, x, linkedin, pinterest, bluesky, threads, tiktok, youtube, google_business, mastodon, discord, dribbble, kick, twitch, whop, devto "instagram"
The network's own identifier for the account.
"17841400000000000"
Display name of the connected profile.
"Nylon Studio"
active is healthy. needs_attention means the stored credentials
stopped working and the customer has to reconnect in Nylon.
active, needs_attention "active"
True when the profile is beyond the free allowance and billing is
not active. It is still listed and still connected, but publishing
to it is refused with 402.
false
"2026-05-14T10:20:00.000Z"
Network username without a leading @, when the network has one.
"nylonstudio"
"https://cdn.example.com/avatar.jpg"
"https://www.instagram.com/nylonstudio"