Skip to main content

Aaa Accounting

The AAA Accounting APIendpoints providesprovide access to network authentication, authorization, and accounting records.transaction records from network access points. These endpoints allow you to retrieve detailed session information forincluding user connections, data usage, session duration, and network access patterns for monitoring, compliance reporting, and usercompliance activity analysis across access points, locations, and clients.purposes.

Base URL: https://gate.zequenze.com/api/v1

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The AAA (Authentication, Authorization, and Accounting) Accounting API enablescategory youprovides comprehensive access to accessnetwork comprehensiveaccounting records that track user sessions, data usage, and connection details across your network infrastructure. These endpoints are essential for:

    Network Monitoring: Track active and historical user sessions across access points Usage Analytics: Monitor data consumption patterns and session durations Compliance Reporting: Generate detailed reports for regulatory requirements Billing Integration: Access session data for usage-based billing systems Security Auditing: Review connection logs and identify anomalous network activity

    The accounting records andfollow the RADIUS accounting standard, capturing detailed information about user activitysessions logs.including start/stop times, data transfer volumes, client devices, and termination reasons. This APIdata is essentialautomatically forcollected from network administrators,access security teams,points and compliancemade officersavailable whothrough needthese toread-only monitor network access, generate usage reports, and audit user sessions.endpoints.

    Key Features:concepts:

    • Session Tracking:Records: MonitorEach activerecord andrepresents completeda user's network sessionssession with detailedcomprehensive metadata
    connection Flexible Filtering: Filter records by date ranges, users, access points, locations, and clients Compliance Reporting: Generate audit trails for regulatory compliance and security analysisdetails Real-time Monitoring:Data: TrackAccess both active sessions and historical records with flexible filtering Multi-dimensional Filtering: Filter by user, location, access point, time ranges, and session status and user activity across your network infrastructure

    Common Integration Scenarios:

      Building network monitoring dashboards Generating compliancePagination andSupport: auditEfficiently reportshandle Analyzinglarge userdatasets accesswith patterns and network usage Implementing automated security alerts cursor-based on session data Creating billing systems based on network usagepagination

      Endpoints

      GET /aaa_accounting/

      Description: Retrieves a paginated list of AAA accounting records with comprehensiveflexible filtering options. This endpoint is theyour primary methodtool for accessing networksession data, whether you need to monitor active sessions, analyze historical usage patterns, or generate compliance reports. The response includes comprehensive session datadetails andfrom supportsRADIUS variousaccounting filter parameters to narrow down results based on time periods, users, network locations, and session status.data.

      Use Cases:

      • Generate daily/weekly/monthly network usage reports
      Monitor current active user sessions across all access points AuditGenerate userusage accessreports for specific time periods or locations Track data consumption patterns for securitycapacity analysisplanning CreateExport session data for external billing reportsor basedanalytics on session duration and data usagesystems TrackAudit network activityaccess byfor locationsecurity or client devicecompliance

      Full URL Example:

      https://gate.zequenze.com/api/v1/aaa_accounting/?start_date=2024-01-01&end_date=2024-01-31&session_status=active&limit=50
      

      Parameters:

      Parameter Type In Required Description
      start_date string query No Filter records from this date/timetime. onwards. SupportsAccepts ISO format: 2024-2000-01-01,01, 2024-2000-01-01 00:01:00,00, or 2024-2000-01-01 00:01:00+00:00
      end_date string query No Filter records up tountil this date/time. Uses sameAccepts ISO formatformat: as2000-01-01, start_date2000-01-01 00:01:00, or 2000-01-01 00:01:00+00:00
      user integer query No Filter records by specific user ID to showsee sessions for a particular user
      access_point integer query No Filter records by access point ID to showsee sessions from specific network hardware
      location integer query No Filter records by location ID to analyzesee usagesessions atfrom specific physicalsites locationsor buildings
      client integer query No Filter records by client organization ID tofor trackmulti-tenant sessionsenvironments
      from specificclientsession_status devicesstring query No Filter by session state. Values: all (default), active (ongoing sessions), inactive (completed sessions) cursor string query No Pagination cursor for retrieving the next page of results limit integer query No Number of records to return per page (default varies, typicallyrecommended: 20-10-100) session_status string query No Filter by session status - use 'active' for ongoing sessions or other status values

      cURL Example:

      curl -X GET "https://gate.zequenze.com/api/v1/aaa_accounting/?start_date=2024-01-01&user=123session_status=active&limit=25" \
        -H "Authorization: Bearer YOUR_API_TOKEN" \
        -H "Content-Type: application/json"
      

      Example Response:

      {
        "count": 1247,
        "next": "https://gate.zequenze.com/api/v1/aaa_accounting/?cursor=eyJpZCI6MTAwfQ%3D%3D"xyz123&limit=25",
        "previous": null,
        "results": [
          {
            "radacctid": 12345,
            "acctsessionid": "sess_abc123",
            "acctuniqueid": "unique_456def",
            "username": "john.doe@company.com",
            "groupname": "employees",
            "realm": "company.com",
            "nas_ip_address"nasipaddress": "192.168.1.100"10",
            "nas_port_id"nasportid": "wlan0"wifi0",
            "nas_port_type"nasporttype": "Wireless-802.11",
            "access_point_id": 15,
            "access_point_name": "AP-Building-A-Floor-2",
            "location_id": 3,
            "location_name": "Main Office Building A",
            "client_id": 89,
            "client_mac": "aa:bb:cc:dd:ee:ff",
            "called_station_id": "Corporate-WiFi",
            "calling_station_id": "aa:bb:cc:dd:ee:ff",
            "acct_session_id": "8A7B6C5D4E3F2A1B",
            "acct_start_time"acctstarttime": "2024-01-15T09:15:30Z"30:00Z",
            "acct_stop_time"acctupdatetime": "2024-01-15T10:15:00Z",
            "acctstoptime": null,
            "acct_session_time"acctinterval": 14420,600,
            "acct_input_octets"acctsessiontime": 2547891234,2700,
            "acct_output_octets"acctauthentic": 456789123,"RADIUS",
            "acct_input_packets"connectinfo_start": 1847329,"CONNECT 54Mbps 802.11n",
            "acct_output_packets": 892341,
            "acct_terminate_cause"connectinfo_stop": null,
            "framed_ip_address"acctinputoctets": 15728640,
            "acctoutputoctets": 52428800,
            "calledstationid": "00:1A:2B:3C:4D:5E",
            "callingstationid": "AA:BB:CC:DD:EE:FF",
            "acctterminatecause": null,
            "servicetype": "Framed-User",
            "framedprotocol": "PPP",
            "framedipaddress": "10.0.1.45",
            "session_status"organization_id": "active"org_789",
            "created_at"user_id": "2024-01-15T09:15:30Z"user_456",
            "updated_at"user_transaction_id": "2024-01-15T13:15:50Z"
          }txn_321",
            {
            "radacctid": 12344,
            "username"client_id": "jane.smith@company.com"client_123",
            "realm"client_short_name": "company.com"HQ-Office",
            "nas_ip_address"location_id": "192.168.1.101",
            "nas_port_id": "eth1/0/24",
            "nas_port_type": "Ethernet"loc_987",
            "access_point_id": 8,"ap_654",
            "access_point_name": "Switch-Building-B-Floor-1"AP-Floor2-East",
            "location_id": 5,
            "location_name": "BranchHeadquarters Office Building B"Building",
            "client_id": 156,
            "client_mac"nasidentifier": "ff:ee:dd:cc:bb:aa"ap-hq-f2e-01",
            "called_station_id"klass": "Corporate-LAN"premium",
            "calling_station_id"access_point_mac_addr": "ff:ee:dd:cc:bb:aa"00:1A:2B:3C:4D:5E",
            "acct_session_id"ssid": "9B8A7C6D5E4F3A2C",
            "acct_start_time": "2024-01-15T08:30:15Z",
            "acct_stop_time": "2024-01-15T17:45:22Z",
            "acct_session_time": 33307,
            "acct_input_octets": 1234567890,
            "acct_output_octets": 9876543210,
            "acct_input_packets": 2847593,
            "acct_output_packets": 1947382,
            "acct_terminate_cause": "User-Request",
            "framed_ip_address": "10.0.2.78",
            "session_status": "completed",
            "created_at": "2024-01-15T08:30:15Z",
            "updated_at": "2024-01-15T17:45:22Z"CorpWiFi-Secure"
          }
        ]
      }
      

      Response Codes:

      Status Description
      200 Success - Returns paginated list of AAA accounting records
      400 Bad Request - Invalid date format or parameter values 401 Unauthorized - Invalid or missing API token 403400 ForbiddenBad Request - InsufficientInvalid permissionsdate toformat accessor accountingparameter datavalues

      GET /aaa_accounting/{radacctid}/

      Description: Retrieves detailed information for a specific AAA accounting record usingby its unique RADIUS accounting ID.radacctid. This endpoint provides complete session details including timing, data usage, network information, and termination details for individual networkaccounting sessions.transactions, useful for detailed analysis, troubleshooting specific user issues, or generating detailed session reports.

      Use Cases:

      • Investigate specific user connection issues or session details for troubleshootingproblems
      • Retrieve complete session informationdetails for billing or audit purposes
      • Analyze individual session patterns and data usage
      Generate detailed reportsconnection parameters for specific network incidentsoptimization Export individual session datarecords for compliance documentation

      Full URL Example:

      https://gate.zequenze.com/api/v1/aaa_accounting/12345/
      

      Path Parameters:

      Parameter Type In Required Description
      radacctid integer path Yes The unique RADIUSaccounting accountingrecord ID forto the session recordretrieve

      cURL Example:

      curl -X GET "https://gate.zequenze.com/api/v1/aaa_accounting/12345/" \
        -H "Authorization: Bearer YOUR_API_TOKEN" \
        -H "Content-Type: application/json"
      

      Example Response:

      {
        "radacctid": 12345,
        "acctsessionid": "sess_abc123",
        "acctuniqueid": "unique_456def",
        "username": "john.doe@company.jane.smith@company.com",
        "groupname": "managers",
        "realm": "company.com",
        "nas_ip_address"nasipaddress": "192.168.1.100"15",
        "nas_identifier"nasportid": "corporate-wifi-controller-01"wifi1",
        "nas_port_id": "wlan0",
        "nas_port_type"nasporttype": "Wireless-802.11",
        "access_point_id": 15,
        "access_point_name": "AP-Building-A-Floor-2",
        "access_point_location": "Building A, Floor 2, Conference Room",
        "location_id": 3,
        "location_name": "Main Office Building A",
        "location_address": "123 Corporate Blvd, Suite 100",
        "client_id": 89,
        "client_mac": "aa:bb:cc:dd:ee:ff",
        "client_vendor": "Apple Inc.",
        "client_device_type": "smartphone",
        "called_station_id": "Corporate-WiFi",
        "calling_station_id": "aa:bb:cc:dd:ee:ff",
        "acct_session_id": "8A7B6C5D4E3F2A1B",
        "acct_unique_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
        "acct_start_time"acctstarttime": "2024-01-15T09:15:30Z"15T14:20:00Z",
        "acct_stop_time": null,
        "acct_session_time": 14420,
        "acct_input_octets": 2547891234,
        "acct_output_octets": 456789123,
        "acct_input_gigawords": 2,
        "acct_output_gigawords": 0,
        "acct_input_packets": 1847329,
        "acct_output_packets": 892341,
        "acct_terminate_cause": null,
        "acct_status_type"acctupdatetime": "Interim-Update"2024-01-15T16:45:00Z",
        "acct_authentic"acctstoptime": "2024-01-15T17:30:00Z",
        "acctinterval": 300,
        "acctsessiontime": 11400,
        "acctauthentic": "RADIUS",
        "connect_info"connectinfo_start": "CONNECT 300Mbps 802.11n/300Mbps"11ac",
        "framed_ip_address"connectinfo_stop": "10.0.1.45"User-Request",
        "framed_netmask"acctinputoctets": 234567890,
        "acctoutputoctets": 876543210,
        "calledstationid": "255.255.255.0"00:1A:2B:3C:4D:5F",
        "framed_protocol"callingstationid": "PPP"BB:CC:DD:EE:FF:AA",
        "service_type"acctterminatecause": "User-Request",
        "servicetype": "Framed-User",
        "session_status"framedprotocol": "active"PPP",
        "user_agent"framedipaddress": "iOS/17.2.1 CFNetwork/1494.10.0.7 Darwin/23.2.0"1.78",
        "vlan_id": 100,
        "tunnel_type"organization_id": "VLAN"org_789",
        "tunnel_medium_type"user_id": "IEEE-802"user_789",
        "tunnel_private_group_id"user_transaction_id": "100"txn_456",
        "class"client_id": "employee"client_123",
        "created_at"client_short_name": "2024-01-15T09:15:30Z"HQ-Office",
        "updated_at"location_id": "2024-01-15T13:15:50Z"loc_987",
        "last_update_time"access_point_id": "2024-01-15T13:15:50Z"ap_655",
        "access_point_name": "AP-Floor3-West",
        "location_name": "Headquarters Building",
        "nasidentifier": "ap-hq-f3w-02",
        "klass": "standard",
        "access_point_mac_addr": "00:1A:2B:3C:4D:5F",
        "ssid": "CorpWiFi-Guest"
      }
      

      Response Codes:

      Status Description
      200 Success - Returns detailedthe AAAspecific accounting record
      401 Unauthorized - Invalid or missing API token
      403
      Forbidden - Insufficient permissions to access this record 404 Not Found - AAA accountingAccounting record with specified ID does not exist

      Common Use Cases

      Use Case 1: NetworkActive UsageSession Monitoring Dashboard

      Retrieve all currently active sessions and recent activity to builddisplay real-time network monitoring dashboards.usage. Use the list endpoint with session_status=active and recent date filtersfilter to show currentonly ongoing connections, perfect for network loadoperations andcenters useror activity.IT dashboards.

      Use Case 2: ComplianceMonthly and AuditUsage Reporting

      Generate comprehensive auditmonthly reports by filtering recordswith by date rangesstart_date and exportingend_date sessionparameters. details.Combine Usewith bothlocation endpointsor access_point filters to create detailed complianceusage documentationreports showingfor whospecific accessedsites whator resourcesnetwork and when.segments.

      Use Case 3: User ActivityBehavior Analysis

      Track specific user patterns by filtering with the user parameter, then analyze session durations, data usage, and connection frequency to optimize network resources or identify training needs.

      Use Case 4: Billing Data Export

      Extract session data for usage-based billing by querying records within billing periods and calculating total session time and data transfer volumes per user or organization.

      Use Case 5: Security Incident Investigation

      When investigating security incidents or troubleshooting user connectivity issues, firstincidents, use the listspecific record endpoint to find sessions for a specific user, then use the detail endpoint to examineget complete session informationdetails including dataIP usageaddresses, MAC addresses, connection times, and termination details.

      Use Case 4: Location-Based Usage Analysis

      Analyze network usage patterns by location using the location filter parameter. This helps identify high-traffic areas, plan network capacity, and optimize access point placement.

      Use Case 5: Billing and Cost Allocation

      Track data usage and session durationcauses for costforensic allocation or billing purposes. Filter by client or user to calculate usage-based charges or departmental network costs.analysis.


      Best Practices

      • Use Date Filters Efficiently:Effectively: Always specifyuse reasonablestart_date dateand rangesend_date parameters when querying historical data to avoidimprove retrievingperformance excessiveand data.reduce Theresponse API performs better with focused queries rather than broad date ranges.

        times
      • Implement Proper Pagination:Pagination: Use the cursor-based pagination for large datasets rather than trying to retrieve all records at once. This ensures better performance and prevents timeouts.

        once
      • Cache SessionResponses: Details:Accounting Fordata frequentlyis accessedgenerally sessionimmutable records,once implementsessions client-sidecomplete, making it suitable for caching to reduce API calls,calls

      especially Monitor Rate Limits: Be mindful of API rate limits when building automated reporting systems or real-time dashboards that display the same session information multiple times.

      Handle TimeTimezones: ZonesAll Consistently:timestamps Whenare filteringin UTC; convert to local timezone in your application as needed

      Filter by dates,Organization: useIn ISOmulti-tenant 8601environments, formatalways withfilter timezoneby informationclient parameter to ensure consistentproper resultsdata across different environments and user locations. isolation

      MonitorUse RateSession Limits:Status Appropriately: Filter by session_status=active for monitoring dashboards, and session_status=inactive for historical reporting

      Error Handling: Implement appropriate rate limiting and retry logic infor yournetwork applications,timeouts especiallyand handle 404 responses gracefully when processingquerying largespecific batchesrecord of accounting records for reporting purposes.

      Filter at the API Level: Use the provided filter parameters rather than retrieving all records and filtering client-side. This reduces bandwidth usage and improves application performance.

      Security Considerations: AAA accounting data contains sensitive user and network information. Ensure proper access controls and audit logging for API usage, and never log sensitive session data in application logs.

      IDs