Skip to main content
POST
/
api
/
v2
/
order
/
replace
/
{order_id}
Replace Proxy
curl --request POST \
  --url https://dashboard.statproxies.com/api/v2/order/replace/{order_id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "ip": "<string>"
}
'
import requests

url = "https://dashboard.statproxies.com/api/v2/order/replace/{order_id}"

payload = { "ip": "<string>" }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ip: '<string>'})
};

fetch('https://dashboard.statproxies.com/api/v2/order/replace/{order_id}', 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://dashboard.statproxies.com/api/v2/order/replace/{order_id}",
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([
'ip' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$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://dashboard.statproxies.com/api/v2/order/replace/{order_id}"

payload := strings.NewReader("{\n \"ip\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

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://dashboard.statproxies.com/api/v2/order/replace/{order_id}")
.header("Content-Type", "application/json")
.body("{\n \"ip\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://dashboard.statproxies.com/api/v2/order/replace/{order_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ip\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "response": "<string>",
  "message": "<string>",
  "details": {},
  "details.order_id": "<string>",
  "details.old_ip": "<string>",
  "details.new_ip": "<string>",
  "details.new_proxy": "<string>"
}
Replace a single proxy IP on an order with a new, randomly selected available IP. The IP you pass must currently be assigned to the order. All other IPs on the order are untouched, and the proxy username, password, and port stay the same.
This feature requires the proxy_exchange feature to be enabled for your organization. Without it, requests return 403 Forbidden. Contact support if you need access. This endpoint only works on active datacenter orders (orders scheduled to cancel keep replace rights until they expire).
Rate limits. These calls trigger configuration reloads on the proxy servers, so they are limited two ways:
  • Per order: one replace per 60 seconds (a 429 response includes retry_after_seconds).
  • Per API key: at most 10 exchange/replace calls per minute combined, on top of the general 60 req/min limit.

Request

Headers

HeaderValueRequired
AuthorizationBearer {your_api_key}Yes
Content-Typeapplication/jsonYes

Path Parameters

order_id
string
required
The order ID returned from order creation.

Body Parameters

ip
string
required
The IPv4 address to replace. Must currently belong to this order.

Example Request

curl -X POST "https://dashboard.statproxies.com/api/v2/order/replace/sub_1rqjp3jb4g9i6pkhdwmkpjob" \
  -H "Authorization: Bearer {your_api_key}" \
  -H "Content-Type: application/json" \
  -d '{"ip": "31.193.191.6"}'

Response

Success Response

{
  "response": "success",
  "message": "Proxy replaced successfully",
  "details": {
    "order_id": "sub_1rqjp3jb4g9i6pkhdwmkpjob",
    "old_ip": "31.193.191.6",
    "new_ip": "31.193.191.42",
    "new_proxy": "31.193.191.42:3128:sub_1rqjp3jb4g9i6pkhdwmkpjob:stat261"
  }
}

Response Fields

response
string
Status of the request.
message
string
Human-readable result message.
details
object
Replace operation details.
details.order_id
string
The order ID that was processed.
details.old_ip
string
The IP that was removed from the order.
details.new_ip
string
The newly assigned IP.
details.new_proxy
string
The full proxy string for the new IP in ip:port:username:password format.

Error Responses

400 Bad Request - Missing Field

{
  "response": "error",
  "message": "Missing required field: ip"
}

400 Bad Request - Invalid IP Format

{
  "response": "error",
  "message": "Invalid IP format"
}

400 Bad Request - IP Not On Order

{
  "response": "error",
  "message": "The specified IP is not assigned to this order"
}

400 Bad Request - Order Not Active

{
  "response": "error",
  "message": "Can only replace proxies for active or cancelled (not yet expired) orders"
}
Same rule as exchange: scheduled-to-cancel orders keep replace rights until expiry.

400 Bad Request - Wrong Product Type

{
  "response": "error",
  "message": "Proxy replacement is only available for datacenter products"
}

403 Forbidden - Feature Not Enabled

{
  "response": "error",
  "message": "Proxy exchange feature is not enabled for your organization."
}

404 Not Found

{
  "response": "error",
  "message": "Order not found or you don't have permission to access it"
}

429 Too Many Requests - Rate Limited

{
  "response": "error",
  "message": "An IP on this order was just replaced. You can replace another in N second(s).",
  "retry_after_seconds": 42
}
One replace per order is allowed every 60 seconds.

500 Internal Server Error

{
  "response": "error",
  "message": "Failed to unassign the old IP"
}
Nothing changed; retry or contact support.
{
  "response": "error",
  "message": "The old IP was removed but a replacement could not be assigned. Please retry or contact support."
}

Notes

  • The proxy username, password, and port are unchanged — only one IP is swapped
  • To replace every IP on the order at once, use Exchange Proxies
  • Use Get Order to look up the current IPs assigned to an order

Exchange Proxies

Replace all IPs on an order at once.

Get Order

Fetch the current proxy list for an order.