Time Machine
Cancel a background run
Stops a background revert (or undo) of this batch. The accounts it is working on right now finish; every account it had not reached is left untouched and reported as cancelled in GET /revert-batches/{batchId}/items.
- A run that had not started yet stops at once:
status: "cancelled", nothing was changed. - A running one answers
status: "cancelling"and stops within a few seconds. PollGET /revert-batches/{batchId}untiljob.statusiscancelled. The batch then readsinterrupted(an undo returns the batch to its previousstatus).
Accounts already reverted stay reverted and can be undone with the batch. To revert the remaining accounts later, use POST /revert-batches/{batchId}/retry-failed.
| Code | Status | Meaning |
|---|---|---|
BATCH_NOT_FOUND | 404 | Unknown batch id (or it belongs to a different organization) |
NO_ACTIVE_JOB | 409 | Nothing is running for this batch |
Example:
curl -X POST "https://api.hyperprop.com/platform/v1/organization/revert-batches/a1b2c3d4-e5f6-7890-abcd-ef1234567890/cancel" \
-H "X-API-Key: hp_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "reason": "Wrong audience window" }'
POST
/
v1
/
organization
/
revert-batches
/
{batchId}
/
cancel
Cancel a background run
curl --request POST \
--url https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel"
payload = { "reason": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel', 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.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel",
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([
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Cancelling — accounts in progress finish, the rest are left as they are",
"data": {
"batchId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"jobId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"status": "cancelling"
}
}{
"success": false,
"statusCode": 401,
"error": "Unauthorized",
"message": "Authentication required",
"code": "UNAUTHORIZED"
}{
"success": false,
"statusCode": 403,
"error": "Forbidden",
"message": "Access denied",
"code": "FORBIDDEN"
}{
"success": false,
"code": "BATCH_NOT_FOUND",
"message": "Revert batch not found"
}{
"success": false,
"code": "NO_ACTIVE_JOB",
"message": "Nothing is running for this batch"
}{
"success": false,
"statusCode": 500,
"error": "Internal Server Error",
"message": "An unexpected error occurred",
"code": "INTERNAL_ERROR"
}Authorizations
Organization API key. Format: "hp_live_{key}". Organization admins manage the key in the dashboard.
Path Parameters
Batch id returned by the revert call
Body
application/json
Why the run was stopped (for your own records)
Maximum string length:
500Response
Cancelled, or cancelling
⌘I
Cancel a background run
curl --request POST \
--url https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel"
payload = { "reason": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel', 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.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel",
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([
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Cancelling — accounts in progress finish, the rest are left as they are",
"data": {
"batchId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"jobId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"status": "cancelling"
}
}{
"success": false,
"statusCode": 401,
"error": "Unauthorized",
"message": "Authentication required",
"code": "UNAUTHORIZED"
}{
"success": false,
"statusCode": 403,
"error": "Forbidden",
"message": "Access denied",
"code": "FORBIDDEN"
}{
"success": false,
"code": "BATCH_NOT_FOUND",
"message": "Revert batch not found"
}{
"success": false,
"code": "NO_ACTIVE_JOB",
"message": "Nothing is running for this batch"
}{
"success": false,
"statusCode": 500,
"error": "Internal Server Error",
"message": "An unexpected error occurred",
"code": "INTERNAL_ERROR"
}