Sync History
curl --request POST \
--url https://win.oneshotagent.com/v1/tools/linkedin/sync \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "<string>",
"mode": "<string>",
"max_pages": 123
}
'import requests
url = "https://win.oneshotagent.com/v1/tools/linkedin/sync"
payload = {
"account_id": "<string>",
"mode": "<string>",
"max_pages": 123
}
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({account_id: '<string>', mode: '<string>', max_pages: 123})
};
fetch('https://win.oneshotagent.com/v1/tools/linkedin/sync', 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://win.oneshotagent.com/v1/tools/linkedin/sync",
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_id' => '<string>',
'mode' => '<string>',
'max_pages' => 123
]),
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://win.oneshotagent.com/v1/tools/linkedin/sync"
payload := strings.NewReader("{\n \"account_id\": \"<string>\",\n \"mode\": \"<string>\",\n \"max_pages\": 123\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://win.oneshotagent.com/v1/tools/linkedin/sync")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"<string>\",\n \"mode\": \"<string>\",\n \"max_pages\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/tools/linkedin/sync")
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 \"account_id\": \"<string>\",\n \"mode\": \"<string>\",\n \"max_pages\": 123\n}"
response = http.request(request)
puts response.read_bodyLinkedIn
Sync History
Import a connected account’s LinkedIn message history in bounded, resumable runs.
POST
/
v1
/
tools
/
linkedin
/
sync
Sync History
curl --request POST \
--url https://win.oneshotagent.com/v1/tools/linkedin/sync \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "<string>",
"mode": "<string>",
"max_pages": 123
}
'import requests
url = "https://win.oneshotagent.com/v1/tools/linkedin/sync"
payload = {
"account_id": "<string>",
"mode": "<string>",
"max_pages": 123
}
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({account_id: '<string>', mode: '<string>', max_pages: 123})
};
fetch('https://win.oneshotagent.com/v1/tools/linkedin/sync', 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://win.oneshotagent.com/v1/tools/linkedin/sync",
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_id' => '<string>',
'mode' => '<string>',
'max_pages' => 123
]),
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://win.oneshotagent.com/v1/tools/linkedin/sync"
payload := strings.NewReader("{\n \"account_id\": \"<string>\",\n \"mode\": \"<string>\",\n \"max_pages\": 123\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://win.oneshotagent.com/v1/tools/linkedin/sync")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"<string>\",\n \"mode\": \"<string>\",\n \"max_pages\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/tools/linkedin/sync")
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 \"account_id\": \"<string>\",\n \"mode\": \"<string>\",\n \"max_pages\": 123\n}"
response = http.request(request)
puts response.read_bodyImports a connected account’s message history, one bounded run at a time, and returns a
The job result reports
request_id to poll. Paid: one flat price per run (see Pricing). Requires the read grant.
A run imports messages newest-first, up to max_pages pages of 250, then is paused; the next call with mode: "continue" resumes it. Nothing is imported twice. GET /v1/requests/{request_id} shows live progress.
Request
string
required
Connected LinkedIn account id.
string
default:"continue"
continue resumes the newest paused run, or starts from the newest message. restart discards paused runs and starts from the newest message. history does what continue does and also restarts the history import; use it when coverage.history_sync_status is error.number
default:"10"
Pages of 250 messages this run may fetch, 1–10. The flat price covers up to 10. A 10,000-message inbox is four runs.
Before payment
A rejected sync is never charged. The account must be yours (404 account_not_found), connected (409 reconnect_required), have the read grant (403 grant_denied), and have no run queued or running (409 sync_in_progress with run_id).
Response
{
"request_id": "…", "receipt_id": "rcpt_…", "run_id": "…",
"status": "processing", "tool": "linkedin",
"kind": "initial", "resumed_from_cursor": false, "max_pages": 10,
"coverage": { "…": "…" }, "sync_state": "syncing"
}
outcome ∈ exhausted (reached the end) · bounded (page limit reached, needs_continuation: true) · partial (an error after some imports; continue resumes it), plus pages, requests, messages_seen, messages_inserted, messages_updated, conversations_inserted, earliest_seen_at, latest_seen_at, duration_ms and history_sync_status.
Coverage
GET /v1/tools/linkedin/accounts/{id}/sync (free) returns:
{
"account_id": "…",
"sync_state": "partial",
"coverage": {
"history_sync_status": "running",
"history_sync_completed_at": null,
"enumerated_as_of": "2026-09-15T12:10:00.000Z",
"enumerated_back_to": "2025-02-01T09:12:00.000Z",
"latest_message_at": "2026-09-15T11:58:00.000Z",
"pending_cursor": true,
"message_count": 2500,
"conversation_count": 113,
"last_incremental_at": null,
"complete": false
},
"active_run": null,
"last_run": { "run_id": "…", "kind": "initial", "status": "paused", "has_next_cursor": true, "pages": 10, "…": "…" },
"runs": [ "…" ]
}
history_sync_status:never,requested,running,doneorerror;history_sync_completed_atis when it finished.enumerated_as_of: start time of the latest full run that reached the end.enumerated_back_to: the oldest message stored.pending_cursor: true(has_next_cursoron one run): a paid run is paused; callsyncagain to continue it.
coverage.complete is true only when history_sync_status is done, a full run started after that and reached the end, and no paused run remains. Until then sync_state is partial, or syncing while a run is active.
If your run reached the end while history_sync_status is still requested or running, the rest of the history is imported automatically at no charge. A run paused at its page limit still needs an explicit continue.
Incremental updates
New, edited, deleted and read messages arrive automatically; conversation details refresh nightly. Never charged; never continues a paused paid run.When you are charged
| Situation | Charged? |
|---|---|
| Run completes with zero new messages | Yes. Check pending_cursor / complete first. |
| Rejected before payment | No. |
Could not be started (502 enqueue_failed) | No. |
| Run fails before importing anything | No; refunded as credit. |
Run imports some messages, then hits an error (partial) | Yes. continue resumes it. |
| Automatic background updates | Never. |
Example
let status = await agent.getLinkedInSync(accountId);
while (!status.coverage.complete) {
const run = await agent.linkedinSync({ accountId, memo: 'initial import' }); // waits for the run
status = await agent.getLinkedInSync(accountId);
if (!run.needs_continuation && status.coverage.history_sync_status !== 'done') break; // history still importing; come back later
}