APIAPIs and integrationsShardX APIResidential Proxies

Residential Proxies

Operations for residential proxies

Purchase additional traffic (Residential)

POSThttps://user-api.shardx.com/user/api/orders/{id}/add-bandwidth
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
idintegerrequired
Header parameters
Idempotency-Keystring· max length: 128· pattern: ^[A-Za-z0-9_.:-]+$optional

Optional. A unique identifier of the logical operation (1-128 characters of [A-Za-z0-9_.:-]), for example a UUID. Send the SAME key when retrying a request whose outcome you do not know (timeout, dropped connection): a request that already completed is NOT executed again, its original response is returned.

Accepted on EVERY mutating endpoint (POST/PUT/PATCH/DELETE) of this API: purchase, renewal, bandwidth top-up, add-ons and any endpoint added later; it is listed explicitly on the money-moving ones.

All endpoints except sub-user operations: the stored response is replayed with the `Idempotency-Replayed: true` header for 7 days. `409`: a request with this key is still running (`idempotency_state: in_progress`) or never completed and its outcome must be verified manually (`idempotency_state: unknown`; it is never re-executed). `422`: the key was already used with a different request. A `429` from the rate limiter does not consume the key, so retry with the same one. Sub-user endpoints (create, data/add, data/subtract): the key is forwarded to the proxy provider, and a retry within 24 hours cannot change the quota twice. 409: the operation is still in progress or the key was used with a different payload.

Without the header, requests run as usual, without these guarantees.

Body
application/json
amountintegerrequired

Amount in GB (1 GB = 1 073 741 824 bytes), up to 100 000

promo_codestring· nullableoptional
Responses
200Successapplication/json
successbooleanrequired
messagestringrequired
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

409A request with this Idempotency-Key is still running (idempotency_state: in_progress), or it never completed and its outcome must be checked manually (idempotency_state: unknown)application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

422The Idempotency-Key was already used with a different requestapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

429More than one request per 3 seconds from the account. The body is plain text (Too many requests, retry in <N>s), and the x-ratelimit-after header has the wait in seconds. The Idempotency-Key is not consumed: retry with the same one.text/plain
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

502The traffic could not be added after payment; order_id and refunded tell whether the payment was returnedapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

POST/user/api/orders/1/add-bandwidth
POST /user/api/orders/1/add-bandwidth HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Content-Type: application/json
Accept: */*

{
  "amount": 1,
  "promo_code": "text"
}
curl -X POST 'https://user-api.shardx.com/user/api/orders/1/add-bandwidth' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Idempotency-Key: text' \
  -H 'Content-Type: application/json' \
  -d '{"amount":1,"promo_code":"text"}'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/orders/1/add-bandwidth"
headers = {
    "Authorization": f"Bearer {token}",
    "Idempotency-Key": "text",
}
payload = {
    "amount": 1,
    "promo_code": "text",
}

response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/orders/1/add-bandwidth";
const payload = {
  "amount": 1,
  "promo_code": "text"
};

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Idempotency-Key": "text",
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/orders/1/add-bandwidth"
	body := bytes.NewBufferString(`{
  "amount": 1,
  "promo_code": "text"
}`)

	req, err := http.NewRequest("POST", url, body)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)
	req.Header.Set("Idempotency-Key", "text")
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .post("https://user-api.shardx.com/user/api/orders/1/add-bandwidth")
        .header("Authorization", format!("Bearer {token}"))
        .header("Idempotency-Key", "text")
        .json(&serde_json::json!({
          "amount": 1,
          "promo_code": "text"
        }))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/orders/1/add-bandwidth");
        request.Headers.Add("Idempotency-Key", "text");
        request.Content = new StringContent("""
            {
              "amount": 1,
              "promo_code": "text"
            }
            """, Encoding.UTF8, "application/json");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
    headers = curl_slist_append(headers, "Idempotency-Key: text");
    headers = curl_slist_append(headers, "Content-Type: application/json");

    const std::string body = R"json({
  "amount": 1,
  "promo_code": "text"
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/orders/1/add-bandwidth");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "message": "Order paid successfully"
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
"Too many requests, retry in 2s"
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Account owner traffic

GEThttps://user-api.shardx.com/user/api/proxies/profile

Returns the parent account's own total and remaining data for the given proxy type, aggregated across the parent's orders. Unlike the sub-user endpoints, this reflects the data of the account owner, not a sub-user.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestringrequired

Proxy type (standart | premium | unlimited)

Responses
200Successapplication/json
successbooleanrequired
dataintegerrequired

Total allocated data in bytes

data_remainintegerrequired

Remaining data in bytes

data_spentintegerrequired

Consumed data in bytes

proxy_passwordstringrequired

Parent account's proxy password

400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

502The proxy provider failed or answered with an error (Upstream error: <status>)application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/proxies/profile?proxy_type=text
GET /user/api/proxies/profile?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/proxies/profile?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/profile"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/profile?proxy_type=text";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/profile?proxy_type=text"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/proxies/profile?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/profile?proxy_type=text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/profile?proxy_type=text");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "data": 1,
  "data_remain": 1,
  "data_spent": 1,
  "proxy_password": "text"
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Account analytics

GEThttps://user-api.shardx.com/user/api/proxies/analytics/{kind}

Traffic statistics of the account itself.

kind:

  • overall: traffic and requests bucketed over the period;
  • domains: traffic and requests per destination hostname over the period;
  • connections: connections open right now (no period).

By default only the account's own traffic is counted. Pass include_sub_users=true to add every sub-user of the account.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
kindstring · enumrequired

overall | domains | connections

Possible values:overalldomainsconnections
Query parameters
proxy_typestringrequired

Proxy type (standart | premium | unlimited)

startstringoptional

Inclusive start of the window (ISO 8601, YYYY-MM-DD HH:MM:SS or Unix timestamp). Ignored for connections.

endstringoptional

Exclusive end of the window; defaults to now. Ignored for connections.

timezonestringoptional

IANA timezone for bucket boundaries, UTC by default

include_sub_usersbooleanoptional

Count the account together with all of its sub-users (false by default)

limitintegeroptional

Page size

offsetintegeroptional

Number of results to skip

Responses
200Successapplication/json

The provider's answer, passed through unchanged. Its shape depends on kind: `overall`: `results` are time buckets `{timestamp, data, requests}`, empty intervals included as zeros; buckets are hourly on a short window and daily on a long one; domains: results are hostnames {hostname, data, requests}, sorted by data descending; there is no count; * connections: results are open connections {user_id, package_id, server_ip, connections} right now; there is no period (timezone, start, end).

countintegeroptional

Total number of results (overall)

nextstring· nullableoptional

Link to the next page

previousstring· nullableoptional

Link to the previous page

timezonestringoptional
startstring · date-timeoptional
endstring · date-timeoptional
resultsobject[]optional
Show propertiesHide properties
timestampstring · date-timeoptional

Start of the bucket (overall)

hostnamestringoptional

Destination host (domains)

datainteger · int64optional

Bytes (overall, domains)

requestsintegeroptional

Requests (overall, domains)

user_idstringoptional

Account or sub-user id (connections)

package_idstringoptional

Package id (connections)

server_ipstringoptional

IP of the gateway that holds the connections (connections)

connectionsintegeroptional

Open connections (connections)

400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

502The proxy provider failed or answered with an error (Upstream error: <status>)application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/proxies/analytics/overall?proxy_type=text
GET /user/api/proxies/analytics/overall?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/proxies/analytics/overall?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/analytics/overall"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/analytics/overall?proxy_type=text";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/analytics/overall?proxy_type=text"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/proxies/analytics/overall?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/analytics/overall?proxy_type=text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/analytics/overall?proxy_type=text");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "count": 1,
  "next": "text",
  "previous": "text",
  "timezone": "text",
  "start": "2026-01-01T00:00:00Z",
  "end": "2026-01-01T00:00:00Z",
  "results": [
    {
      "timestamp": "2026-01-01T00:00:00Z",
      "hostname": "text",
      "data": 1,
      "requests": 1,
      "user_id": "text",
      "package_id": "text",
      "server_ip": "text",
      "connections": 1
    }
  ]
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Sub-user analytics

GEThttps://user-api.shardx.com/user/api/proxies/sub-user/{user_id}/analytics/{kind}

The same statistics for a single sub-user of the account. Access is enforced by the provider: the request is made on behalf of the account, which can only read its own sub-users.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
user_idstringrequired

Sub-user id at the provider

kindstring · enumrequired

overall | domains | connections

Possible values:overalldomainsconnections
Query parameters
proxy_typestringrequired

Proxy type (standart | premium | unlimited)

startstringoptional

Inclusive start of the window (ISO 8601, YYYY-MM-DD HH:MM:SS or Unix timestamp). Ignored for connections.

endstringoptional

Exclusive end of the window; defaults to now. Ignored for connections.

timezonestringoptional

IANA timezone for bucket boundaries, UTC by default

limitintegeroptional

Page size

offsetintegeroptional

Number of results to skip

Responses
200Successapplication/json

The provider's answer, passed through unchanged. Its shape depends on kind: `overall`: `results` are time buckets `{timestamp, data, requests}`, empty intervals included as zeros; buckets are hourly on a short window and daily on a long one; domains: results are hostnames {hostname, data, requests}, sorted by data descending; there is no count; * connections: results are open connections {user_id, package_id, server_ip, connections} right now; there is no period (timezone, start, end).

countintegeroptional

Total number of results (overall)

nextstring· nullableoptional

Link to the next page

previousstring· nullableoptional

Link to the previous page

timezonestringoptional
startstring · date-timeoptional
endstring · date-timeoptional
resultsobject[]optional
Show propertiesHide properties
timestampstring · date-timeoptional

Start of the bucket (overall)

hostnamestringoptional

Destination host (domains)

datainteger · int64optional

Bytes (overall, domains)

requestsintegeroptional

Requests (overall, domains)

user_idstringoptional

Account or sub-user id (connections)

package_idstringoptional

Package id (connections)

server_ipstringoptional

IP of the gateway that holds the connections (connections)

connectionsintegeroptional

Open connections (connections)

400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

502The proxy provider failed or answered with an error (Upstream error: <status>)application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/proxies/sub-user/text/analytics/overall?proxy_type=text
GET /user/api/proxies/sub-user/text/analytics/overall?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall?proxy_type=text";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall?proxy_type=text"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall?proxy_type=text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall?proxy_type=text");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "count": 1,
  "next": "text",
  "previous": "text",
  "timezone": "text",
  "start": "2026-01-01T00:00:00Z",
  "end": "2026-01-01T00:00:00Z",
  "results": [
    {
      "timestamp": "2026-01-01T00:00:00Z",
      "hostname": "text",
      "data": 1,
      "requests": 1,
      "user_id": "text",
      "package_id": "text",
      "server_ip": "text",
      "connections": 1
    }
  ]
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Sub-user list

GEThttps://user-api.shardx.com/user/api/proxies/sub-users
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestringrequired

Proxy type (standart | premium | unlimited)

offsetintegeroptional
limitintegeroptional
searchstringoptional

Provider-side search by sub-user name or login

Responses
200Successapplication/json
successbooleanoptional
countintegeroptional

Total sub-users before pagination

dataobject[]optional
Show propertiesHide properties
user_idstringrequired
first_namestringrequired
proxy_passwordstringrequired
dataintegerrequired
data_spentintegerrequired
data_remainintegerrequired
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

502The proxy provider failed or answered with an error (Upstream error: <status>)application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/proxies/sub-users?proxy_type=text
GET /user/api/proxies/sub-users?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/proxies/sub-users?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/sub-users"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/sub-users?proxy_type=text";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/sub-users?proxy_type=text"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/proxies/sub-users?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/sub-users?proxy_type=text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-users?proxy_type=text");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "count": 1,
  "data": [
    {
      "user_id": "text",
      "first_name": "text",
      "proxy_password": "text",
      "data": 1,
      "data_spent": 1,
      "data_remain": 1
    }
  ]
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Get sub-user by ID

GEThttps://user-api.shardx.com/user/api/proxies/sub-user/{user_id}
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
user_idstringrequired
Query parameters
proxy_typestringrequired

Proxy type (standart | premium | unlimited)

Responses
200Successapplication/json
successbooleanoptional
dataobject[]optional

Empty when the sub-user does not exist

Show propertiesHide properties
user_idstringrequired
first_namestringrequired
proxy_passwordstringrequired
dataintegerrequired
data_spentintegerrequired
data_remainintegerrequired
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

502Provider error (the sub-user may still exist, retry)application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/proxies/sub-user/text?proxy_type=text
GET /user/api/proxies/sub-user/text?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/sub-user/text"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "data": [
    {
      "user_id": "text",
      "first_name": "text",
      "proxy_password": "text",
      "data": 1,
      "data_spent": 1,
      "data_remain": 1
    }
  ]
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Delete sub-user

DELhttps://user-api.shardx.com/user/api/proxies/sub-user/{user_id}
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
user_idstringrequired
Responses
200Successapplication/json
successbooleanrequired
messagestringrequired
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

502The provider did not delete the sub-user (it still exists). Deleting an already deleted sub-user is a success.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

DEL/user/api/proxies/sub-user/text
DELETE /user/api/proxies/sub-user/text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X DELETE 'https://user-api.shardx.com/user/api/proxies/sub-user/text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/sub-user/text"
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.delete(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text";

const response = await fetch(url, {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/sub-user/text"

	req, err := http.NewRequest("DELETE", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .delete("https://user-api.shardx.com/user/api/proxies/sub-user/text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Delete, "https://user-api.shardx.com/user/api/proxies/sub-user/text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "message": "Sub user deleted successfully"
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Edit sub-user (name/package)

PATCHhttps://user-api.shardx.com/user/api/proxies/sub-user/{user_id}
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
user_idstringrequired
Query parameters
proxy_typestringrequired

Proxy type (standart | premium | unlimited)

Body
application/json
namestringrequired
Responses
200Successapplication/json
successbooleanrequired
messagestringrequired
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

PATCH/user/api/proxies/sub-user/text?proxy_type=text
PATCH /user/api/proxies/sub-user/text?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "name": "text"
}
curl -X PATCH 'https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name":"text"}'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/sub-user/text"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}
payload = {
    "name": "text",
}

response = requests.patch(url, params=params, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text";
const payload = {
  "name": "text"
};

const response = await fetch(url, {
  method: "PATCH",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text"
	body := bytes.NewBufferString(`{
  "name": "text"
}`)

	req, err := http.NewRequest("PATCH", url, body)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .patch("https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .json(&serde_json::json!({
          "name": "text"
        }))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Patch, "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text");
        request.Content = new StringContent("""
            {
              "name": "text"
            }
            """, Encoding.UTF8, "application/json");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
    headers = curl_slist_append(headers, "Content-Type: application/json");

    const std::string body = R"json({
  "name": "text"
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "message": "Sub user edited successfully"
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Create sub-user

POSThttps://user-api.shardx.com/user/api/proxies/sub-user

The quota is a virtual cap on top of the account's shared traffic pool: assigning it does not debit the pool; traffic is consumed only when the sub-user actually uses the proxy.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestringrequired

Proxy type (standart | premium | unlimited)

Header parameters
Idempotency-Keystring· max length: 128· pattern: ^[A-Za-z0-9_.:-]+$optional

Optional. A unique identifier of the logical operation (1-128 characters of [A-Za-z0-9_.:-]), for example a UUID. Send the SAME key when retrying a request whose outcome you do not know (timeout, dropped connection): a request that already completed is NOT executed again, its original response is returned.

Accepted on EVERY mutating endpoint (POST/PUT/PATCH/DELETE) of this API: purchase, renewal, bandwidth top-up, add-ons and any endpoint added later; it is listed explicitly on the money-moving ones.

All endpoints except sub-user operations: the stored response is replayed with the `Idempotency-Replayed: true` header for 7 days. `409`: a request with this key is still running (`idempotency_state: in_progress`) or never completed and its outcome must be verified manually (`idempotency_state: unknown`; it is never re-executed). `422`: the key was already used with a different request. A `429` from the rate limiter does not consume the key, so retry with the same one. Sub-user endpoints (create, data/add, data/subtract): the key is forwarded to the proxy provider, and a retry within 24 hours cannot change the quota twice. 409: the operation is still in progress or the key was used with a different payload.

Without the header, requests run as usual, without these guarantees.

Body
application/json
namestringrequired
dataintegeroptional

Amount in GB (1 GB = 1 073 741 824 bytes), up to 100 000

data_bytesinteger · int64optional

Amount in bytes (exact; takes precedence over data), up to 100 000 GB

Responses
200Successapplication/json
successbooleanoptional
dataobject[]optional
Show propertiesHide properties
user_idstringrequired
first_namestringrequired
proxy_passwordstringrequired
dataintegerrequired
data_spentintegerrequired
data_remainintegeroptional
400Validation error, or the provider rejected the request (rejected: true); nothing was createdapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

409A request with this Idempotency-Key is in progress or was used with a different payloadapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

502Provider unreachable: the outcome is UNKNOWN; retry with the same Idempotency-Keyapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

POST/user/api/proxies/sub-user?proxy_type=text
POST /user/api/proxies/sub-user?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Content-Type: application/json
Accept: */*

{
  "name": "text",
  "data": 1,
  "data_bytes": 1
}
curl -X POST 'https://user-api.shardx.com/user/api/proxies/sub-user?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Idempotency-Key: text' \
  -H 'Content-Type: application/json' \
  -d '{"name":"text","data":1,"data_bytes":1}'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/sub-user"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
    "Idempotency-Key": "text",
}
payload = {
    "name": "text",
    "data": 1,
    "data_bytes": 1,
}

response = requests.post(url, params=params, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/sub-user?proxy_type=text";
const payload = {
  "name": "text",
  "data": 1,
  "data_bytes": 1
};

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Idempotency-Key": "text",
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/sub-user?proxy_type=text"
	body := bytes.NewBufferString(`{
  "name": "text",
  "data": 1,
  "data_bytes": 1
}`)

	req, err := http.NewRequest("POST", url, body)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)
	req.Header.Set("Idempotency-Key", "text")
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .post("https://user-api.shardx.com/user/api/proxies/sub-user?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .header("Idempotency-Key", "text")
        .json(&serde_json::json!({
          "name": "text",
          "data": 1,
          "data_bytes": 1
        }))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/proxies/sub-user?proxy_type=text");
        request.Headers.Add("Idempotency-Key", "text");
        request.Content = new StringContent("""
            {
              "name": "text",
              "data": 1,
              "data_bytes": 1
            }
            """, Encoding.UTF8, "application/json");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
    headers = curl_slist_append(headers, "Idempotency-Key: text");
    headers = curl_slist_append(headers, "Content-Type: application/json");

    const std::string body = R"json({
  "name": "text",
  "data": 1,
  "data_bytes": 1
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user?proxy_type=text");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "data": [
    {
      "user_id": "text",
      "first_name": "text",
      "proxy_password": "text",
      "data": 1,
      "data_spent": 1,
      "data_remain": 1
    }
  ]
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Add traffic to sub-user

POSThttps://user-api.shardx.com/user/api/proxies/sub-user/{user_id}/data/add
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
user_idstringrequired
Query parameters
proxy_typestringrequired

Proxy type (standart | premium | unlimited)

Header parameters
Idempotency-Keystring· max length: 128· pattern: ^[A-Za-z0-9_.:-]+$optional

Optional. A unique identifier of the logical operation (1-128 characters of [A-Za-z0-9_.:-]), for example a UUID. Send the SAME key when retrying a request whose outcome you do not know (timeout, dropped connection): a request that already completed is NOT executed again, its original response is returned.

Accepted on EVERY mutating endpoint (POST/PUT/PATCH/DELETE) of this API: purchase, renewal, bandwidth top-up, add-ons and any endpoint added later; it is listed explicitly on the money-moving ones.

All endpoints except sub-user operations: the stored response is replayed with the `Idempotency-Replayed: true` header for 7 days. `409`: a request with this key is still running (`idempotency_state: in_progress`) or never completed and its outcome must be verified manually (`idempotency_state: unknown`; it is never re-executed). `422`: the key was already used with a different request. A `429` from the rate limiter does not consume the key, so retry with the same one. Sub-user endpoints (create, data/add, data/subtract): the key is forwarded to the proxy provider, and a retry within 24 hours cannot change the quota twice. 409: the operation is still in progress or the key was used with a different payload.

Without the header, requests run as usual, without these guarantees.

Body
application/json
dataintegeroptional

Amount in GB (1 GB = 1 073 741 824 bytes), up to 100 000

data_bytesinteger · int64optional

Amount in bytes (exact; takes precedence over data), up to 100 000 GB

Responses
200Successapplication/json
successbooleanrequired
messagestringrequired
orderobject · SubUserOrderState· nullableoptional

Sub-user quota state AFTER the operation (null when the provider returned no order object)

Show propertiesHide properties
proxy_passwordstringoptional
datainteger · int64optional

Total assigned quota in bytes

data_spentinteger · int64optional

Consumed bytes

data_remaininteger · int64optional

Remaining bytes (may be negative on overdraft)

400Validation error, or the provider rejected the operation (rejected: true); the quota did NOT changeapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

409A request with this Idempotency-Key is in progress or was used with a different payloadapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

502Provider unreachable: the outcome is UNKNOWN; retry with the same Idempotency-Keyapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

POST/user/api/proxies/sub-user/text/data/add?proxy_type=text
POST /user/api/proxies/sub-user/text/data/add?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Content-Type: application/json
Accept: */*

{
  "data": 1,
  "data_bytes": 1
}
curl -X POST 'https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Idempotency-Key: text' \
  -H 'Content-Type: application/json' \
  -d '{"data":1,"data_bytes":1}'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
    "Idempotency-Key": "text",
}
payload = {
    "data": 1,
    "data_bytes": 1,
}

response = requests.post(url, params=params, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add?proxy_type=text";
const payload = {
  "data": 1,
  "data_bytes": 1
};

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Idempotency-Key": "text",
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add?proxy_type=text"
	body := bytes.NewBufferString(`{
  "data": 1,
  "data_bytes": 1
}`)

	req, err := http.NewRequest("POST", url, body)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)
	req.Header.Set("Idempotency-Key", "text")
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .post("https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .header("Idempotency-Key", "text")
        .json(&serde_json::json!({
          "data": 1,
          "data_bytes": 1
        }))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add?proxy_type=text");
        request.Headers.Add("Idempotency-Key", "text");
        request.Content = new StringContent("""
            {
              "data": 1,
              "data_bytes": 1
            }
            """, Encoding.UTF8, "application/json");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
    headers = curl_slist_append(headers, "Idempotency-Key: text");
    headers = curl_slist_append(headers, "Content-Type: application/json");

    const std::string body = R"json({
  "data": 1,
  "data_bytes": 1
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add?proxy_type=text");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "message": "Traffic added to sub user successfully",
  "order": {
    "proxy_password": "text",
    "data": 1,
    "data_spent": 1,
    "data_remain": 1
  }
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Subtract traffic from sub-user

POSThttps://user-api.shardx.com/user/api/proxies/sub-user/{user_id}/data/subtract
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
user_idstringrequired
Query parameters
proxy_typestringrequired

Proxy type (standart | premium | unlimited)

Header parameters
Idempotency-Keystring· max length: 128· pattern: ^[A-Za-z0-9_.:-]+$optional

Optional. A unique identifier of the logical operation (1-128 characters of [A-Za-z0-9_.:-]), for example a UUID. Send the SAME key when retrying a request whose outcome you do not know (timeout, dropped connection): a request that already completed is NOT executed again, its original response is returned.

Accepted on EVERY mutating endpoint (POST/PUT/PATCH/DELETE) of this API: purchase, renewal, bandwidth top-up, add-ons and any endpoint added later; it is listed explicitly on the money-moving ones.

All endpoints except sub-user operations: the stored response is replayed with the `Idempotency-Replayed: true` header for 7 days. `409`: a request with this key is still running (`idempotency_state: in_progress`) or never completed and its outcome must be verified manually (`idempotency_state: unknown`; it is never re-executed). `422`: the key was already used with a different request. A `429` from the rate limiter does not consume the key, so retry with the same one. Sub-user endpoints (create, data/add, data/subtract): the key is forwarded to the proxy provider, and a retry within 24 hours cannot change the quota twice. 409: the operation is still in progress or the key was used with a different payload.

Without the header, requests run as usual, without these guarantees.

Body
application/json
dataintegeroptional

Amount in GB (1 GB = 1 073 741 824 bytes), up to 100 000

data_bytesinteger · int64optional

Amount in bytes (exact; takes precedence over data), up to 100 000 GB

Responses
200Successapplication/json
successbooleanrequired
messagestringrequired
orderobject · SubUserOrderState· nullableoptional

Sub-user quota state AFTER the operation (null when the provider returned no order object)

Show propertiesHide properties
proxy_passwordstringoptional
datainteger · int64optional

Total assigned quota in bytes

data_spentinteger · int64optional

Consumed bytes

data_remaininteger · int64optional

Remaining bytes (may be negative on overdraft)

400Validation error, or the provider rejected the operation (rejected: true); the quota did NOT changeapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

409A request with this Idempotency-Key is in progress or was used with a different payloadapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

502Provider unreachable: the outcome is UNKNOWN; retry with the same Idempotency-Keyapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

POST/user/api/proxies/sub-user/text/data/subtract?proxy_type=text
POST /user/api/proxies/sub-user/text/data/subtract?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Content-Type: application/json
Accept: */*

{
  "data": 1,
  "data_bytes": 1
}
curl -X POST 'https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Idempotency-Key: text' \
  -H 'Content-Type: application/json' \
  -d '{"data":1,"data_bytes":1}'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
    "Idempotency-Key": "text",
}
payload = {
    "data": 1,
    "data_bytes": 1,
}

response = requests.post(url, params=params, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text";
const payload = {
  "data": 1,
  "data_bytes": 1
};

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Idempotency-Key": "text",
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text"
	body := bytes.NewBufferString(`{
  "data": 1,
  "data_bytes": 1
}`)

	req, err := http.NewRequest("POST", url, body)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)
	req.Header.Set("Idempotency-Key", "text")
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .post("https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .header("Idempotency-Key", "text")
        .json(&serde_json::json!({
          "data": 1,
          "data_bytes": 1
        }))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text");
        request.Headers.Add("Idempotency-Key", "text");
        request.Content = new StringContent("""
            {
              "data": 1,
              "data_bytes": 1
            }
            """, Encoding.UTF8, "application/json");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
    headers = curl_slist_append(headers, "Idempotency-Key: text");
    headers = curl_slist_append(headers, "Content-Type: application/json");

    const std::string body = R"json({
  "data": 1,
  "data_bytes": 1
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "message": "Traffic subtracted from sub user successfully",
  "order": {
    "proxy_password": "text",
    "data": 1,
    "data_spent": 1,
    "data_remain": 1
  }
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Change sub-user password

POSThttps://user-api.shardx.com/user/api/proxies/sub-user/{user_id}/password
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
user_idstringrequired
Query parameters
proxy_typestringrequired

Proxy type (standart | premium | unlimited)

Responses
200Successapplication/json
successbooleanrequired
messagestringrequired
proxy_passwordstring· nullableoptional

The new proxy password

400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

502The provider did not rotate the password (the old one is still valid)application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

POST/user/api/proxies/sub-user/text/password?proxy_type=text
POST /user/api/proxies/sub-user/text/password?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X POST 'https://user-api.shardx.com/user/api/proxies/sub-user/text/password?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/password"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.post(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/password?proxy_type=text";

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/sub-user/text/password?proxy_type=text"

	req, err := http.NewRequest("POST", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .post("https://user-api.shardx.com/user/api/proxies/sub-user/text/password?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/proxies/sub-user/text/password?proxy_type=text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text/password?proxy_type=text");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "message": "Sub user password changed successfully",
  "proxy_password": "text"
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Country list

GEThttps://user-api.shardx.com/user/api/proxies/countries
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestringrequired

Proxy type (standart | premium | unlimited)

Responses
200Successapplication/json
countintegerrequired
resultsobject · Country[]required
Show propertiesHide properties
codestring· max length: 10required

ISO country code

namestring· max length: 255required

Country name

400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/proxies/countries?proxy_type=text
GET /user/api/proxies/countries?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/proxies/countries?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/countries"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/countries?proxy_type=text";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/countries?proxy_type=text"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/proxies/countries?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/countries?proxy_type=text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/countries?proxy_type=text");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "count": 1,
  "results": [
    {
      "code": "text",
      "name": "text"
    }
  ]
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Region list

GEThttps://user-api.shardx.com/user/api/proxies/regions
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestringrequired

Proxy type (standart | premium | unlimited)

country_codestringrequired

ISO country code

Responses
200Successapplication/json
countintegerrequired
resultsobject · Region[]required
Show propertiesHide properties
codestring· max length: 10required

Region or state code

namestring· max length: 255required

Region or state name

countryobject · Countryrequired
Show propertiesHide properties
codestring· max length: 10required

ISO country code

namestring· max length: 255required

Country name

400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/proxies/regions?proxy_type=text&country_code=text
GET /user/api/proxies/regions?proxy_type=text&country_code=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/proxies/regions?proxy_type=text&country_code=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/regions"
params = {
    "proxy_type": "text",
    "country_code": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/regions?proxy_type=text&country_code=text";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/regions?proxy_type=text&country_code=text"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/proxies/regions?proxy_type=text&country_code=text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/regions?proxy_type=text&country_code=text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/regions?proxy_type=text&country_code=text");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "count": 1,
  "results": [
    {
      "code": "text",
      "name": "text",
      "country": {
        "code": "text",
        "name": "text"
      }
    }
  ]
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

City list

GEThttps://user-api.shardx.com/user/api/proxies/cities
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestringrequired

Proxy type (standart | premium | unlimited)

country_codestringrequired

ISO country code

region_codestringrequired

Region or state code

Responses
200Successapplication/json
countintegerrequired
resultsobject · City[]required
Show propertiesHide properties
codestring· max length: 50required

City code, usually a slug

namestring· max length: 255required

City name

countryobject · Countryrequired
Show propertiesHide properties
codestring· max length: 10required

ISO country code

namestring· max length: 255required

Country name

regionobject· nullableoptional
Show propertiesHide properties
codestring· max length: 10required

Region code

namestring· max length: 255required

Region name

400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/proxies/cities?proxy_type=text&country_code=text&region_code=text
GET /user/api/proxies/cities?proxy_type=text&country_code=text&region_code=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/proxies/cities?proxy_type=text&country_code=text&region_code=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/cities"
params = {
    "proxy_type": "text",
    "country_code": "text",
    "region_code": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/cities?proxy_type=text&country_code=text&region_code=text";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/cities?proxy_type=text&country_code=text&region_code=text"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/proxies/cities?proxy_type=text&country_code=text&region_code=text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/cities?proxy_type=text&country_code=text&region_code=text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/cities?proxy_type=text&country_code=text&region_code=text");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "count": 1,
  "results": [
    {
      "code": "text",
      "name": "text",
      "country": {
        "code": "text",
        "name": "text"
      },
      "region": {
        "code": "text",
        "name": "text"
      }
    }
  ]
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

List ISPs

GEThttps://user-api.shardx.com/user/api/proxies/isps

Internet providers available inside a city; the fourth targeting level after country, region and city. Unlike the other location endpoints this one needs the full chain: country_code, region_code AND city_code are all required, because upstream ISPs are bound to a city. Premium package only: the ISP catalogue is not maintained for the standart and unlimited packages, and any other proxy_type is rejected with 400. ISPs are listed for major cities only, so an empty results with count: 0 is a normal answer for a smaller city.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestring · enumrequired

Must be premium; ISP targeting is premium-only

Possible values:premium
country_codestringrequired

ISO country code

region_codestringrequired

Region or state code

city_codestringrequired

City code from GET /user/api/proxies/cities

Responses
200Successapplication/json
countintegerrequired
resultsobject · Isp[]required
Show propertiesHide properties
codestringrequired

ISP code, usually a slug

namestringrequired

ISP name

countryobject · Countryrequired
Show propertiesHide properties
codestring· max length: 10required

ISO country code

namestring· max length: 255required

Country name

regionobject· nullableoptional
Show propertiesHide properties
codestringrequired

Region code

namestringrequired

Region name

400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/proxies/isps?proxy_type=premium&country_code=text&region_code=text&city_code=text
GET /user/api/proxies/isps?proxy_type=premium&country_code=text&region_code=text&city_code=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/proxies/isps?proxy_type=premium&country_code=text&region_code=text&city_code=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/isps"
params = {
    "proxy_type": "premium",
    "country_code": "text",
    "region_code": "text",
    "city_code": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/isps?proxy_type=premium&country_code=text&region_code=text&city_code=text";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/isps?proxy_type=premium&country_code=text&region_code=text&city_code=text"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/proxies/isps?proxy_type=premium&country_code=text&region_code=text&city_code=text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/isps?proxy_type=premium&country_code=text&region_code=text&city_code=text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/isps?proxy_type=premium&country_code=text&region_code=text&city_code=text");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "count": 1,
  "results": [
    {
      "code": "text",
      "name": "text",
      "country": {
        "code": "text",
        "name": "text"
      },
      "region": {
        "code": "text",
        "name": "text"
      }
    }
  ]
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Last updated on

On this page