POST /apiv2/address/rotate
Request a deposit address rotation. The current deposit address will be replaced with a new one. The request is placed in a processing queue and completed automatically within 5 minutes.
Endpoint URL
POST https://netts.io/apiv2/address/rotateRequest Headers
| Header | Required | Description |
|---|---|---|
| Content-Type | Yes | application/json |
| X-API-KEY | Yes | Your API key from Netts dashboard |
| X-Real-IP | Yes | IP address from your whitelist |
Request Body
json
{
"user_id": 1234,
"address_type": "web"
}Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| user_id | integer | No | Authenticated user | Target user ID. Omit to rotate your own address. Parent users can specify their SUB-user's ID |
| address_type | string | No | "web" | Address type to rotate: web or tg |
Authentication & Authorization
This endpoint requires both authentication and authorization:
- Authentication: Valid API key + IP from whitelist (same as other endpoints)
- Authorization:
- Rotate your own address — always allowed
- Rotate your SUB-user's address — allowed for parent users
- Rotate another user's address — rejected with
403 Forbidden
Example Requests
cURL
bash
# Rotate own address
curl -X POST https://netts.io/apiv2/address/rotate \
-H "Content-Type: application/json" \
-H "X-API-KEY: your_api_key" \
-H "X-Real-IP: your_whitelisted_ip" \
-d '{"address_type": "web"}'bash
# Rotate SUB-user's address (parent user only)
curl -X POST https://netts.io/apiv2/address/rotate \
-H "Content-Type: application/json" \
-H "X-API-KEY: your_api_key" \
-H "X-Real-IP: your_whitelisted_ip" \
-d '{"user_id": 1234, "address_type": "web"}'Python
python
import requests
url = "https://netts.io/apiv2/address/rotate"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "your_api_key",
"X-Real-IP": "your_whitelisted_ip"
}
# Rotate own address
response = requests.post(url, headers=headers, json={"address_type": "web"})
data = response.json()
if response.status_code == 200:
print(f"Rotation ID: {data['rotation_id']}")
print(f"Old Address: {data['old_address']}")
print(f"Status: {data['status']}")
print(f"Estimated Completion: {data['estimated_completion']}")
else:
print(f"Error: {data.get('detail', 'Unknown error')}")Node.js
javascript
const axios = require('axios');
async function rotateAddress(apiKey, whitelistedIp, addressType = 'web', userId = null) {
const url = 'https://netts.io/apiv2/address/rotate';
const body = { address_type: addressType };
if (userId) body.user_id = userId;
const response = await axios.post(url, body, {
headers: {
'Content-Type': 'application/json',
'X-API-KEY': apiKey,
'X-Real-IP': whitelistedIp
},
timeout: 30000
});
const data = response.data;
console.log(`Rotation ID: ${data.rotation_id}`);
console.log(`Status: ${data.status}`);
console.log(`Old Address: ${data.old_address}`);
return data;
}
// Rotate own address
rotateAddress('your_api_key', 'your_whitelisted_ip')
.then(result => console.log('Submitted:', result.message))
.catch(err => console.error('Error:', err.response?.data || err.message));PHP
php
<?php
$url = 'https://netts.io/apiv2/address/rotate';
$data = json_encode([
'address_type' => 'web'
]);
$options = [
'http' => [
'header' => implode("\r\n", [
"Content-Type: application/json",
"X-API-KEY: your_api_key",
"X-Real-IP: your_whitelisted_ip"
]),
'method' => 'POST',
'content' => $data,
'timeout' => 30
]
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
$result = json_decode($response, true);
echo "Rotation ID: {$result['rotation_id']}\n";
echo "Old Address: {$result['old_address']}\n";
echo "Status: {$result['status']}\n";
echo "Message: {$result['message']}\n";
?>Response
Success Response (200 OK)
json
{
"rotation_id": 42,
"user_id": 1234,
"address_type": "web",
"old_address": "TCurrentAddress1234567890123456789",
"status": "pending",
"message": "Address rotation request submitted. New address will be assigned within 5 minutes.",
"estimated_completion": "2026-03-14T12:35:00Z"
}Response Fields
| Field | Type | Description |
|---|---|---|
| rotation_id | integer | Unique rotation request ID (use for status checks) |
| user_id | integer | User whose address is being rotated |
| address_type | string | Address type being rotated (web or tg) |
| old_address | string | Current TRON deposit address before rotation |
| status | string | Request status: pending |
| message | string | Human-readable status message |
| estimated_completion | string | Estimated completion time in ISO 8601 format |
Check Rotation Status
GET /apiv2/address/rotate/status/
Check the status of a previously submitted rotation request.
bash
curl https://netts.io/apiv2/address/rotate/status/42 \
-H "X-API-KEY: your_api_key" \
-H "X-Real-IP: your_whitelisted_ip"Response:
json
{
"rotation_id": 42,
"user_id": 1234,
"address_type": "web",
"status": "completed",
"old_address": "TOldAddress1234567890123456789012",
"new_address": "TNewAddress1234567890123456789012",
"created_at": "2026-03-14T12:30:00Z",
"completed_at": "2026-03-14T12:34:15Z"
}Status Values
| Status | Description |
|---|---|
pending | Request submitted, waiting to be processed |
processing | Currently being processed |
completed | New address assigned successfully |
failed | Error occurred during rotation |
Check Pending Rotation
GET /apiv2/address/rotate/pending
Check if a user has a pending rotation request (useful for disabling the rotation button).
bash
curl "https://netts.io/apiv2/address/rotate/pending?address_type=web" \
-H "X-API-KEY: your_api_key" \
-H "X-Real-IP: your_whitelisted_ip"Response:
json
{
"user_id": 1234,
"address_type": "web",
"has_pending": true,
"pending_rotation": {
"rotation_id": 42,
"status": "pending",
"created_at": "2026-03-14T12:30:00Z"
}
}Important Notes
Address Change
After rotation is completed, your current deposit address will no longer accept deposits. Make sure to:
- Withdraw any remaining balance from the current address before requesting rotation
- Update any external systems that reference your old deposit address
- Use the new address for all future deposits
Processing Time
Rotation requests are processed automatically. A new address is typically assigned within 5 minutes of submission.
- Only one pending rotation per user per address type is allowed within a 7-day window
- If you already have a pending rotation, the request will be rejected with
409 Conflict - Both
webandtgaddresses can be rotated independently - Parent users can rotate their SUB-users' addresses by specifying the
user_idparameter
Error Responses
Conflict (409)
json
{
"detail": "User 1234 already has a pending web address rotation request"
}Bad Request (400)
json
{
"detail": "User 1234 has no web deposit address"
}json
{
"detail": "address_type must be 'web' or 'tg'"
}Not Found (404)
json
{
"detail": "User 9999 not found"
}Forbidden (403)
json
{
"detail": "Not authorized to rotate this user's address"
}Authentication Error (401)
json
{
"detail": "X-API-KEY header required"
}Error Code Reference
| HTTP Status | Description |
|---|---|
200 | Rotation request submitted successfully |
400 | Invalid request (no address, invalid type) |
401 | Missing API key header |
403 | Not authorized / Invalid API key or IP |
404 | User not found / Rotation not found |
409 | Pending rotation already exists |
500 | Internal server error |
Related Endpoints
- POST /apiv2/subusergen — Create a new SUB-user
- DELETE /apiv2/subuserdel — Delete a SUB-user
- GET /apiv2/userinfo — Get user information