Create a link to connect a social account
curl --request POST \
--url https://mvp.tryunsora.com/api/v1/accounts/connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shared": true,
"reconnect_account_id": "<string>",
"handle": "<string>"
}
'import requests
url = "https://mvp.tryunsora.com/api/v1/accounts/connect"
payload = {
"shared": True,
"reconnect_account_id": "<string>",
"handle": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({shared: true, reconnect_account_id: '<string>', handle: '<string>'})
};
fetch('https://mvp.tryunsora.com/api/v1/accounts/connect', 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://mvp.tryunsora.com/api/v1/accounts/connect",
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([
'shared' => true,
'reconnect_account_id' => '<string>',
'handle' => '<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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mvp.tryunsora.com/api/v1/accounts/connect"
payload := strings.NewReader("{\n \"shared\": true,\n \"reconnect_account_id\": \"<string>\",\n \"handle\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://mvp.tryunsora.com/api/v1/accounts/connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"shared\": true,\n \"reconnect_account_id\": \"<string>\",\n \"handle\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mvp.tryunsora.com/api/v1/accounts/connect")
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 \"shared\": true,\n \"reconnect_account_id\": \"<string>\",\n \"handle\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"platform": "instagram",
"url": "<string>",
"shared": true,
"expiresAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}Accounts
Connect an account
Create a link that connects a social account to Unsora, to open yourself or send to whoever owns the account.
POST
/
accounts
/
connect
Create a link to connect a social account
curl --request POST \
--url https://mvp.tryunsora.com/api/v1/accounts/connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shared": true,
"reconnect_account_id": "<string>",
"handle": "<string>"
}
'import requests
url = "https://mvp.tryunsora.com/api/v1/accounts/connect"
payload = {
"shared": True,
"reconnect_account_id": "<string>",
"handle": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({shared: true, reconnect_account_id: '<string>', handle: '<string>'})
};
fetch('https://mvp.tryunsora.com/api/v1/accounts/connect', 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://mvp.tryunsora.com/api/v1/accounts/connect",
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([
'shared' => true,
'reconnect_account_id' => '<string>',
'handle' => '<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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mvp.tryunsora.com/api/v1/accounts/connect"
payload := strings.NewReader("{\n \"shared\": true,\n \"reconnect_account_id\": \"<string>\",\n \"handle\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://mvp.tryunsora.com/api/v1/accounts/connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"shared\": true,\n \"reconnect_account_id\": \"<string>\",\n \"handle\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mvp.tryunsora.com/api/v1/accounts/connect")
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 \"shared\": true,\n \"reconnect_account_id\": \"<string>\",\n \"handle\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"platform": "instagram",
"url": "<string>",
"shared": true,
"expiresAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}Returns the platform’s sign-in link, the same link Copy link makes in the app. Whoever opens it signs in to the platform, and the account appears in List accounts. The link works for one hour.
curl -X POST "https://mvp.tryunsora.com/api/v1/accounts/connect" \
-H "Authorization: Bearer uns_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"platform": "instagram"}'
{
"success": true,
"data": {
"platform": "instagram",
"url": "https://www.instagram.com/oauth/authorize?...",
"shared": true,
"expiresAt": "2026-12-04T15:00:00.000Z"
}
}
Shared or not
- Shared (the default): anyone who opens the link can connect an account, with no Unsora login. Use it to send the link to a client. It ends on a public “Connected” page.
"shared": false: for you. It ends on your accounts page in the app.
Reconnecting
When an account’s sign-in expires, pass its id asreconnect_account_id with the same platform. Reconnecting refreshes the account and doesn’t use a new slot on your plan.
Platforms
youtube, tiktok, instagram, instagram_facebook (an Instagram business account through its Facebook Page), facebook, threads, bluesky, pinterest, linkedin, x, google_business.
Bluesky signs in from the account’s handle, so it needs handle (for example alice.bsky.social) and its link is for you only.
Errors
| HTTP | Code | When |
|---|---|---|
400 | INVALID_PLATFORM | Unknown platform |
400 | Bluesky without handle, or reconnect_account_id is another platform’s account | |
403 | PLAN_REQUIRED | No active plan |
403 | ACCOUNT_LIMIT_REACHED | Every account slot on your plan is used |
403 | PLATFORM_UNAVAILABLE | The platform isn’t live yet |
404 | reconnect_account_id isn’t one of your accounts |
Authorizations
Body
application/json
Platform to connect. instagram_facebook connects an Instagram business account through the Facebook Page it is linked to. google is accepted for YouTube.
Available options:
youtube, tiktok, instagram, instagram_facebook, facebook, threads, bluesky, pinterest, linkedin, x, google_business 
