Skip to content

Subscribers โ€‹

Base URL: https://your-domain.com/api/v1

Manage subscriber accounts. Supersedes the legacy /api/user endpoints. All require HTTP Basic Auth.

Activation is separate

Creating a subscriber here is a profile record only. To activate/renew (RADIUS + billing), use Activation.

Fetch subscribers โ€‹

GET /api/v1/subscriber/list โ€” With filters; enriches area/subarea/city.

FilterNotes
user_id, username, mobile, phone, email, nicIdentity
package_id, salesperson_id, nas_id, static_ip, mac_addressService
profile_status, connection_status, connection_type, sms_status, mac_lockStatus
limit, offsetPaging
  • 200: JSON array of subscriber objects (isp_id, id, name, username, password, mobile_number, package_id, current_expiration_date, โ€ฆ, area_data). The portal_pass hash is not exposed.

cURL

bash
curl -u "user:pass" "https://your-domain.com/api/v1/subscriber/list?package_id=5&limit=50"

Get subscriber โ€‹

GET /api/v1/subscriber/get/{id} โ€” Single subscriber. 404 if not found.

Create subscriber โ€‹

POST /api/v1/subscriber/create

Required: isp_id, name, username, password, package_id, connection_type_id, salesperson_id, nas_id, nic_number, mobile_number

Optional: phone_number, email, address, city_id, area_id, subarea_id, latitude, longitude, box_number, box_address, uplink_port, fiber_code, fiber_color, switch_board, switch_port, backup_connection, electricity_socket, cable_type

Uniqueness is enforced on username, nic_number, mobile_number, phone_number, email.

  • 200: { "success": "Subscriber Successfully Created.", "id": 1042 } ยท 400: validation

Update subscriber โ€‹

POST /api/v1/subscriber/update โ€” Keyed by username (username itself is not changed). Same fields as create. Unlike the legacy API, this does not reset status/connection/MAC-lock.

  • 200: { "success": "Subscriber Successfully Updated." }

Usage & online status โ€‹

GET /api/v1/subscriber/usage/{id} โ€” Live session + data-quota snapshot.

  • 200:
json
{
  "user_id": 1024, "username": "john123", "online": true,
  "session": { "ip": "10.0.0.5", "nas_ip": "10.0.0.1", "session_id": "โ€ฆ", "mac": "AA:BB:โ€ฆ",
               "start_time": "โ€ฆ", "last_update": "โ€ฆ" },
  "data_quota": { "enabled": false, "total_bytes": 0, "used_bytes": 0 }
}

When offline, online is false and session is null.

Notes โ€‹

GET /api/v1/subscriber/notes/{id} โ€” Global note + read-only staff notes.

json
{ "user_id": 1024, "global_note": "VIP customer", "staff_notes": [ { "id": 3, "note": "โ€ฆ", "added_by": 5 } ] }

POST /api/v1/subscriber/note โ€” Set the global note. Params: user_id (required), note (required).

  • 200: { "success": "Note Successfully Updated." }

Reset password โ€‹

POST /api/v1/subscriber/reset_password โ€” Params: user_id (required), new_password (required) (max 20). Updates the profile password and, for active subscribers, the RADIUS password. Call disconnect to force the session onto the new password.

  • 200: { "success": "Password Successfully Updated." }

MAC binding โ€‹

POST /api/v1/subscriber/mac_lock โ€” Bind to a MAC. Params: user_id (required), mac_address (required).

POST /api/v1/subscriber/mac_unlock โ€” Remove the binding. Params: user_id (required).

POST /api/v1/subscriber/change_mac โ€” Replace the bound MAC. Params: user_id (required), mac_address (required).

  • 200: { "success": "MAC Successfully Locked." } (or Unlocked / Updated)

www.onezeroart.com