VirtFusion Global API
  1. External Relational ID
VirtFusion Global API
  • General
    • Test connection
      GET
  • Hypervisors
    • Retrieve hypervisors
      GET
    • Retrive a Hypervisor
      GET
  • Hypervisor Groups
    • Retrieve hypervisor groups
      GET
    • Retrieve a hypervisor group
      GET
    • Retrieve a hypervisor groups resources
      GET
  • Servers
    • Network
      • Firewall
        • Disable firewall
        • Enable firewall
        • Retrieve firewall
        • Apply firewall rulesets
      • Add an address to the whitelist
      • Remove an address from the whitelist
      • Add a quantity of IPv4 addresses
      • Add an array of IPv4 addresses
      • Remove an array of IPv4 addresses
    • Power
      • Boot a server
      • Shutdown a server
      • Restart a server
      • Poweroff a server
    • Traffic
      • Add a traffic block to a server
      • Remove a traffic block from a server
      • Retrieve a servers traffic blocks
    • Retrieve a server
    • Add, remove or modify a backup plan
    • Build a server
    • Change a server package
    • Create a server
    • Delete a server
    • Retrieve servers
    • Modify a server name
    • Reset a server password
    • Retrieve a users servers
    • Retrieve OS templates available to a server
    • Suspend a server
    • Throttle a servers CPU
    • Retrieve a servers traffic statistics
    • Unsuspend a server
    • Enable or disable VNC for a server
    • Change Owner
    • Modify primary traffic allowance
  • IP Blocks
    • Add an IPv4 range to an IP block
    • Retrieve IP blocks
    • Retrieve an IP block
  • Backups
    • Retrieve a server backups
  • DNS
    • Retrieve a DNS service
  • Media
    • Retrieve an ISO
    • Retrieve operating system templates that are available for a package
  • Packages
    • Retrieve packages
    • Retrieve a packge
  • Queue & Tasks
    • Retrieve a queue item
  • SSH Keys
    • Add an SSH key to a user account
    • Delete an SSH key from a user
    • Retrieve a users SSH keys
    • Retrieve an SSH key
  • Users
    • External Relational ID
      • Delete a user
      • Generate a set of login tokens
      • Generate a set of loging tokens using a server ID
      • Modify a user
      • Change a user passowrd
      • Retrieve a user
    • Create a user
  • Self Service
    • External Relational ID
      • Add credit to user
        POST
      • Add an hourly group profile to a user
        POST
      • Add a resource group profile to a user
        POST
      • Add a resource pack to a user
        POST
      • Retrieve hourly statistics
        GET
      • Modify user access
        PUT
      • Remove hourly group profile from a user
        DELETE
      • Remove resource group from a user
        DELETE
      • Generate a report
        GET
      • Set an hourly resource pack
        PUT
      • Retrieve a users usage
        GET
    • Cancel credit that was applied to a user
      DELETE
    • Delete all servers attached to a pack ID
      DELETE
    • Delete a user resource pack
      DELETE
    • Retrieve a user resource pack
      GET
    • Modify user resource pack
      PUT
    • Retrieve currencies
      GET
    • Suspend all servers assigned to a reosurce pack
      POST
    • Unsuspend all servers assigned to a reosurce pack
      POST
  1. External Relational ID

Retrieve a users usage

Developing
GET
/selfService/usage/byUserExtRelationId/{extRelationId}

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params

Query Params

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request GET '/selfService/usage/byUserExtRelationId/1?period[]=2025-01-01&range=m'

Responses

🟢200Success
application/json
Body

Example
{
    "data": {
        "user": {
            "id": 3,
            "relationalId": 1,
            "currency": null,
            "timezone": "Europe/London",
            "name": "jon Doe",
            "email": "jon@doe.com"
        },
        "usageServers": {
            "hours": 0,
            "token": 0,
            "tokenReal": 0
        },
        "usageServersBillable": {
            "hours": 0,
            "token": 0,
            "tokenReal": 0
        },
        "usageAddons": {
            "hours": 0,
            "token": 0,
            "tokenReal": 0
        },
        "usageAddonsBillable": {
            "hours": 0,
            "token": 0,
            "tokenReal": 0
        },
        "periods": [
            {
                "period": "2025-01-01",
                "range": "month",
                "start": "2025-01-01T00:00:00+00:00",
                "end": "2025-01-31T23:59:59+00:00",
                "timezone": "UTC",
                "currentPeriod": true,
                "hoursInMonthPeriod": 744,
                "monthToHourRate": 730,
                "monthToHourRateType": 1,
                "days": 31,
                "hours": 744,
                "minutes": 44640,
                "seconds": 2678400,
                "usageServers": {
                    "hours": 0,
                    "token": 0,
                    "tokenReal": 0
                },
                "usageServersBillable": {
                    "hours": 0,
                    "token": 0,
                    "tokenReal": 0
                },
                "usageAddons": {
                    "hours": 0,
                    "token": 0,
                    "tokenReal": 0
                },
                "usageAddonsBillable": {
                    "hours": 0,
                    "token": 0,
                    "tokenReal": 0
                },
                "servers": []
            }
        ]
    }
}
🟠401401
Modified at 2025-01-20 21:49:10
Previous
Set an hourly resource pack
Next
Cancel credit that was applied to a user
Built with