Update a callback's status
curl --request PATCH \
--url https://api.upliftai.org/v1/campaigns/callbacks/{callbackId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "done"
}
'import requests
url = "https://api.upliftai.org/v1/campaigns/callbacks/{callbackId}"
payload = { "status": "done" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'done'})
};
fetch('https://api.upliftai.org/v1/campaigns/callbacks/{callbackId}', 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.upliftai.org/v1/campaigns/callbacks/{callbackId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'done'
]),
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://api.upliftai.org/v1/campaigns/callbacks/{callbackId}"
payload := strings.NewReader("{\n \"status\": \"done\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.upliftai.org/v1/campaigns/callbacks/{callbackId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"done\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/campaigns/callbacks/{callbackId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"done\"\n}"
response = http.request(request)
puts response.read_body{
"callbackId": "9f4c2a1e-xxxx-xxxx-xxxx-xxxxxxxxxxxx#+923001234567#a1#cb",
"status": "done"
}{
"message": [
"status must be one of the following values: open, done"
],
"error": "Bad Request",
"statusCode": 400
}{
"message": "invalid authorization",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Forbidden resource",
"error": "Forbidden",
"statusCode": 403
}{
"message": "Callback not found: 9f4c2a1e-xxxx-xxxx-xxxx-xxxxxxxxxxxx#+923001234567#a1#cb",
"error": "Not Found",
"statusCode": 404
}Campaign outcomes
Update a callback's status
Flip a callback between open and done as your team works through them. Only the status changes, and either direction is idempotent. Ids come from the campaign’s callbacks list and contain # and +, so percent-encode the path value — an under-encoded id returns not found.
PATCH
/
campaigns
/
callbacks
/
{callbackId}
Update a callback's status
curl --request PATCH \
--url https://api.upliftai.org/v1/campaigns/callbacks/{callbackId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "done"
}
'import requests
url = "https://api.upliftai.org/v1/campaigns/callbacks/{callbackId}"
payload = { "status": "done" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'done'})
};
fetch('https://api.upliftai.org/v1/campaigns/callbacks/{callbackId}', 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.upliftai.org/v1/campaigns/callbacks/{callbackId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'done'
]),
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://api.upliftai.org/v1/campaigns/callbacks/{callbackId}"
payload := strings.NewReader("{\n \"status\": \"done\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.upliftai.org/v1/campaigns/callbacks/{callbackId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"done\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/campaigns/callbacks/{callbackId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"done\"\n}"
response = http.request(request)
puts response.read_body{
"callbackId": "9f4c2a1e-xxxx-xxxx-xxxx-xxxxxxxxxxxx#+923001234567#a1#cb",
"status": "done"
}{
"message": [
"status must be one of the following values: open, done"
],
"error": "Bad Request",
"statusCode": 400
}{
"message": "invalid authorization",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Forbidden resource",
"error": "Forbidden",
"statusCode": 403
}{
"message": "Callback not found: 9f4c2a1e-xxxx-xxxx-xxxx-xxxxxxxxxxxx#+923001234567#a1#cb",
"error": "Not Found",
"statusCode": 404
}Authorizations
Project API key (sk_api_…).
Path Parameters
Comes from the campaign's callbacks list. Ids embed # and the contact's +92… number, so the path must be percent-encoded: /campaigns/callbacks/9f4c2a1e-…%23%2B923001234567%23a1%23cb. Unique within the API key's project.
Body
application/json
done marks the request handled; open reopens it. Either direction is idempotent.
Available options:
open, done 