Skip to main content

Modify Token

Modifies a residential token with the provided parameters. Residential tokens always use generated username/password credentials, and at least one optional field must be provided.
PATCH/resi/token

Authentication

Basic username/password authentication

Request Body

token
Required
Type:string
Description:

The token to modify

password
Optional
Type:string
Description:

Password for authentication. Must be exactly 8 characters

Validation:

Must be exactly 8 characters

allowedPools
Optional
Type:array[string]
Description:

Array of allowed proxy pools. If empty, token can use all pools

Validation:

Array of valid pool identifiers

dataLimit
Optional
Type:integer
Description:

Maximum data limit in bytes. Token expires when dataUsage >= dataLimit

Validation:

Must be at least 1000000 (1 MB)

durationHours
Optional
Type:integer
Description:

Number of hours until the token expires. If set to 0, token will not expire based on time. The expiration time is calculated from the token's original creation date. Maximum value is 87600 (10 years)

Validation:

Must be a non-negative integer, maximum 87600 (10 years)

Code Example

const axios = require('axios');

const url = "https://api.unknownproxies.com/api/v1/resi/token";
const headers = {
"Authorization": "Basic dXNlcjpwYXNz",
"Content-Type": "application/json"
};
const data = {
"token": "your-token-here",
"password": "your-password-here",
"allowedPools": [],
"dataLimit": 0,
"durationHours": 0
};

try {
const response = await axios.patch(url, {
headers,
data
});
console.log(response.data);
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}

Response Example

{
  "token": "zu8sBXS4gkh7",
  "username": "kGyohRda",
  "authType": "user",
  "password": "bkXBberMQ7",
  "durationHours": 750,
  "status": "active",
  "createdAt": 1752251968,
  "updatedAt": 1754843968,
  "dataUsage": 11574848653,
  "dataLimit": 100000000000,
  "allowedPools": ["us-s", "us-r", "tickets-us-s", "tickets-us-r", "ca-s", "ca-r", "gb-s", "gb-r"]
}

What Can Be Modified

You can modify the following aspects of a residential token:

  • Allowed Pools (allowedPools) - Control which proxy pools the token can access
  • Data Limit (dataLimit) - Increase the maximum data usage limit in bytes. The value must be supplied in whole gigabyte increments (multiples of 1,000,000,000 bytes), and you cannot reduce the data limit below its current value.
  • Duration Hours (durationHours) - Modify the token expiration time

Residential tokens always use generated username/password credentials. IP-based authentication is not available for residential proxies. The password is automatically generated when the token is created and cannot be modified.

At least one of the optional fields above must be provided in the request body.

Duration Hours Modification

When you modify durationHours, the new value replaces the token's validity period. The expiration time is calculated from the token's original createdAt timestamp:

  • Expiration calculation: expirationTime = createdAt + durationHours
  • Increasing duration: If you increase durationHours on an expired token (where createdAt + oldDurationHours <= currentTime), the token will become active again and proxy requests will resume working (as long as dataUsage < dataLimit)
  • Decreasing duration: You can reduce durationHours. However, if the new value makes createdAt + durationHours <= currentTime, the token will immediately become inactive and proxy requests will cease to work
  • Maximum duration: The maximum allowed durationHours value is 87,600 (10 years)

After modifying a token, you might want to:

For complete details on all token fields, see the Residential Token Schema documentation.