Add or Update a LinkedIn Account (Native)
curl --request POST \
--url https://api.captaindata.co/v3/integrations/linkedin/accounts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-project-id: <api-key>' \
--data '
{
"account": {
"username": "elon@musk.com",
"password": "********",
"user_uid": "(Optional) User UID previously created"
},
"resume_paused_jobs": false,
"shared_account": false,
"retrieve_ip": false
}
'import requests
url = "https://api.captaindata.co/v3/integrations/linkedin/accounts"
payload = {
"account": {
"username": "elon@musk.com",
"password": "********",
"user_uid": "(Optional) User UID previously created"
},
"resume_paused_jobs": False,
"shared_account": False,
"retrieve_ip": False
}
headers = {
"Authorization": "<api-key>",
"x-project-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'x-project-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account: {
username: 'elon@musk.com',
password: '********',
user_uid: '(Optional) User UID previously created'
},
resume_paused_jobs: false,
shared_account: false,
retrieve_ip: false
})
};
fetch('https://api.captaindata.co/v3/integrations/linkedin/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://api.captaindata.co/v3/integrations/linkedin/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([
'account' => [
'username' => 'elon@musk.com',
'password' => '********',
'user_uid' => '(Optional) User UID previously created'
],
'resume_paused_jobs' => false,
'shared_account' => false,
'retrieve_ip' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"x-project-id: <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://api.captaindata.co/v3/integrations/linkedin/accounts"
payload := strings.NewReader("{\n \"account\": {\n \"username\": \"elon@musk.com\",\n \"password\": \"********\",\n \"user_uid\": \"(Optional) User UID previously created\"\n },\n \"resume_paused_jobs\": false,\n \"shared_account\": false,\n \"retrieve_ip\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("x-project-id", "<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://api.captaindata.co/v3/integrations/linkedin/accounts")
.header("Authorization", "<api-key>")
.header("x-project-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"account\": {\n \"username\": \"elon@musk.com\",\n \"password\": \"********\",\n \"user_uid\": \"(Optional) User UID previously created\"\n },\n \"resume_paused_jobs\": false,\n \"shared_account\": false,\n \"retrieve_ip\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.captaindata.co/v3/integrations/linkedin/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["x-project-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account\": {\n \"username\": \"elon@musk.com\",\n \"password\": \"********\",\n \"user_uid\": \"(Optional) User UID previously created\"\n },\n \"resume_paused_jobs\": false,\n \"shared_account\": false,\n \"retrieve_ip\": false\n}"
response = http.request(request)
puts response.read_body{
"message": "Application configured.",
"checkpoint": {
"type": "PHONE_REGISTER; can be 2FA, OTP, EMAIL, IN_APP_VALIDATION, CAPTCHA or PHONE_REGISTER"
},
"account": {
"uid": "xxxxxxx-xxxx-4104-ab33-3bb4d488a795",
"user_uid": "xxxxxxx-xxxx-4c68-81ec-b3479fe5385b",
"setup_at": "2025-03-05T08:26:16.177847",
"via_extension": false,
"is_shared": false,
"level": null,
"is_valid": null,
"integration_permalink": "linkedin"
}
}LinkedIn
Add or Update a LinkedIn Account (Native)
POST
/
v3
/
integrations
/
linkedin
/
accounts
Add or Update a LinkedIn Account (Native)
curl --request POST \
--url https://api.captaindata.co/v3/integrations/linkedin/accounts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-project-id: <api-key>' \
--data '
{
"account": {
"username": "elon@musk.com",
"password": "********",
"user_uid": "(Optional) User UID previously created"
},
"resume_paused_jobs": false,
"shared_account": false,
"retrieve_ip": false
}
'import requests
url = "https://api.captaindata.co/v3/integrations/linkedin/accounts"
payload = {
"account": {
"username": "elon@musk.com",
"password": "********",
"user_uid": "(Optional) User UID previously created"
},
"resume_paused_jobs": False,
"shared_account": False,
"retrieve_ip": False
}
headers = {
"Authorization": "<api-key>",
"x-project-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'x-project-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account: {
username: 'elon@musk.com',
password: '********',
user_uid: '(Optional) User UID previously created'
},
resume_paused_jobs: false,
shared_account: false,
retrieve_ip: false
})
};
fetch('https://api.captaindata.co/v3/integrations/linkedin/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://api.captaindata.co/v3/integrations/linkedin/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([
'account' => [
'username' => 'elon@musk.com',
'password' => '********',
'user_uid' => '(Optional) User UID previously created'
],
'resume_paused_jobs' => false,
'shared_account' => false,
'retrieve_ip' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"x-project-id: <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://api.captaindata.co/v3/integrations/linkedin/accounts"
payload := strings.NewReader("{\n \"account\": {\n \"username\": \"elon@musk.com\",\n \"password\": \"********\",\n \"user_uid\": \"(Optional) User UID previously created\"\n },\n \"resume_paused_jobs\": false,\n \"shared_account\": false,\n \"retrieve_ip\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("x-project-id", "<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://api.captaindata.co/v3/integrations/linkedin/accounts")
.header("Authorization", "<api-key>")
.header("x-project-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"account\": {\n \"username\": \"elon@musk.com\",\n \"password\": \"********\",\n \"user_uid\": \"(Optional) User UID previously created\"\n },\n \"resume_paused_jobs\": false,\n \"shared_account\": false,\n \"retrieve_ip\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.captaindata.co/v3/integrations/linkedin/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["x-project-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account\": {\n \"username\": \"elon@musk.com\",\n \"password\": \"********\",\n \"user_uid\": \"(Optional) User UID previously created\"\n },\n \"resume_paused_jobs\": false,\n \"shared_account\": false,\n \"retrieve_ip\": false\n}"
response = http.request(request)
puts response.read_body{
"message": "Application configured.",
"checkpoint": {
"type": "PHONE_REGISTER; can be 2FA, OTP, EMAIL, IN_APP_VALIDATION, CAPTCHA or PHONE_REGISTER"
},
"account": {
"uid": "xxxxxxx-xxxx-4104-ab33-3bb4d488a795",
"user_uid": "xxxxxxx-xxxx-4c68-81ec-b3479fe5385b",
"setup_at": "2025-03-05T08:26:16.177847",
"via_extension": false,
"is_shared": false,
"level": null,
"is_valid": null,
"integration_permalink": "linkedin"
}
}The best practice is to first Create a User and then include the
The provided code example demonstrates how to create an
user_uid in the account payload:
// ...
"account": {
// ... rest of the payload
"user_uid": "User UID previously created",
}
// ...
account. To update
an existing account, include the account’s uid within the account payload:
// ...
"account": {
"uid": "Add the Account's UID to update the account",
"username": "elon@musk.com",
"password": "********"
}
// ...
LinkedIn will most likely require you to complete a checkpoint. You can handle
this using the Solve LinkedIn
Checkpoint endpoint. Please note that
CAPTCHA solving may take a long time and could fail.
Authorizations
The Authorization header must include 'x-api-key' followed by your API key (e.g., 'Authorization: x-api-key YOUR_API_KEY').
Workspace UID required to identify the workspace.
Body
application/json
The account JSON object to create or update.
Example:
{
"username": "elon@musk.com",
"password": "********",
"user_uid": "(Optional) User UID previously created"
}
Set this to true to resume all paused jobs if you update, for example, an account's cookie.
Example:
false
Set this to true to share this account to an external user.
Example:
false
Set this to true to retrieve the IP we attribute to the user/account.
Example:
false
Response
200 - application/json
Successful Response
⌘I