Retry the failed accounts of a background run
Runs the failed and cancelled accounts of the batch’s latest background revert (or undo) again, in the background, with the same restore point and reason. Accounts that already succeeded are not touched again. Each account gets a fresh set of retries. The batch stays one ledger entry, so it can still be undone as a whole.
The call answers 202. Follow it like any background run: GET /revert-batches/{batchId} (status, job) and GET /revert-batches/{batchId}/items.
A retried revert works exactly like reverting those accounts now. For an instant restore (revertTo), any activity a trader had after that instant is voided too, including trades placed since the first run.
| Code | Status | Meaning |
|---|---|---|
BATCH_NOT_FOUND | 404 | Unknown batch id (or it belongs to a different organization) |
NO_JOB | 404 | The batch ran within its request; it has no background run to retry |
NOTHING_TO_RETRY | 409 | No failed or cancelled accounts |
BATCH_RUNNING / BATCH_UNDOING | 409 | A background run of this batch is still in progress |
ALREADY_UNDONE | 409 | The batch (or part of it) has been undone; start a new revert instead |
Example:
curl -X POST "https://api.hyperprop.com/platform/v1/organization/revert-batches/a1b2c3d4-e5f6-7890-abcd-ef1234567890/retry-failed" \
-H "X-API-Key: hp_live_your_key_here"
curl --request POST \
--url https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/retry-failed \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{}'import requests
url = "https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/retry-failed"
payload = {}
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({})
};
fetch('https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/retry-failed', 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}/retry-failed",
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([
]),
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}/retry-failed"
payload := strings.NewReader("{}")
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}/retry-failed")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/retry-failed")
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 = "{}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Retrying 12 accounts in the background — follow progress with GET /revert-batches/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"data": {
"batchId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"jobId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"kind": "revert",
"status": "running",
"requeued": 12
}
}{
"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": "NO_JOB",
"message": "This batch has no background run to retry"
}{
"success": false,
"code": "NOTHING_TO_RETRY",
"message": "No failed or cancelled accounts to retry"
}{
"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
The body is of type object.
Response
Retry started in the background
true
"Retrying 12 accounts in the background — follow progress with GET /revert-batches/a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Show child attributes
Show child attributes
{
"batchId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"jobId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"kind": "revert",
"status": "running",
"requeued": 12
}
curl --request POST \
--url https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/retry-failed \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{}'import requests
url = "https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/retry-failed"
payload = {}
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({})
};
fetch('https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/retry-failed', 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}/retry-failed",
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([
]),
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}/retry-failed"
payload := strings.NewReader("{}")
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}/retry-failed")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/platform/v1/organization/revert-batches/{batchId}/retry-failed")
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 = "{}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Retrying 12 accounts in the background — follow progress with GET /revert-batches/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"data": {
"batchId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"jobId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"kind": "revert",
"status": "running",
"requeued": 12
}
}{
"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": "NO_JOB",
"message": "This batch has no background run to retry"
}{
"success": false,
"code": "NOTHING_TO_RETRY",
"message": "No failed or cancelled accounts to retry"
}{
"success": false,
"statusCode": 500,
"error": "Internal Server Error",
"message": "An unexpected error occurred",
"code": "INTERNAL_ERROR"
}