Connect a platform account
curl --request POST \
--url https://optareach.com/api/v1/platforms/{platform}/accounts \
--header 'Content-Type: application/json' \
--data '
{
"connectionMethod": "credentials_2fa",
"username": "simeon@example.com",
"password": "your-linkedin-password",
"country": "North Macedonia",
"twoFactorSecret": "YOUR_AUTHENTICATOR_SECRET"
}
'import requests
url = "https://optareach.com/api/v1/platforms/{platform}/accounts"
payload = {
"connectionMethod": "credentials_2fa",
"username": "simeon@example.com",
"password": "your-linkedin-password",
"country": "North Macedonia",
"twoFactorSecret": "YOUR_AUTHENTICATOR_SECRET"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
connectionMethod: 'credentials_2fa',
username: 'simeon@example.com',
password: 'your-linkedin-password',
country: 'North Macedonia',
twoFactorSecret: 'YOUR_AUTHENTICATOR_SECRET'
})
};
fetch('https://optareach.com/api/v1/platforms/{platform}/accounts', 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://optareach.com/api/v1/platforms/{platform}/accounts",
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([
'connectionMethod' => 'credentials_2fa',
'username' => 'simeon@example.com',
'password' => 'your-linkedin-password',
'country' => 'North Macedonia',
'twoFactorSecret' => 'YOUR_AUTHENTICATOR_SECRET'
]),
CURLOPT_HTTPHEADER => [
"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://optareach.com/api/v1/platforms/{platform}/accounts"
payload := strings.NewReader("{\n \"connectionMethod\": \"credentials_2fa\",\n \"username\": \"simeon@example.com\",\n \"password\": \"your-linkedin-password\",\n \"country\": \"North Macedonia\",\n \"twoFactorSecret\": \"YOUR_AUTHENTICATOR_SECRET\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://optareach.com/api/v1/platforms/{platform}/accounts")
.header("Content-Type", "application/json")
.body("{\n \"connectionMethod\": \"credentials_2fa\",\n \"username\": \"simeon@example.com\",\n \"password\": \"your-linkedin-password\",\n \"country\": \"North Macedonia\",\n \"twoFactorSecret\": \"YOUR_AUTHENTICATOR_SECRET\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://optareach.com/api/v1/platforms/{platform}/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"connectionMethod\": \"credentials_2fa\",\n \"username\": \"simeon@example.com\",\n \"password\": \"your-linkedin-password\",\n \"country\": \"North Macedonia\",\n \"twoFactorSecret\": \"YOUR_AUTHENTICATOR_SECRET\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c7de2c5-617c-4c1b-9c6f-b6e659b08d92",
"created": true
}
}{
"data": {
"id": "3c7de2c5-617c-4c1b-9c6f-b6e659b08d92",
"owner_id": "7b5740db-28bb-4e2c-89b0-bd4f19a37b10",
"service": "linkedin",
"metadata": {
"username": "simeon@example.com",
"name": "Simeon",
"status": "Healthy",
"tracking_preference": "all_conversations"
}
},
"refreshOn": [
"accounts.create",
"accounts.update",
"accounts.delete"
]
}{
"error": {
"code": "validation_error",
"message": "Payload failed validation.",
"details": {
"field": "body"
}
}
}Accounts
Connect a platform account
Connects a sender account using the platform-supported connection method. Optareach encrypts credentials, enforces account limits, and queues validation. Supported connectionMethod values: linkedin (credentials, credentials_2fa, extension); email (app_password); reddit (extension, browser_session); x (extension); github and hackernews (credentials, extension); stackoverflow (extension).
POST
/
api
/
v1
/
platforms
/
{platform}
/
accounts
Connect a platform account
curl --request POST \
--url https://optareach.com/api/v1/platforms/{platform}/accounts \
--header 'Content-Type: application/json' \
--data '
{
"connectionMethod": "credentials_2fa",
"username": "simeon@example.com",
"password": "your-linkedin-password",
"country": "North Macedonia",
"twoFactorSecret": "YOUR_AUTHENTICATOR_SECRET"
}
'import requests
url = "https://optareach.com/api/v1/platforms/{platform}/accounts"
payload = {
"connectionMethod": "credentials_2fa",
"username": "simeon@example.com",
"password": "your-linkedin-password",
"country": "North Macedonia",
"twoFactorSecret": "YOUR_AUTHENTICATOR_SECRET"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
connectionMethod: 'credentials_2fa',
username: 'simeon@example.com',
password: 'your-linkedin-password',
country: 'North Macedonia',
twoFactorSecret: 'YOUR_AUTHENTICATOR_SECRET'
})
};
fetch('https://optareach.com/api/v1/platforms/{platform}/accounts', 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://optareach.com/api/v1/platforms/{platform}/accounts",
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([
'connectionMethod' => 'credentials_2fa',
'username' => 'simeon@example.com',
'password' => 'your-linkedin-password',
'country' => 'North Macedonia',
'twoFactorSecret' => 'YOUR_AUTHENTICATOR_SECRET'
]),
CURLOPT_HTTPHEADER => [
"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://optareach.com/api/v1/platforms/{platform}/accounts"
payload := strings.NewReader("{\n \"connectionMethod\": \"credentials_2fa\",\n \"username\": \"simeon@example.com\",\n \"password\": \"your-linkedin-password\",\n \"country\": \"North Macedonia\",\n \"twoFactorSecret\": \"YOUR_AUTHENTICATOR_SECRET\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://optareach.com/api/v1/platforms/{platform}/accounts")
.header("Content-Type", "application/json")
.body("{\n \"connectionMethod\": \"credentials_2fa\",\n \"username\": \"simeon@example.com\",\n \"password\": \"your-linkedin-password\",\n \"country\": \"North Macedonia\",\n \"twoFactorSecret\": \"YOUR_AUTHENTICATOR_SECRET\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://optareach.com/api/v1/platforms/{platform}/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"connectionMethod\": \"credentials_2fa\",\n \"username\": \"simeon@example.com\",\n \"password\": \"your-linkedin-password\",\n \"country\": \"North Macedonia\",\n \"twoFactorSecret\": \"YOUR_AUTHENTICATOR_SECRET\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c7de2c5-617c-4c1b-9c6f-b6e659b08d92",
"created": true
}
}{
"data": {
"id": "3c7de2c5-617c-4c1b-9c6f-b6e659b08d92",
"owner_id": "7b5740db-28bb-4e2c-89b0-bd4f19a37b10",
"service": "linkedin",
"metadata": {
"username": "simeon@example.com",
"name": "Simeon",
"status": "Healthy",
"tracking_preference": "all_conversations"
}
},
"refreshOn": [
"accounts.create",
"accounts.update",
"accounts.delete"
]
}{
"error": {
"code": "validation_error",
"message": "Payload failed validation.",
"details": {
"field": "body"
}
}
}Path Parameters
Body
application/json
Use connectionMethod for the platform-specific connection flow. The legacy dashboard fields (login_method, two_factor_secret, extension, cookies, and userAgent) remain accepted for backwards compatibility.
Available options:
credentials, credentials_2fa, extension, browser_session, app_password, embedded_signup Available options:
2, legacy Available options:
all_conversations, campaign_only Response
Browser session captured; the account was created or updated and validation was queued.
Show child attributes
Show child attributes