Get a rental
GET /v1/rentals/{id}: the status and on-chain record of one rental.
Use this endpoint to poll a queued rental every 2 to 5 seconds until the status is active, and afterwards to read the on-chain record of the delegation and the reclaim.
At a glance
Method and path
GET /v1/rentals/{id}
Authentication
Signed request. See Authentication and signing
Retry-safe
Yes. The request only reads data
Rate limit
Per API key. See Conventions and limits
Path parameters
Sample request
Sample IDs, addresses and hashes are illustrative.
TIMESTAMP=$(date +%s)
RENTAL_ID="rnt_01J9X5..."
REQUEST_PATH="/v1/rentals/$RENTAL_ID"
BODY=""
SIGNATURE=$(printf '%s\n%s\n%s\n%s' "GET" "$REQUEST_PATH" "$TIMESTAMP" "$BODY" | openssl dgst -sha256 -hmac "$API_SECRET" | sed 's/^.* //')
curl -X GET "$BASE_URL$REQUEST_PATH" \
-H "X-API-Key: $API_KEY" \
-H "X-Timestamp: $TIMESTAMP" \
-H "X-Signature: $SIGNATURE"Replace RENTAL_ID with the rental_id from Create a rental. The request is signed inline and needs BASE_URL, API_KEY and API_SECRET in your environment.
import { signedRequest } from "./tron_energy.mjs";
const rentalId = "rnt_01J9X5...";
const { status, data } = await signedRequest("GET", `/v1/rentals/${rentalId}`);
console.log(status, data);signedRequest is the helper from Authentication and signing, saved as tron_energy.mjs.
from tron_energy import signed_request
rental_id = "rnt_01J9X5..."
status, data = signed_request("GET", f"/v1/rentals/{rental_id}")
print(status, data)signed_request is the helper from Authentication and signing, saved as tron_energy.py.
Responses
A rental ID belonging to another client returns 404.
Response fields
rental_id
string
Rental ID
energy_delegated
integer
Energy delegated for this rental
energy_used
integer or null
Energy the transaction consumed. Final once reclaimed
delegate_tx
string
Hash of the delegation transaction
reclaim_tx
string
Hash of the reclaim transaction
queued_at
string
Time the rental joined the queue. Present only on queued rentals
starts_at
string
Start of the 10-second window
expires_at
string
End of the 10-second window
reclaimed_at
string
Time the energy was reclaimed
failure_reason
string or null
Reason for a failed rental. null otherwise
While a rental is pending, each poll also returns pending_reason and a fresh estimated_wait_seconds. Both are described under Create a rental.
Errors
The full list is in Errors.
401
UNAUTHORIZED
Invalid API key, signature or timestamp
Check your credentials and server clock
After a fix
404
NOT_FOUND
Unknown rental ID, or a rental ID that belongs to another client
Check the ID
No
429
RATE_LIMITED
Too many requests
Retry after Retry-After
Yes, after Retry-After
503
SERVICE_UNAVAILABLE
Planned maintenance or an outage
Retry after Retry-After
Yes, after Retry-After
Last updated