API reference
Account
Your WeGuard account: plan, license usage, enabled platforms and the labels of the device tag slots.
Every API key belongs to exactly one account, so this endpoint always returns the account that owns the calling key. If you only need to know which account a key belongs to, call GET /v1/me. It needs no scope.
The account object
idstring- Account id.
objectstring- Always
account. namestringnullable- Company name of the account.
statestringnullable- Subscription state.
nullfor internal test accounts and states not listed here.One oflivetrialdemo planstringnullable- Name of the feature plan as shown in the console, for example
Enterprise. This is free text, not a fixed set.nullif no plan is assigned. licensesobject- License usage.
licenses.purchasedintegernullable- Number of device licenses purchased.
nullwhen no purchased count is recorded for the account. licenses.provisionedDevicesintegernullable- Number of enrolled devices. This counter is refreshed periodically, so it is not a live count.
licenses.unprovisionedDevicesintegernullable- Number of device records created but not yet enrolled. This counter is refreshed periodically, so it is not a live count.
licenseValidFromtimestampnullable- Start of the license period.
licenseValidUntiltimestampnullable- End of the license period.
trialEndsAttimestampnullable- End of the trial period.
nullunlessstateistrial. platformsarray of strings- Device platforms enabled for the account.
iosmeans Apple device management is enabled, which also covers Macs (macos) and Apple TVs (tvos).Each item is one ofandroidiosmacostvoswindows mfaRequiredbooleantruewhen multi-factor sign-in is enforced for the account’s console users.tagLabelsobject- The names the account gave its device tag slots in the console, for example
{"tag6": "Region"}. Use them to label the values in a device’stags. Admins can label slotstag6totag9in the console. Slots without a label, or still showing the console’s “Tag N” placeholder, are omitted, so the object can be empty. createdAttimestamp- When the account was created.
{
"id": "5f1d7c0e9b1e8a3f2c4d6e8a",
"object": "account",
"name": "Acme Logistics",
"state": "live",
"plan": "Enterprise",
"licenses": {
"purchased": 500,
"provisionedDevices": 312,
"unprovisionedDevices": 14
},
"licenseValidFrom": "2026-01-01T00:00:00Z",
"licenseValidUntil": "2026-12-31T23:59:59Z",
"trialEndsAt": null,
"platforms": [
"android",
"ios",
"windows"
],
"mfaRequired": true,
"tagLabels": {
"tag6": "Region",
"tag7": "Cost centre"
},
"createdAt": "2024-05-02T10:11:12Z"
}Retrieve the account
/ v1/ accountReturns the account that owns the API key. This endpoint takes no parameters.
Example request
curl https://api-gw.weguard.ai/core/v1/account \
-H "Authorization: Bearer $WEGUARD_API_KEY"const response = await fetch("https://api-gw.weguard.ai/core/v1/account", {
headers: { Authorization: `Bearer ${process.env.WEGUARD_API_KEY}` },
});
const body = await response.json();
if (!response.ok) {
throw new Error(`${body.code}: ${body.detail} (requestId ${body.requestId})`);
}
console.log(body);import os
import requests
response = requests.get(
"https://api-gw.weguard.ai/core/v1/account",
headers={"Authorization": f"Bearer {os.environ['WEGUARD_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())Response
Returns an account object.
{
"id": "5f1d7c0e9b1e8a3f2c4d6e8a",
"object": "account",
"name": "Acme Logistics",
"state": "live",
"plan": "Enterprise",
"licenses": {
"purchased": 500,
"provisionedDevices": 312,
"unprovisionedDevices": 14
},
"licenseValidFrom": "2026-01-01T00:00:00Z",
"licenseValidUntil": "2026-12-31T23:59:59Z",
"trialEndsAt": null,
"platforms": [
"android",
"ios",
"windows"
],
"mfaRequired": true,
"tagLabels": {
"tag6": "Region",
"tag7": "Cost centre"
},
"createdAt": "2024-05-02T10:11:12Z"
}Errors
The request includes a query parameter. This endpoint takes none.
The key lacks
account:read.
Common errors
Besides the errors listed for each endpoint, any request can fail authentication, exceed the rate limit, ask for a format other than JSON, or fail with a server error. See Errors for the response format and retry guidance.
The request has no
Authorizationheader.The
Authorizationheader does not use theBearerscheme, or has no key after it. TheWWW-Authenticateheader carrieserror="invalid_request".The key is malformed, does not exist, or its secret does not match. The
WWW-Authenticateheader carrieserror="invalid_token".The key is past its
expiresAt.An account admin revoked the key. Revocation takes effect immediately and cannot be undone.
The WeGuard account that owns the key has been deleted or disabled.
The
Acceptheader excludes JSON.The key has used up its request budget. See Rate limits.
An unexpected error occurred on our side.
A service WeGuard depends on is temporarily unavailable, or reading the data took longer than the time WeGuard allows for it. This can also happen while your key is being checked, so it can be returned before authentication completes. The response carries
Retry-After.