Recover Transaction
curl --request POST \
--url https://api.example.com/v1/transactions/{operationId}/recoverimport requests
url = "https://api.example.com/v1/transactions/{operationId}/recover"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/transactions/{operationId}/recover', 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.example.com/v1/transactions/{operationId}/recover",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/transactions/{operationId}/recover"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/v1/transactions/{operationId}/recover")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/transactions/{operationId}/recover")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyTransactions
Recover Transaction
POST /v1/transactions/:operationId/recover — Recover a broadcast but unsubmitted transaction
POST
/
v1
/
transactions
/
{operationId}
/
recover
Recover Transaction
curl --request POST \
--url https://api.example.com/v1/transactions/{operationId}/recoverimport requests
url = "https://api.example.com/v1/transactions/{operationId}/recover"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/transactions/{operationId}/recover', 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.example.com/v1/transactions/{operationId}/recover",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/transactions/{operationId}/recover"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/v1/transactions/{operationId}/recover")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/transactions/{operationId}/recover")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyEndpoint:
POST https://api.rebelfi.io/v1/transactions/:operationId/recoversubmit-hash, or if the submit-hash call failed.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
operationId | number | Yes | Operation ID the transaction belongs to |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
txHash | string | Yes | On-chain transaction hash that was broadcast |
transactionId | number | No | Target transaction ID. If omitted, matches the first unsigned transaction. |
Example Request
curl -X POST "https://api.rebelfi.io/v1/transactions/123/recover" \
-H "x-api-key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"txHash": "5UfD...xyz"
}'
const result = await client.transactions.recover(123, {
txHash: '5UfD...xyz'
});
Example Response
{
"success": true,
"transactionId": 456,
"txHash": "5UfD...xyz"
}
Errors
| Code | Description |
|---|---|
OPERATION_NOT_FOUND | Operation ID doesn’t exist |
TRANSACTION_NOT_FOUND | No matching transaction found in the operation |
INVALID_OPERATION_STATUS | Operation is not in a recoverable state |
Recovery is useful when your application crashes after broadcasting but before calling
submit-hash. The transaction is already on-chain — recovery links it back to the operation so RebelFi can track confirmation.