OpenAPI Documentation
OpenAPI Documentation
Enable or disable a dynamic sub-account
Set the caller-requested enabled state of a dynamic sub-account. A state change may take a short time to become fully effective.
API information
| Item | Value |
|---|---|
| Method | PATCH |
| Path | /open-api/v1/dynamic/accounts/{id}/status |
| Authentication | X-API-Key |
| Content-Type | application/json |
| Processing | Synchronous acceptance of the state change |
Path parameter
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | Dynamic sub-account ID |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
user_enabled |
boolean | Yes | true to enable; false to disable |
Use a JSON boolean. Do not send the string "true" or the number 1.
Request example
curl --request PATCH \
--url 'https://api-test.puraroute.com/gin/open-api/v1/dynamic/accounts/1912345678901234567/status' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <YOUR_API_KEY>' \
--data '{
"user_enabled": false
}'
Response fields
| Field | Type | Description |
|---|---|---|
id |
string | Dynamic sub-account ID |
resource_status |
string | ACTIVE or REMOVED |
user_enabled |
boolean | Caller-requested enabled state |
flow_blocked |
boolean | Whether use is paused due to traffic-balance conditions |
available |
boolean | Whether current conditions for use are met |
control_pending |
boolean | true while the state change is still being applied |
Successful response example
{
"code": 0,
"msg": "success",
"data": {
"id": "1912345678901234567",
"resource_status": "ACTIVE",
"user_enabled": false,
"flow_blocked": false,
"available": false,
"control_pending": true
},
"next": null
}
When control_pending = true, query account details later until it becomes false. user_enabled = true does not guarantee available = true; traffic conditions must also be satisfied.
Possible error codes
code |
Description |
|---|---|
300001 |
The account does not exist or is inaccessible |
300328 |
The account has been removed and cannot be changed |
400001 |
Authentication failed |
400009 |
The path, boolean value, or request body is invalid |
500000 |
System processing failed; the request did not complete |