TruGrid API
Overview
The TruGrid API enables customers and partners to interact programmatically with the TruGrid platform.
The TruGrid API enables the following functionality:
- Manage MFA settings for users
- Manage User-Machine Assignments
- Initiate an Active Directory sync to sync resources
- Manage allowed UPN suffixes
- Clear Machine Associations
- Clear Application Associations
- Force Active Directory Refresh
- Force Application Refresh
- Enable RDP over UDP for user
- Disable RDP over UDP for user
- Fetch Whitelist - IP
- Fetch Whitelist - DNS
- Get User Logon IP
- Set Machine Associations
- Get Machine Associations
- Get MFA Status
- Set Application Associations
- Get Application Associations
- Send MFA Code
- Validate MFA Code
- Set License Allocation
- Get License Allocation
How to obtain an API key
To utilize the TruGrid API, you will need an API key provisioned for your company. This key can be used for your primary domain and any customer domains (if you are an MSP). You can request an API key via TruGrid support, either via chat or by sending an email to help@trugrid.com .
When requesting an API key, please provide:
- Your TruGrid admin login email address and domain name.
- Up to 15 external facing IP address the requests would initiate from. Only requests from those IP addresses will be processed.
API Interaction Rules
The below rules are applicable to all API endpoints listed in this document:
- API supports HTTP method POST
- Authentication header required (“api_key”)
- To select domain for which request should be executed, domain DNS should be passed as query parameter called domainName
Example: https:// {api url}/{api_route}?domainName=domain.com
- Other data required for API should be passed through the request body as JSON. The exact format will be listed in the specific API description.
- Request body cannot contain more than 100 elements.
- User’s UPN or domain’s DNS should be passed in corresponding format or else request will not be executed
Turn ON MFA
- Description: API designed to turn ON MFA for users if it was previously disabled.
- Request URI: https:// {api url}/api/public/turnOnMfa
- Query parameters: domainName – DNS name of domain
- Request Body: list of user’s UPNs.
Turn OFF MFA
- Description: API designed to turn OFF MFA for users. It cannot be disabled for users with an Admin role.
- Request URI: https:// {api url}/api/public/turnOffMfa
- Query parameters: domainName – DNS name of domain
- Request Body: list of user’s UPNs.
Reset MFA
- Description: API designed to reset MFA for users. This cannot be done if the MFA is not set, or it is turned OFF.
- Request URI: https:// {api url}/api/public/resetMfa
- Query parameters: domainName – DNS name of domain
resetPhone – parameter which indicates if phone number should be reset.
Can have 2 values: true or false. (If true then phone number will also be reset.)
- Request Body: list of user’s UPNs.
Create User-Machine Assignments
- Description: API designed to create assignment between user/user group and machine/machine group (same as Resource Assignments on TruGrid portal).
- Request URI: https:// {api url}/api/public/addUserMachineAssignment
- Query parameters: domainName – DNS name of domain
- Request Body: list of key-value pairs, where key is user’s UPN or user’s group name, and value is list of machines and/or machine’s group names. Keys should be unique.
Sync Newly Added Users
- Description: API designed to synchronize users added directly into TG-Users group in AD.
- Request URI: https:// {api url}/api/public/syncAddedAdUsers
- Query parameters: domainName – DNS name of domain.
- Request Body: list of user’s UPNs.
Sync Newly Added Machines
- Description: API designed to synchronize machines added directly into TG-Machines group in AD.
- Request URI: https:// {api url}/api/public/syncAddedAdMachines
- Query parameters: domainName – DNS name of domain
- Request Body: list of machine’s names.
Sync Newly Added User Groups
- Description: API designed to synchronize user’s groups added directly into TG-Users group in AD.
- Request URI: https:// {api url}/api/public/syncAddedAdUserGroups
- Query parameters: domainName – DNS name of domain
- Request Body: list of user’s group names.
Sync Newly Added Machine Groups
- Description: API designed to synchronize machine’s groups added directly into TG-Machines group in AD.
- Request URI: https:// {api url}/api/public/syncAddedAdMachineGroups
- Query parameters: domainName – DNS name of domain
- Request Body: list of machine’s groups names.
Add Allowed UPN Suffixes
- Description: API designed to add allowed UPN suffix for specific domain. Passed DNS names cannot match any of the already registered domains in TruGrid or already have been added as UPN suffix to another domain.
- Request URI: https:// {api url}/api/public/addUpnSuffix
- Query parameters: domainName – DNS name of domain
- RequestBody: list of domain’s DNS.
Clear Machine Associations
- Description: Endpoint to clear machine associations for specific domain. Can be done group-wise or for entire domain. Domain name should be passed as query parameter (domainName) in URL. To clear associations for specific groups – list of them should be passed into request body. To clear associations for all domains an empty list should be passed into request body.suffix to another domain.
- Request URI: https:// {api url}/api/public/clearMachineAssociations
- Query parameters: domainName – DNS name of domain
- RequestBody: application/JSON.
Example:
[] – clear for all groups in domain domain.com
[“group1”,“group2”] – clear for group1 and group2 for domain domain.com
Clear Application Associations
- Description: Endpoint to clear application associations for specific domain. Can be done group-wise or for entire domain. Domain name should be passed as query parameter (domainName) in URL. To clear associations for specific groups – list of them should be passed into request body. To clear associations for all domains an empty list should be passed into request body.
- Request URI: https:// {api url}/api/public/clearAppAssociations
- Query parameters: domainName – DNS name of domain
- RequestBody: application/JSON.
Example:
[] – clear for all groups in domain domain.com
[“group1”,“group2”] – clear for group1 and group2 for domain domain.com
Force Active Directory Refresh
- Description: Endpoint synchronizes all user and machine data from Active Directory for specific domain. Domain name should be passed as query parameter (domainName) in URL. Body of request should be empty.
- Request URI: https:// {api url}/api/public/RefreshActiveDirectory
- Query parameters: domainName – DNS name of domain
- RequestBody: Empty
Force Application Refresh
- Description: Endpoint synchronizes all published applications data from Active Directory for specific domain. Domain name should be passed as query parameter (domainName) in URL. Body of request should be empty.
- Request URI: https:// {api url}/api/public/RefreshApplications
- Query parameters: domainName – DNS name of domain
- RequestBody: Empty
Enable UDP
- Description: Endpoint enables UDP transport for RDP connections for specified users in a domain. Domain name should be passed as query parameter (domainName) in URL. Body of request should contain a list of user UPNs. If body is empty, UDP will be enabled for all users in the domain.
- Request URI: https://{api url}/api/public/EnableUdp
- Query parameters: domainName – DNS name of domain
- Request Body: JSON array of user UPN strings (optional — if empty, applies to all users)
Disable UDP
- Description: Endpoint disables UDP transport for RDP connections for specified users in a domain. Domain name should be passed as query parameter (domainName) in URL. Body of request should contain a list of user UPNs. If body is empty, UDP will be disabled for all users in the domain.
- Request URI: https://{api url}/api/public/DisableUdp
- Query parameters: domainName – DNS name of domain
- Request Body: JSON array of user UPN strings (optional — if empty, applies to all users)
Get IP Whitelist
- Description: API designed to retrieve the full IP whitelist for a specified domain. Returns a list of whitelisted IPs in JSON format, suitable for use in monitoring and firewall configuration workflows.
- Request URI: https:// {api url}/api/public/IpWhitelist
- HTTP Method:
GET - Query parameters:
domainName(required) – DNS name of the domain
- Response Body: JSON list of whitelisted IP addresses associated with the specified domain.
Get User Logon IP
- Description: API designed to retrieve user logon IP addresses for monitoring and alerting purposes. Supports querying by a single user UPN, multiple user UPNs, or an entire domain — returning the IP address(es) from each user's last login across web, desktop, and mobile. Results are returned in JSON format with appropriate HTTP status codes.
- Request URI: https:// {api url}/api/public/getUserLogonIp
- Query parameters:
upns– UPN of a single user or list of user UPNsdomainName– DNS name of the domain (returns last login IPs for all users in the domain)
- Response Body: JSON list of objects containing user UPN and their last login IP per client type (web, desktop, mobile).
Get External Resources DNS
- Description: API designed to retrieve a list of external resource DNS entries that should be whitelisted. Returns all DNS names required for proper whitelisting configuration in JSON format.
- Request URI: https:// {api url}/api/public/ExternalResources
- HTTP Method:
GET - Query parameters:
domainName(required) – DNS name of the domain
- Response Body: JSON list of external resource DNS entries required for whitelisting for the specified domain.
Set Machine Associations
- Description: Creates or updates user-to-machine associations within machine groups. Each item maps one user (by UPN) to one machine (by hostname) within a named group.
- Request URI: https://{api url}/api/public/SetMachineAssociations
- HTTP Method:
POST - Auth: api_key header
- Content-Type: application/json - JSON array, max 100 items:
[
{ "userUpn": "john@contoso.com", "groupName": "DesktopPool1", "machineName": "PC-01" },
{ "userUpn": "jane@contoso.com", "groupName": "DesktopPool1", "machineName": "PC-02" },
{ "userUpn": "bob@contoso.com", "groupName": "ServerPool", "machineName": "SRV-05" }
]- Fields:
Field | Type | Required | Description |
|---|---|---|---|
userUpn | string | Yes | User principal name (email format) |
groupName | string | Yes | Machine group name |
machineName | string | Yes | Machine hostname |
- Status Values:
Status | Meaning |
|---|---|
Success. | Association created successfully |
Success. Previous association with '{machineName}' replaced. | User had existing association in this group; updated to new machine |
Error. Reason: Required data is missing. | One or more required fields are empty |
Error. Reason: Group '{groupName}' not found in domain '{domainName}'. | Group does not exist |
Error. Reason: Machine '{machineName}' not found in domain '{domainName}'. | Machine does not exist |
Error. Reason: Machine '{machineName}' is not a member of group '{groupName}'. | Machine exists but is not in the specified group |
Error. Reason: User '{userUpn}' not found in domain '{domainName}'. | User does not exist |
Error. Reason: User '{userUpn}' is not assigned to group '{groupName}'. | User exists but is not assigned to the group |
Error. Reason: Machine '{machineName}' is already associated with user '{otherUpn}' in group '{groupName}'. | Client-only group: machine is taken by another user |
- Error Responses (400 Bad Request):
• Empty or null body: "Request body must contain at least one association."
• More than 100 items: "Maximum 100 items per request."
• Invalid UPN format: "Invalid UPN format encountered at {upn}."
- Notes:
• In groups containing only client machines (non-server), each machine can only be associated with one user at a time
• In groups containing at least one server, multiple users can be associated with the same machine
• If a user already has an association in the group, it will be updated to the new machine
• UPN format is validated before processing (must be valid email format)
Get Machine Associations
- Description: Retrieves existing machine associations filtered by either a group name or a user UPN. Exactly one filter must be provided (not both, not neither).
- Request URI: https:// {api url}/api/public/GetMachineAssociations?domainName={domainName}&groupName={groupName} or ...&userUpn={userUpn}
- HTTP Method:
GET - Fields:
Parameter | Type | Required | Description |
|---|---|---|---|
domainName | string | Yes | Domain DNS name |
groupName | string | One of two | Filter by machine group name |
userUpn | string | One of two | Filter by user UPN |
- Error Responses (400 Bad Request):
Condition | Message |
|---|---|
Both filters provided | Exactly one of 'groupName' or 'userUpn' must be provided. |
Neither filter provided | Exactly one of 'groupName' or 'userUpn' must be provided. |
Invalid UPN format | Invalid UPN format encountered at {upn}. |
Group not found | Group '{groupName}' not found in domain '{domainName}'. |
User not found | User '{userUpn}' not found in domain '{domainName}'. |
Get MFA Status
- Description: Retrieves the current MFA status and enrolled MFA method for users in a domain. Pass a list of user UPNs in the request body to check specific users, or an empty array
[]to return the status of every user in the domain. Unknown users are reported per item in the response and do not fail the request. - Request URI: https://{api
url}/api/public/GetMfaStatus?domainName={domainName} - HTTP Method:
POST - Fields:
Parameter | Type | Required | Description |
|---|---|---|---|
domainName | string | Yes | Domain DNS name (query string) |
userNames | string[] (JSON body) | Yes (may be empty) | List of user UPNs to check. Send |
- Request Body Example:
["user1@contoso.com", "user2@contoso.com"]- Response (200 OK): JSON array with one item per requested user (or per domain user when the body is empty).
Field | Type | Description |
|---|---|---|
username | string | User UPN |
result | string |
|
mfaStatus | string | Current MFA state. See values below. |
type | string | Enrolled MFA method. Populated only when |
- mfaStatus values:
Value | Meaning |
|---|---|
MFA Pending Setup | No MFA record exists yet, or MFA is enabled but the user has not completed enrollment |
MFA Enabled | MFA is enabled and enrollment is complete |
MFA Reset or Pending Re-enrollment | MFA is enabled, was reset by an administrator, and the user has not re-enrolled |
MFA Disabled | MFA is turned off for the user |
N/A | User not found in the domain |
- type values:
Value | Meaning |
|---|---|
Authenticator | Authentication app |
Phone | Text message (SMS) |
Email code | |
N/A | Not enrolled or user not found |
- Response Example:
[
{ "username": "user1@contoso.com", "result": "Success.", "mfaStatus": "MFA Enabled", "type": "Authenticator" },
{ "username": "user2@contoso.com", "result": "Success.", "mfaStatus": "MFA Pending Setup", "type": "N/A" },
{ "username": "unknown@contoso.com", "result": "Error. Reason: User does not exist.", "mfaStatus": "N/A", "type": "N/A" }
]- Error Responses (400 Bad Request):
Condition | Message |
|---|---|
Domain not found | Domain with given name does not exist. |
Request body missing or JSON | Body cannot be null |
Request body is not a JSON array of strings | Wrong input type |
More than 100 user names provided | You cannot pass more than 100 user names at one time. |
| api_key must be provided |
- Other Responses:
403 Forbiddenwhen the API key is invalid, not issued for this domain, or the caller IP is not on the key's allow-list.
Set Application Associations
- Description: Pins users to servers of pooled groups that publish RemoteApp applications. Each item maps one user (by UPN) to one server (by hostname) within a named group. While that server is online, the user's apps from the group open on it. This is the same association TruGrid creates on the user's first app launch in the group.
- Request URI: https://{api url}/api/public/SetAppAssociations
- HTTP Method:
POST - Auth: api_key header
- Content-Type: application/json - JSON array, max 100 items:
[
{ "userUpn": "john@contoso.com", "groupName": "AppPool1", "machineName": "SRV-01" },
{ "userUpn": "jane@contoso.com", "groupName": "AppPool1", "machineName": "SRV-02" }
]
- Fields:
Field | Type | Required | Description |
|---|---|---|---|
userUpn | string | Yes | User principal name (email format) |
groupName | string | Yes | Pooled group name |
machineName | string | Yes | Server hostname; the server must be a member of the group |
- Status Values:
Status | Meaning |
|---|---|
Success. | Association created successfully |
Success. Previous association with '{machineName}' replaced. | User had an association in this group; it now points to the new server |
Error. Reason: Required data is missing. | One or more required fields are empty |
Error. Reason: Group '{groupName}' not found in domain '{domainName}'. | Group does not exist |
Error. Reason: Machine '{machineName}' not found in domain '{domainName}'. | Machine does not exist |
Error. Reason: Machine '{machineName}' is not a member of group '{groupName}'. | Machine exists but is not in the specified group |
Error. Reason: User '{userUpn}' not found in domain '{domainName}'. | User does not exist |
Error. Reason: User '{userUpn}' has no applications assigned in group '{groupName}'. | No app published in the group is assigned to the user, directly or through a user group; administrators need none (see Notes) |
Error. Reason: Machine '{machineName}' is not a server; applications run on servers only. | Workstations cannot host the group's apps |
- Error Responses (400 Bad Request):
- Empty or null body: "Request body must contain at least one association."
- More than 100 items: "Maximum 100 items per request."
- Invalid UPN format: "Invalid UPN format encountered at {upn}."
- Domain not found: "Domain with given name does not exist."
- Notes:
- Each user has one association per group; a new server replaces the previous one
- Only apps still published in the group count as assigned; an app removed from the group no longer gives access
- Service provider administrators (MspAdmin, SpTechAdmin) and customer administrators (CustomerAdmin) need no app assignment; technicians and other users need one
- Only users of the domain in domainName can be associated
- If the pinned server is offline when the user launches an app, load balancing picks another server of the group and moves the association
- Each item gets its own status; valid items are saved even when other items fail
- To remove associations, use Clear Application Associations
Get Application Associations
- Description: Retrieves existing application associations filtered by either a group name or a user UPN. Exactly one filter must be provided (not both, not neither).
- Request URI: https://{api url}/api/public/GetAppAssociations?domainName={domainName}&groupName={groupName} or ...&userUpn={userUpn}
- HTTP Method:
GET - Fields:
Parameter | Type | Required | Description |
|---|---|---|---|
domainName | string | Yes | Domain DNS name |
groupName | string | One of two | Filter by pooled group name |
userUpn | string | One of two | Filter by user UPN |
- Response (200 OK): JSON object containing the filter used and its associations.
Filtered by group:
{
"groupName": "AppPool1",
"associations": [
{ "userUpn": "john@contoso.com", "machineName": "SRV-01" }
]
}
Filtered by user:
{
"userUpn": "john@contoso.com",
"associations": [
{ "groupName": "AppPool1", "machineName": "SRV-01" }
]
}
- Error Responses (400 Bad Request):
Condition | Message |
|---|---|
Both filters provided | Exactly one of 'groupName' or 'userUpn' must be provided. |
Neither filter provided | Exactly one of 'groupName' or 'userUpn' must be provided. |
Invalid UPN format | Invalid UPN format encountered at {upn}. |
Domain not found | Domain with given name does not exist. |
Group not found | Group '{groupName}' not found in domain '{domainName}'. |
User not found | User '{userUpn}' not found in domain '{domainName}'. |
Notes:
- If the group or user has no associations, an empty associations array is returned
- When a UPN belongs to both an Active Directory user and a registered user, the registered user's associations are returned
Send MFA Code
- Description: Starts an MFA check of a TruGrid user from an external portal. Sends the user's current TruGrid MFA code by SMS or email, as at TruGrid sign-in, and returns a requestId for Validate MFA Code. For a user with the Authenticator app nothing is sent; the user reads the code from the app.
- Request URI: https://{api url}/api/public/SendMfaCode?domainName={domainName}
- HTTP Method:
POST - Fields:
Parameter | Type | Required | Description |
|---|---|---|---|
domainName | string | Yes | Domain DNS name (query string) |
upn | string (JSON body) | Yes | User principal name (email format) |
- Request Body Example:
{ "upn": "john@contoso.com" }- Response (200 OK): JSON object describing the code request.
Field | Type | Description |
|---|---|---|
username | string | User UPN |
result | string |
|
requestId | string | Pass to Validate MFA Code. |
mfaType | string |
|
destination | string | Masked phone number or email address the code went to. |
expiresAt | string | UTC time after which the request accepts no code. A request lives as long as TruGrid sign-in accepts an MFA code (5 minutes in production). |
nextCodeAllowedAt | string | UTC time from which the user can get a new code. Also set when a code is requested too soon. |
Result values:
Value | Meaning |
|---|---|
Success. | Code sent by SMS or email; for an Authenticator user nothing is sent and the request is created |
Error. Reason: User does not exist. | No user with this UPN in the domain |
Error. Reason: User is disabled. | The user is disabled or no longer reported by Active Directory |
Error. Reason: MFA is not set up for the user. | The user has not set up MFA |
Error. Reason: MFA is disabled for the user. | MFA is turned off for the user |
Error. Reason: MFA has been reset; the user has to set it up again. | MFA was reset and not set up again yet |
Error. Reason: The user has no phone number for MFA codes. | SMS user without a phone number |
Error. Reason: The user has no email address for MFA codes. | Email user without an email address |
Error. Reason: A new code can be requested in {n} seconds. | Less than 30 seconds since the user's previous code request |
Error. Reason: The code could not be sent. Try again later. | SMS or email delivery failed; no request was created |
Response Example:
{
"username": "john@contoso.com",
"result": "Success.",
"requestId": "6f1c2a7e-3b4d-4e8a-9c21-5d7f0b9e1a34",
"mfaType": "Phone",
"destination": "+* ********67",
"expiresAt": "2026-11-24T16:05:30Z",
"nextCodeAllowedAt": "2026-11-24T16:04:00Z"
}
- Error Responses (400 Bad Request):
Condition | Message |
|---|---|
Missing body or upn | upn is required. |
Invalid UPN format | Invalid UPN format encountered at {upn}. |
Domain not found | Domain with given name does not exist. |
Notes:
- Refusals return 200 OK with "Error. Reason: ..." in result; 400 means the request itself is invalid
- A user can get a new code every 30 seconds at most
- Call Send MFA Code for Authenticator users too: nothing is sent, but Validate MFA Code needs the requestId
- The API never returns the code; only the user sees it
- A requestId can be validated only with the API key that created it
Validate MFA Code
- Description: Checks the MFA code the user entered against the request created by Send MFA Code. A request accepts one correct code and at most 5 wrong codes.
- Request URI: https://{api url}/api/public/ValidateMfaCode?domainName={domainName}
- HTTP Method:
POST - Fields:
Parameter | Type | Required | Description |
|---|---|---|---|
domainName | string | Yes | Domain DNS name (query string) |
upn | string (JSON body) | Yes | User principal name (email format) |
requestId | string, GUID (JSON body) | Yes | requestId returned by Send MFA Code |
code | string (JSON body) | Yes | The 6-digit code the user entered |
Request Body Example:
{
"upn": "john@contoso.com",
"requestId": "6f1c2a7e-3b4d-4e8a-9c21-5d7f0b9e1a34",
"code": "123456"
}
- Response (200 OK): JSON object containing username, requestId and result. On a wrong code, remainingAttempts is also returned.
Result values:
Value | Meaning |
|---|---|
Success. | The code is correct; the request is now used up |
Error. Reason: Invalid code. | Wrong code; remainingAttempts shows how many more wrong codes are accepted |
Error. Reason: Invalid code. Too many wrong codes; request a new code. | The 5th wrong code; the request is closed |
Error. Reason: Too many wrong codes; request a new code. | The request was already closed after 5 wrong codes |
Error. Reason: The code request has already been used. | A correct code was already accepted for this request |
Error. Reason: The code request has expired; request a new code. | expiresAt has passed |
Error. Reason: Code request not found. | Unknown requestId, a request of another user, or one made with another API key |
Error. Reason: The code request is busy; try again. | Several calls on the same request at the same moment |
Error. Reason: User does not exist. | No user with this UPN in the domain |
Error. Reason: MFA is not set up for the user. | The user has not set up MFA |
Error. Reason: MFA is disabled for the user. | MFA is turned off for the user |
Error. Reason: MFA has been reset; the user has to set it up again. | MFA was reset and not set up again yet |
Error. Reason: The user has no phone number for MFA codes. | SMS user without a phone number |
Error. Reason: The user has no email address for MFA codes. | Email user without an email address |
Response Example:
{
"username": "john@contoso.com",
"requestId": "6f1c2a7e-3b4d-4e8a-9c21-5d7f0b9e1a34",
"result": "Error. Reason: Invalid code.",
"remainingAttempts": 4
}
- Error Responses (400 Bad Request):
Condition | Message |
|---|---|
Missing body | Request body is required. |
Missing upn | upn is required. |
Invalid UPN format | Invalid UPN format encountered at {upn}. |
Missing requestId | requestId is required. |
Code is not 6 digits | code must be the 6-digit MFA code. |
Domain not found | Domain with given name does not exist. |
- Notes:
- Every check needs a requestId from Send MFA Code, Authenticator users included
- After a correct code or the 5th wrong code, the user needs a new code from Send MFA Code
- Simultaneous calls on one request are handled one at a time, so a request never accepts more wrong codes than allowed or two correct ones
- The code is never logged
Set License Allocation
- Description: Moves SecureRDP and BitLocker licenses between a service provider and its validated customer domains, within the licenses already purchased. Each listed customer gets exactly the requested number; the service provider's own allocation gives or takes the difference. Nothing is bought or canceled and billing does not change. The request is applied in full or not at all.
- Request URI: https://{api url}/api/public/SetLicenseAllocation?domainName={domainName}
- HTTP Method:
POST - Content-Type: application/json - JSON array, max 100 items:
[
{ "customerDomain": "customer1.com", "secureRdpLicenses": 10, "bitLockerLicenses": 5 },
{ "customerDomain": "customer2.com", "secureRdpLicenses": 3 }
]
Fields:
Field | Type | Required | Description |
|---|---|---|---|
customerDomain | string | Yes | Customer domain DNS name |
secureRdpLicenses | integer | At least one | SecureRDP licenses the customer should hold; leave out to keep the current number |
bitLockerLicenses | integer | At least one | BitLocker licenses the customer should hold; leave out to keep the current number |
- Response (200 OK): Same shape as Get License Allocation: the service provider's pool and the listed customers, in request order, with the numbers after the change.
- Error Responses (400 Bad Request): Nothing is changed when any of these occurs.
Condition | Message |
|---|---|
Empty or null body | Request body must contain at least one allocation. |
More than 100 items | Maximum 100 items per request. |
Item without customerDomain | Every item needs a customerDomain. |
Item without license numbers | Set secureRdpLicenses, bitLockerLicenses or both for: {domains}. |
Negative number | Licenses cannot be negative: {domains}. |
Same customer twice | Duplicate customer domains: {domains}. |
Domain not found | Domain '{domainName}' not found. |
domainName is a customer domain | Licenses of '{domainName}' are allocated by its service provider. |
SecureRDP numbers for a domain with automatic licensing | SecureRDP license allocation is managed automatically for this domain; send bitLockerLicenses only. |
Domain has no validated customer domains | Domain '{domainName}' has no customer domains. |
Not a validated customer, pending validation included | Not validated customer domains of {domainName}: {domains}. |
Subscription not active | The domain's subscription is not active. |
Duplicate license records | Duplicate license records for {domains}; contact TruGrid support. |
Not enough licenses to allocate | Requested {SecureRDP|BitLocker} allocation exceeds the licenses available in the domain's pool: {n} more requested, {m} available. |
Own allocation would go below 0 | The domain's own {SecureRDP|BitLocker} licenses cannot cover the request. |
Notes:
- Giving licenses back is always allowed; taking more needs that many in availableForAllocation (see Get License Allocation)
- A customer can be set below its licenses in use; its newest SecureRDP users then lose their seat at their next connection
- A customer without a BitLocker license record gets one
- A domain with automatic licensing can allocate BitLocker licenses only; its SecureRDP numbers follow its user counts
- A corporate domain has no customer domains, so it is refused; Get License Allocation works for it
- Each change is recorded in TruGrid's activity log
Get License Allocation
- Description: Retrieves the license pool of a service provider or corporate domain, with the same numbers as the portal's Subscription page, and the allocation and usage of its validated customer domains. Pass a list of customer domain names in the request body, or an empty array
[]to return every validated customer. - Request URI: https://{api url}/api/public/GetLicenseAllocation?domainName={domainName}
- HTTP Method:
POST
Fields:
Parameter | Type | Required | Description |
|---|---|---|---|
domainName | string | Yes | Domain DNS name (query string) |
customerDomains | string[] (JSON body) | Yes (may be empty) | List of customer domain DNS names. Send |
Request Body Example:
["customer1.com", "customer2.com"]- Response (200 OK): JSON object containing the domain's own pool and one item per customer.
Field | Description |
|---|---|
sp.domain | The domain in domainName |
sp.subscriptionActive | Whether the subscription is active |
sp.autoLicensing | Whether SecureRDP licenses are allocated automatically; Set License Allocation then accepts BitLocker numbers only |
totalPurchased | The service provider's own licenses plus every validated customer's |
allocatedToCustomers | Licenses allocated to validated customers |
spAllocation | The service provider's own licenses |
spLicensesInUse | Own licenses in use, as on the Subscription page |
freeLicenses | Free SecureRDP licenses of a service provider; 0 for BitLocker and corporate domains |
canceledLicenses | Canceled licenses still usable until the next billing date |
availableForAllocation | Licenses Set License Allocation can still give to customers |
customers[].result |
|
allocated / used / available | Per customer and license type; used counts SecureRDP seats held by users or installed BitLocker agents. |
Customers[].result values:
Value | Meaning |
|---|---|
Success. | Numbers returned |
Error. Reason: Domain is not a customer of {domainName}. | Not a validated customer domain of this domain; a customer still pending validation answers the same |
Response Example:
{
"sp": {
"domain": "provider.com",
"subscriptionActive": true,
"autoLicensing": false,
"secureRdp": {
"totalPurchased": 50,
"allocatedToCustomers": 13,
"spAllocation": 37,
"spLicensesInUse": 20,
"freeLicenses": 0,
"canceledLicenses": 0,
"availableForAllocation": 17
},
"bitLocker": {
"totalPurchased": 10,
"allocatedToCustomers": 5,
"spAllocation": 5,
"spLicensesInUse": 2,
"freeLicenses": 0,
"canceledLicenses": 0,
"availableForAllocation": 3
}
},
"customers": [
{
"customerDomain": "customer1.com",
"result": "Success.",
"secureRdp": { "allocated": 10, "used": 8, "available": 2 },
"bitLocker": { "allocated": 5, "used": 5, "available": 0 }
},
{
"customerDomain": "unknown.com",
"result": "Error. Reason: Domain is not a customer of provider.com.",
"secureRdp": null,
"bitLocker": null
}
]
}
Error Responses (400 Bad Request):
Condition | Message |
|---|---|
Null body | Body cannot be null |
More than 100 names | You cannot pass more than 100 customer domains at one time. |
Body is not a list of names | Wrong input type |
Domain not found | Domain '{domainName}' not found. |
domainName is a customer domain | Licenses of '{domainName}' are allocated by its service provider. |
Updated on: 01/12/2026
Thank you!
