OpenAPI Documentation
OpenAPI Documentation
Create a dynamic sub-account
Create a dynamic sub-account and return its status and connection password. Before creation, the available dynamic traffic balance must be greater than 0.
API information
| Item | Value |
|---|---|
| Method | POST |
| Path | /open-api/v1/dynamic/accounts |
| Authentication | X-API-Key |
| Content-Type | application/json |
| Processing | Synchronous |
| Request number | Required; protected for 24 hours |
Request body
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
request_no |
string | Yes | Caller-generated request number used only to prevent duplicate acceptance | 1–64 characters; letters, digits, _, and - only |
sub_account |
string | Yes | Caller-recognizable sub-account name | After trimming, 3–32 characters; starts and ends with a letter or digit; may contain letters, digits, _, and - in between |
limit_traffic_gb |
string | No | Lifetime cumulative traffic limit in GB | Nonnegative plain decimal string with up to 6 decimal places; defaults to 0.000000 when omitted; 0 means unlimited |
sub_account cannot be changed after creation and remains permanently reserved under the current account. The same name cannot be reused even after the account is removed. Names are case-sensitive.
Request example
curl --request POST \
--url 'https://api-test.puraroute.com/gin/open-api/v1/dynamic/accounts' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <YOUR_API_KEY>' \
--data '{
"request_no": "account-20260824-001",
"sub_account": "team_a_01",
"limit_traffic_gb": "10.000000"
}'
Response fields
| Field | Type | Nullable | Description |
|---|---|---|---|
id |
string | No | Dynamic sub-account ID |
sub_account |
string | No | Sub-account name |
password |
string | No | Proxy connection password; sensitive information |
limit_traffic_gb |
string | No | Lifetime cumulative traffic limit with 6 decimal places; 0.000000 means unlimited |
lifetime_used_gb |
string | No | Lifetime cumulative traffic used |
resource_status |
string | No | ACTIVE or REMOVED |
user_enabled |
boolean | No | Caller-requested enabled state |
flow_blocked |
boolean | No | Whether use is paused due to traffic-balance conditions |
available |
boolean | No | Whether all current conditions for use are met |
control_pending |
boolean | No | Whether a state change is still being applied |
last_usage_sync_time |
string | Yes | Most recent usage update time |
create_time |
string | No | Creation time in GMT+8 ISO-8601 |
update_time |
string | No | Update time in GMT+8 ISO-8601 |
Successful response example
{
"code": 0,
"msg": "success",
"data": {
"id": "1912345678901234567",
"sub_account": "team_a_01",
"password": "example-secret",
"limit_traffic_gb": "10.000000",
"lifetime_used_gb": "0.000000",
"resource_status": "ACTIVE",
"user_enabled": true,
"flow_blocked": false,
"available": true,
"control_pending": false,
"last_usage_sync_time": null,
"create_time": "2026-08-24T15:30:00.000+08:00",
"update_time": "2026-08-24T15:30:00.000+08:00"
},
"next": null
}
Possible error codes
code |
Description | Recommended action |
|---|---|---|
300006 |
Duplicate request number | Query the account list; do not resubmit |
300340 |
Dynamic traffic balance is not positive | Purchase dynamic traffic first |
300341 |
Dynamic sub-account limit reached | Reuse an existing account or contact support |
300358 |
Sub-account name already exists | Change the name and request number |
400001 |
Authentication failed | Check the API key |
400009 |
Request parameters are invalid | Correct the request |
500000 |
System processing failed and the creation result may be uncertain | Query the account list first; do not immediately create again with a new request number |
The response contains a password. Treat it as sensitive information.
request_no only prevents duplicate acceptance; it is not a result-query key and does not replay the original result. See Request numbers and duplicate submissions.