curl --request POST \
--url https://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"mode": "validate",
"sourceId": "hardlaunch-rezi-2026-08-01",
"unmatchedPostPolicy": "error",
"rows": [
{
"postId": "7661286873087642894",
"date": "2026-07-11",
"cumulative": {
"views": 374,
"likes": 2,
"comments": 0,
"shares": 0,
"bookmarks": 0
}
}
]
}
'import requests
url = "https://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history"
payload = {
"mode": "validate",
"sourceId": "hardlaunch-rezi-2026-08-01",
"unmatchedPostPolicy": "error",
"rows": [
{
"postId": "7661286873087642894",
"date": "2026-07-11",
"cumulative": {
"views": 374,
"likes": 2,
"comments": 0,
"shares": 0,
"bookmarks": 0
}
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
mode: 'validate',
sourceId: 'hardlaunch-rezi-2026-08-01',
unmatchedPostPolicy: 'error',
rows: [
{
postId: '7661286873087642894',
date: '2026-07-11',
cumulative: {views: 374, likes: 2, comments: 0, shares: 0, bookmarks: 0}
}
]
})
};
fetch('https://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history', 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://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history",
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([
'mode' => 'validate',
'sourceId' => 'hardlaunch-rezi-2026-08-01',
'unmatchedPostPolicy' => 'error',
'rows' => [
[
'postId' => '7661286873087642894',
'date' => '2026-07-11',
'cumulative' => [
'views' => 374,
'likes' => 2,
'comments' => 0,
'shares' => 0,
'bookmarks' => 0
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history"
payload := strings.NewReader("{\n \"mode\": \"validate\",\n \"sourceId\": \"hardlaunch-rezi-2026-08-01\",\n \"unmatchedPostPolicy\": \"error\",\n \"rows\": [\n {\n \"postId\": \"7661286873087642894\",\n \"date\": \"2026-07-11\",\n \"cumulative\": {\n \"views\": 374,\n \"likes\": 2,\n \"comments\": 0,\n \"shares\": 0,\n \"bookmarks\": 0\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"validate\",\n \"sourceId\": \"hardlaunch-rezi-2026-08-01\",\n \"unmatchedPostPolicy\": \"error\",\n \"rows\": [\n {\n \"postId\": \"7661286873087642894\",\n \"date\": \"2026-07-11\",\n \"cumulative\": {\n \"views\": 374,\n \"likes\": 2,\n \"comments\": 0,\n \"shares\": 0,\n \"bookmarks\": 0\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"validate\",\n \"sourceId\": \"hardlaunch-rezi-2026-08-01\",\n \"unmatchedPostPolicy\": \"error\",\n \"rows\": [\n {\n \"postId\": \"7661286873087642894\",\n \"date\": \"2026-07-11\",\n \"cumulative\": {\n \"views\": 374,\n \"likes\": 2,\n \"comments\": 0,\n \"shares\": 0,\n \"bookmarks\": 0\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"ready": true,
"campaign": {
"id": "<string>",
"name": "<string>"
},
"sourceId": "<string>",
"summary": {
"inputRows": 123,
"inputPosts": 123,
"trackedPosts": 123,
"resolvedPosts": 123,
"unmatchedPosts": 123,
"unmatchedRows": 123,
"historyWrites": 123,
"boundaryRewrites": 123,
"alreadyPresentRows": 123,
"blockers": 123,
"warnings": 123
},
"unmatchedPostIds": [
"<string>"
],
"blockers": [
"<string>"
],
"warnings": [
"<string>"
],
"unmatchedPostIdsTruncated": true,
"blockersTruncated": true,
"warningsTruncated": true,
"verification": {
"firestoreWrites": 123,
"postgresWrites": 123
}
}
}{
"error": {
"code": "invalid_request",
"message": "name is required",
"requestId": "req_..."
}
}{
"error": {
"code": "unauthorized",
"message": "Missing bearer access token",
"requestId": "req_..."
}
}{
"error": {
"code": "subscription_required",
"message": "The company does not have an active subscription",
"requestId": "req_..."
}
}{
"error": {
"code": "insufficient_scope",
"message": "Requires scope 'campaigns:write'",
"requestId": "req_..."
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"requestId": "req_..."
}
}{
"error": {
"code": "idempotency_conflict",
"message": "Idempotency-Key was reused with a different request body",
"requestId": "req_..."
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded",
"requestId": "req_..."
}
}Validate or import pre-tracking campaign analytics history
Validate or import cumulative daily observations captured before SideShift began tracking a post. The service resolves postId or postUrl only within the OAuth token’s company and campaign, derives day-over-day deltas, reconciles the first native SideShift snapshot, writes through the posts Firestore/Postgres cone, and reads both stores back before returning success. Large exports must be partitioned by post: each request may carry at most 2,000 rows and 500 unique post identities, and must include the complete imported history for every post it contains. mode=validate performs the full plan without writes; mode=import requires exact campaign-name and, when skipping unmatched posts, exact unmatched-count confirmation. Sandbox grants may validate but may not import. Requires campaigns:write.
curl --request POST \
--url https://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"mode": "validate",
"sourceId": "hardlaunch-rezi-2026-08-01",
"unmatchedPostPolicy": "error",
"rows": [
{
"postId": "7661286873087642894",
"date": "2026-07-11",
"cumulative": {
"views": 374,
"likes": 2,
"comments": 0,
"shares": 0,
"bookmarks": 0
}
}
]
}
'import requests
url = "https://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history"
payload = {
"mode": "validate",
"sourceId": "hardlaunch-rezi-2026-08-01",
"unmatchedPostPolicy": "error",
"rows": [
{
"postId": "7661286873087642894",
"date": "2026-07-11",
"cumulative": {
"views": 374,
"likes": 2,
"comments": 0,
"shares": 0,
"bookmarks": 0
}
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
mode: 'validate',
sourceId: 'hardlaunch-rezi-2026-08-01',
unmatchedPostPolicy: 'error',
rows: [
{
postId: '7661286873087642894',
date: '2026-07-11',
cumulative: {views: 374, likes: 2, comments: 0, shares: 0, bookmarks: 0}
}
]
})
};
fetch('https://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history', 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://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history",
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([
'mode' => 'validate',
'sourceId' => 'hardlaunch-rezi-2026-08-01',
'unmatchedPostPolicy' => 'error',
'rows' => [
[
'postId' => '7661286873087642894',
'date' => '2026-07-11',
'cumulative' => [
'views' => 374,
'likes' => 2,
'comments' => 0,
'shares' => 0,
'bookmarks' => 0
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history"
payload := strings.NewReader("{\n \"mode\": \"validate\",\n \"sourceId\": \"hardlaunch-rezi-2026-08-01\",\n \"unmatchedPostPolicy\": \"error\",\n \"rows\": [\n {\n \"postId\": \"7661286873087642894\",\n \"date\": \"2026-07-11\",\n \"cumulative\": {\n \"views\": 374,\n \"likes\": 2,\n \"comments\": 0,\n \"shares\": 0,\n \"bookmarks\": 0\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"validate\",\n \"sourceId\": \"hardlaunch-rezi-2026-08-01\",\n \"unmatchedPostPolicy\": \"error\",\n \"rows\": [\n {\n \"postId\": \"7661286873087642894\",\n \"date\": \"2026-07-11\",\n \"cumulative\": {\n \"views\": 374,\n \"likes\": 2,\n \"comments\": 0,\n \"shares\": 0,\n \"bookmarks\": 0\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sideshift.app/api/oauth/v1/campaigns/{id}/analytics-history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"validate\",\n \"sourceId\": \"hardlaunch-rezi-2026-08-01\",\n \"unmatchedPostPolicy\": \"error\",\n \"rows\": [\n {\n \"postId\": \"7661286873087642894\",\n \"date\": \"2026-07-11\",\n \"cumulative\": {\n \"views\": 374,\n \"likes\": 2,\n \"comments\": 0,\n \"shares\": 0,\n \"bookmarks\": 0\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"ready": true,
"campaign": {
"id": "<string>",
"name": "<string>"
},
"sourceId": "<string>",
"summary": {
"inputRows": 123,
"inputPosts": 123,
"trackedPosts": 123,
"resolvedPosts": 123,
"unmatchedPosts": 123,
"unmatchedRows": 123,
"historyWrites": 123,
"boundaryRewrites": 123,
"alreadyPresentRows": 123,
"blockers": 123,
"warnings": 123
},
"unmatchedPostIds": [
"<string>"
],
"blockers": [
"<string>"
],
"warnings": [
"<string>"
],
"unmatchedPostIdsTruncated": true,
"blockersTruncated": true,
"warningsTruncated": true,
"verification": {
"firestoreWrites": 123,
"postgresWrites": 123
}
}
}{
"error": {
"code": "invalid_request",
"message": "name is required",
"requestId": "req_..."
}
}{
"error": {
"code": "unauthorized",
"message": "Missing bearer access token",
"requestId": "req_..."
}
}{
"error": {
"code": "subscription_required",
"message": "The company does not have an active subscription",
"requestId": "req_..."
}
}{
"error": {
"code": "insufficient_scope",
"message": "Requires scope 'campaigns:write'",
"requestId": "req_..."
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"requestId": "req_..."
}
}{
"error": {
"code": "idempotency_conflict",
"message": "Idempotency-Key was reused with a different request body",
"requestId": "req_..."
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded",
"requestId": "req_..."
}
}Authorizations
OAuth 2.1 authorization code + PKCE (S256). Tokens are tenant-bound (company_id) and scoped. Discover endpoints via /.well-known/oauth-authorization-server.
Headers
A client-chosen key between 8 and 200 characters. Reuse the same key only when retrying the exact same request body.
8 - 200Path Parameters
Body
1 - 2000 elements- Option 1
- Option 2
Show child attributes
Show child attributes
validate, import Stable caller label recorded with imported snapshots.
1 - 160error, skip Required for import + skip and must exactly match the validated batch.
0 <= x <= 500Required for import and must equal the campaign's current name.
1 - 240Response
Validation plan or verified import result.
Show child attributes
Show child attributes