Reconcile claimed GitHub changes
curl --request POST \
--url https://galinum.com/api/v1/github/refs/{refId}/reconcile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"leaseToken": "<string>",
"sourceGeneration": 4503599627370495,
"fromSha": "<string>",
"toSha": "<string>",
"rationale": "<string>",
"ops": [
{
"op": "create",
"shas": [
"<string>"
],
"campaign": {
"name": "<string>",
"message": {
"title": "<string>",
"body": "<string>",
"subject": "<string>",
"previewText": "<string>",
"presentation": "<string>"
},
"variants": [
{
"message": {
"title": "<string>",
"body": "<string>",
"subject": "<string>",
"previewText": "<string>",
"presentation": "<string>"
},
"name": "<string>",
"weight": 50,
"isControl": true
}
],
"audience": {
"kind": "all",
"reason": "<string>"
},
"pages": [
"<string>"
]
}
}
]
}
'import requests
url = "https://galinum.com/api/v1/github/refs/{refId}/reconcile"
payload = {
"leaseToken": "<string>",
"sourceGeneration": 4503599627370495,
"fromSha": "<string>",
"toSha": "<string>",
"rationale": "<string>",
"ops": [
{
"op": "create",
"shas": ["<string>"],
"campaign": {
"name": "<string>",
"message": {
"title": "<string>",
"body": "<string>",
"subject": "<string>",
"previewText": "<string>",
"presentation": "<string>"
},
"variants": [
{
"message": {
"title": "<string>",
"body": "<string>",
"subject": "<string>",
"previewText": "<string>",
"presentation": "<string>"
},
"name": "<string>",
"weight": 50,
"isControl": True
}
],
"audience": {
"kind": "all",
"reason": "<string>"
},
"pages": ["<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({
leaseToken: '<string>',
sourceGeneration: 4503599627370495,
fromSha: '<string>',
toSha: '<string>',
rationale: '<string>',
ops: [
{
op: 'create',
shas: ['<string>'],
campaign: {
name: '<string>',
message: {
title: '<string>',
body: JSON.stringify('<string>'),
subject: '<string>',
previewText: '<string>',
presentation: '<string>'
},
variants: [
{
message: {
title: '<string>',
body: JSON.stringify('<string>'),
subject: '<string>',
previewText: '<string>',
presentation: '<string>'
},
name: '<string>',
weight: 50,
isControl: true
}
],
audience: {kind: 'all', reason: '<string>'},
pages: ['<string>']
}
}
]
})
};
fetch('https://galinum.com/api/v1/github/refs/{refId}/reconcile', 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://galinum.com/api/v1/github/refs/{refId}/reconcile",
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([
'leaseToken' => '<string>',
'sourceGeneration' => 4503599627370495,
'fromSha' => '<string>',
'toSha' => '<string>',
'rationale' => '<string>',
'ops' => [
[
'op' => 'create',
'shas' => [
'<string>'
],
'campaign' => [
'name' => '<string>',
'message' => [
'title' => '<string>',
'body' => '<string>',
'subject' => '<string>',
'previewText' => '<string>',
'presentation' => '<string>'
],
'variants' => [
[
'message' => [
'title' => '<string>',
'body' => '<string>',
'subject' => '<string>',
'previewText' => '<string>',
'presentation' => '<string>'
],
'name' => '<string>',
'weight' => 50,
'isControl' => true
]
],
'audience' => [
'kind' => 'all',
'reason' => '<string>'
],
'pages' => [
'<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://galinum.com/api/v1/github/refs/{refId}/reconcile"
payload := strings.NewReader("{\n \"leaseToken\": \"<string>\",\n \"sourceGeneration\": 4503599627370495,\n \"fromSha\": \"<string>\",\n \"toSha\": \"<string>\",\n \"rationale\": \"<string>\",\n \"ops\": [\n {\n \"op\": \"create\",\n \"shas\": [\n \"<string>\"\n ],\n \"campaign\": {\n \"name\": \"<string>\",\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"presentation\": \"<string>\"\n },\n \"variants\": [\n {\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"presentation\": \"<string>\"\n },\n \"name\": \"<string>\",\n \"weight\": 50,\n \"isControl\": true\n }\n ],\n \"audience\": {\n \"kind\": \"all\",\n \"reason\": \"<string>\"\n },\n \"pages\": [\n \"<string>\"\n ]\n }\n }\n ]\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://galinum.com/api/v1/github/refs/{refId}/reconcile")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"leaseToken\": \"<string>\",\n \"sourceGeneration\": 4503599627370495,\n \"fromSha\": \"<string>\",\n \"toSha\": \"<string>\",\n \"rationale\": \"<string>\",\n \"ops\": [\n {\n \"op\": \"create\",\n \"shas\": [\n \"<string>\"\n ],\n \"campaign\": {\n \"name\": \"<string>\",\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"presentation\": \"<string>\"\n },\n \"variants\": [\n {\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"presentation\": \"<string>\"\n },\n \"name\": \"<string>\",\n \"weight\": 50,\n \"isControl\": true\n }\n ],\n \"audience\": {\n \"kind\": \"all\",\n \"reason\": \"<string>\"\n },\n \"pages\": [\n \"<string>\"\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://galinum.com/api/v1/github/refs/{refId}/reconcile")
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 \"leaseToken\": \"<string>\",\n \"sourceGeneration\": 4503599627370495,\n \"fromSha\": \"<string>\",\n \"toSha\": \"<string>\",\n \"rationale\": \"<string>\",\n \"ops\": [\n {\n \"op\": \"create\",\n \"shas\": [\n \"<string>\"\n ],\n \"campaign\": {\n \"name\": \"<string>\",\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"presentation\": \"<string>\"\n },\n \"variants\": [\n {\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"presentation\": \"<string>\"\n },\n \"name\": \"<string>\",\n \"weight\": 50,\n \"isControl\": true\n }\n ],\n \"audience\": {\n \"kind\": \"all\",\n \"reason\": \"<string>\"\n },\n \"pages\": [\n \"<string>\"\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"campaigns": [
{
"campaignId": "<string>",
"created": true
}
],
"reconciledSha": "<string>",
"replayed": true
}{
"ok": false,
"status": 400,
"error": "<string>",
"retryAfterMs": 1
}{
"error": "Unauthorized"
}{
"ok": false,
"status": 400,
"error": "<string>",
"retryAfterMs": 1
}{
"ok": false,
"status": 400,
"error": "<string>",
"retryAfterMs": 1
}{
"ok": false,
"status": 400,
"error": "<string>",
"retryAfterMs": 1
}{
"error": "Invalid request"
}{
"error": "Too many requests"
}{
"ok": false,
"status": 400,
"error": "<string>",
"retryAfterMs": 1
}GitHub sources
Reconcile claimed GitHub changes
Applies an atomic plan to current unlaunched campaigns. Source generations, leases, content hashes, and coverage are checked on the server. Approval remains unchanged. This operation cannot launch or schedule campaigns. Available in Galinum Cloud.
POST
/
api
/
v1
/
github
/
refs
/
{refId}
/
reconcile
Reconcile claimed GitHub changes
curl --request POST \
--url https://galinum.com/api/v1/github/refs/{refId}/reconcile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"leaseToken": "<string>",
"sourceGeneration": 4503599627370495,
"fromSha": "<string>",
"toSha": "<string>",
"rationale": "<string>",
"ops": [
{
"op": "create",
"shas": [
"<string>"
],
"campaign": {
"name": "<string>",
"message": {
"title": "<string>",
"body": "<string>",
"subject": "<string>",
"previewText": "<string>",
"presentation": "<string>"
},
"variants": [
{
"message": {
"title": "<string>",
"body": "<string>",
"subject": "<string>",
"previewText": "<string>",
"presentation": "<string>"
},
"name": "<string>",
"weight": 50,
"isControl": true
}
],
"audience": {
"kind": "all",
"reason": "<string>"
},
"pages": [
"<string>"
]
}
}
]
}
'import requests
url = "https://galinum.com/api/v1/github/refs/{refId}/reconcile"
payload = {
"leaseToken": "<string>",
"sourceGeneration": 4503599627370495,
"fromSha": "<string>",
"toSha": "<string>",
"rationale": "<string>",
"ops": [
{
"op": "create",
"shas": ["<string>"],
"campaign": {
"name": "<string>",
"message": {
"title": "<string>",
"body": "<string>",
"subject": "<string>",
"previewText": "<string>",
"presentation": "<string>"
},
"variants": [
{
"message": {
"title": "<string>",
"body": "<string>",
"subject": "<string>",
"previewText": "<string>",
"presentation": "<string>"
},
"name": "<string>",
"weight": 50,
"isControl": True
}
],
"audience": {
"kind": "all",
"reason": "<string>"
},
"pages": ["<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({
leaseToken: '<string>',
sourceGeneration: 4503599627370495,
fromSha: '<string>',
toSha: '<string>',
rationale: '<string>',
ops: [
{
op: 'create',
shas: ['<string>'],
campaign: {
name: '<string>',
message: {
title: '<string>',
body: JSON.stringify('<string>'),
subject: '<string>',
previewText: '<string>',
presentation: '<string>'
},
variants: [
{
message: {
title: '<string>',
body: JSON.stringify('<string>'),
subject: '<string>',
previewText: '<string>',
presentation: '<string>'
},
name: '<string>',
weight: 50,
isControl: true
}
],
audience: {kind: 'all', reason: '<string>'},
pages: ['<string>']
}
}
]
})
};
fetch('https://galinum.com/api/v1/github/refs/{refId}/reconcile', 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://galinum.com/api/v1/github/refs/{refId}/reconcile",
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([
'leaseToken' => '<string>',
'sourceGeneration' => 4503599627370495,
'fromSha' => '<string>',
'toSha' => '<string>',
'rationale' => '<string>',
'ops' => [
[
'op' => 'create',
'shas' => [
'<string>'
],
'campaign' => [
'name' => '<string>',
'message' => [
'title' => '<string>',
'body' => '<string>',
'subject' => '<string>',
'previewText' => '<string>',
'presentation' => '<string>'
],
'variants' => [
[
'message' => [
'title' => '<string>',
'body' => '<string>',
'subject' => '<string>',
'previewText' => '<string>',
'presentation' => '<string>'
],
'name' => '<string>',
'weight' => 50,
'isControl' => true
]
],
'audience' => [
'kind' => 'all',
'reason' => '<string>'
],
'pages' => [
'<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://galinum.com/api/v1/github/refs/{refId}/reconcile"
payload := strings.NewReader("{\n \"leaseToken\": \"<string>\",\n \"sourceGeneration\": 4503599627370495,\n \"fromSha\": \"<string>\",\n \"toSha\": \"<string>\",\n \"rationale\": \"<string>\",\n \"ops\": [\n {\n \"op\": \"create\",\n \"shas\": [\n \"<string>\"\n ],\n \"campaign\": {\n \"name\": \"<string>\",\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"presentation\": \"<string>\"\n },\n \"variants\": [\n {\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"presentation\": \"<string>\"\n },\n \"name\": \"<string>\",\n \"weight\": 50,\n \"isControl\": true\n }\n ],\n \"audience\": {\n \"kind\": \"all\",\n \"reason\": \"<string>\"\n },\n \"pages\": [\n \"<string>\"\n ]\n }\n }\n ]\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://galinum.com/api/v1/github/refs/{refId}/reconcile")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"leaseToken\": \"<string>\",\n \"sourceGeneration\": 4503599627370495,\n \"fromSha\": \"<string>\",\n \"toSha\": \"<string>\",\n \"rationale\": \"<string>\",\n \"ops\": [\n {\n \"op\": \"create\",\n \"shas\": [\n \"<string>\"\n ],\n \"campaign\": {\n \"name\": \"<string>\",\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"presentation\": \"<string>\"\n },\n \"variants\": [\n {\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"presentation\": \"<string>\"\n },\n \"name\": \"<string>\",\n \"weight\": 50,\n \"isControl\": true\n }\n ],\n \"audience\": {\n \"kind\": \"all\",\n \"reason\": \"<string>\"\n },\n \"pages\": [\n \"<string>\"\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://galinum.com/api/v1/github/refs/{refId}/reconcile")
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 \"leaseToken\": \"<string>\",\n \"sourceGeneration\": 4503599627370495,\n \"fromSha\": \"<string>\",\n \"toSha\": \"<string>\",\n \"rationale\": \"<string>\",\n \"ops\": [\n {\n \"op\": \"create\",\n \"shas\": [\n \"<string>\"\n ],\n \"campaign\": {\n \"name\": \"<string>\",\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"presentation\": \"<string>\"\n },\n \"variants\": [\n {\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"presentation\": \"<string>\"\n },\n \"name\": \"<string>\",\n \"weight\": 50,\n \"isControl\": true\n }\n ],\n \"audience\": {\n \"kind\": \"all\",\n \"reason\": \"<string>\"\n },\n \"pages\": [\n \"<string>\"\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"campaigns": [
{
"campaignId": "<string>",
"created": true
}
],
"reconciledSha": "<string>",
"replayed": true
}{
"ok": false,
"status": 400,
"error": "<string>",
"retryAfterMs": 1
}{
"error": "Unauthorized"
}{
"ok": false,
"status": 400,
"error": "<string>",
"retryAfterMs": 1
}{
"ok": false,
"status": 400,
"error": "<string>",
"retryAfterMs": 1
}{
"ok": false,
"status": 400,
"error": "<string>",
"retryAfterMs": 1
}{
"error": "Invalid request"
}{
"error": "Too many requests"
}{
"ok": false,
"status": 400,
"error": "<string>",
"retryAfterMs": 1
}Authorizations
secretKeyhostedAgentKey
Your project's secret key (pk_…, without the pub segment). Server-side only — never ship it to a browser. Get it from Settings → Projects in the dashboard.
Path Parameters
Required string length:
1 - 128Body
application/json
Required string length:
1 - 256Required range:
0 <= x <= 9007199254740991Pattern:
^[a-f0-9]{40}$Pattern:
^[a-f0-9]{40}$Required string length:
1 - 4000Required array length:
1 - 50 elements- Option 1
- Option 2
- Option 3
- Option 4
Show child attributes
Show child attributes