API ReferenceAnalytics
Get Login Metrics
Return aggregated login metrics for a time range.
Endpoint
GET /v1/analytics:getLoginMetricsBase URL: https://<Domain id="api"/>
Authentication: Bearer token with analytics:read scope.
Returns per-bucket login counts, success rate, and unique identity count for the specified time range. Buckets are determined by granularity.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
start_time | RFC 3339 timestamp | Yes | Start of the range (inclusive) |
end_time | RFC 3339 timestamp | Yes | End of the range (exclusive) |
organization_id | string | No | Scope to a single org |
granularity | enum | No | TIME_GRANULARITY_HOUR / _DAY / _WEEK / _MONTH |
Example
package main
import (
"context"
"encoding/json"
"net/http"
"net/url"
"os
import os
from datetime import datetime, timedelta, timezone
import httpx
params = {
"start_time": (datetime.now(timezone.utc) - timedelta(days=7)).isoformat(),
curl -G "https://api-id.avnology.net/v1/analytics:getLoginMetrics" \
-H "Authorization: Bearer $AVNOLOGY_API_KEY" \
--data-urlencode "start_time=2026-04-10T00:00:00Z" \
--data-urlencode "end_time=2026-04-17T00:00:00Z" \
--data-urlencode "granularity=TIME_GRANULARITY_DAY"package main
import (
"context"
"encoding/json"
"net/http"
"net/url"
"os
import os
from datetime import datetime, timedelta, timezone
import httpx
params = {
"start_time": (datetime.now(timezone.utc) - timedelta(days=7)).isoformat(),
curl -G "https://api-id.avnology.net/v1/analytics:getLoginMetrics" \
-H "Authorization: Bearer $AVNOLOGY_API_KEY" \
--data-urlencode "start_time=2026-04-10T00:00:00Z" \
--data-urlencode "end_time=2026-04-17T00:00:00Z" \
--data-urlencode "granularity=TIME_GRANULARITY_DAY"package main
import (
"context"
"encoding/json"
"net/http"
"net/url"
"os
import os
from datetime import datetime, timedelta, timezone
import httpx
params = {
"start_time": (datetime.now(timezone.utc) - timedelta(days=7)).isoformat(),
curl -G "https://api-id.avnology.net/v1/analytics:getLoginMetrics" \
-H "Authorization: Bearer $AVNOLOGY_API_KEY" \
--data-urlencode "start_time=2026-04-10T00:00:00Z" \
--data-urlencode "end_time=2026-04-17T00:00:00Z" \
--data-urlencode "granularity=TIME_GRANULARITY_DAY"package main
import (
"context"
"encoding/json"
"net/http"
"net/url"
"os
import os
from datetime import datetime, timedelta, timezone
import httpx
params = {
"start_time": (datetime.now(timezone.utc) - timedelta(days=7)).isoformat(),
Response (200 OK)
{
"total_logins": 12483,
"successful_logins": 12019,
"failed_logins": 464,
"success_rate": 0.9628,
"unique_identities": 3127,
"buckets": [
{ "timestamp": "2026-04-10T00:00:00Z", "count": 1782, "success_rate":
Errors
| Status | Code | Description |
|---|---|---|
| 400 | AVNOLOGY_AUTH_902 | start_time or end_time invalid / missing |
| 403 | AVNOLOGY_AUTH_012 | Token missing analytics:read scope |
| 429 | AVNOLOGY_AUTH_021 | Rate limit exceeded |