Skip to main content

Create Token

Creates a new residential token with the specified parameters. Residential tokens always authenticate with generated username/password credentials.
POST/resi/token/create

Authentication

Basic username/password authentication

Request Body

dataLimit
Required
Type:integer
Description:

Data limit in bytes. The token will expire when dataUsage reaches this limit

Validation:

Must be at least 1000000 (1 MB)

username
Optional
Type:string
Description:

Username for proxy authentication. Must be exactly 8 characters. If not provided, a random 8-character alphanumeric username will be auto-generated

Validation:

Must be exactly 8 characters

Default:Auto-generated 8-character alphanumeric string
durationHours
Optional
Type:integer
Description:

Number of hours until the token expires. If set to 0, token will not expire based on time. Maximum value is 87600 (10 years)

Validation:

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

Default:0 (unlimited duration)

Code Example

const axios = require('axios');

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

try {
const response = await axios.post(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": 0,
  "status": "active",
  "createdAt": 1752251968,
  "updatedAt": 1752251968,
  "dataUsage": 0,
  "dataLimit": 100000000000,
  "allowedPools": []
}

Notes

Upon creation, the token status is always "active". Username is optional and must be exactly 8 characters if provided (auto-generated if not specified). Password is automatically generated and returned in the response - it cannot be specified in the request. Username/password authentication is the only authentication method for residential tokens.

Token Creation Details

Required Fields

  • dataLimit - The only required field. Specifies the maximum data usage in bytes before the token expires. The value must be at least 1,000,000,000 (1 GB) and provided in whole gigabyte increments (multiples of 1,000,000,000 bytes).

Auto-Generated Fields

  • username - Automatically generated as a random 8-character alphanumeric string
  • password - Automatically generated as a random 8-character alphanumeric string

Optional Fields

  • durationHours - Defaults to 0 (unlimited duration, expires only when data limit is reached)

Residential tokens always use the generated username/password credentials for authentication. Residential proxies do not support IP authentication yet.

Resellers cannot decrease a token's dataLimit after creation; increases must still follow the whole-gigabyte rule.

Token Behavior

Duration Hours

  • durationHours: 0 - Token never expires based on time, only when dataUsage >= dataLimit
  • durationHours > 0 - Token expires after the specified number of hours OR when dataUsage >= dataLimit, whichever comes first

Allowed Pools

  • Upon creation, allowedPools is set to an empty array [], meaning the token can access all available proxy pools
  • You can restrict pool access later using the Modify Residential Token endpoint

After Creating a Token

Once your token is created, you can:

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