API ReferenceAdmin: Metrics
Complete role-scoped admin dashboard snapshot.
Returns the same dashboard view shape assembled for `/admin/dashboard`, scoped to the caller's admin role. `?days=` defaults to 30 and accepts only 7, 30, or 90.
Authorization
bearerAuth AuthorizationBearer <token>
AdonisJS access-token guard (middleware.auth({ guards: ["api"] })). Send Authorization: Bearer <oat_…> (issued by /auth/register, /auth/login, /auth/social/{google,apple}, or /auth/guest).
In: header
Query Parameters
days?number
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/admin/dashboard/snapshot"{ "data": { "days": 30, "scope": [ "users", "trucks", "jobs", "marketplace", "reviews", "reports", "support", "orders", "revenue" ], "assembledAt": "2026-05-20T11:08:21.000Z", "metrics": { "totalUsers": 12480, "totalTrucks": 318, "activeTrucks": 304, "activeMarketplaceListings": 86, "activeJobs": 42, "pendingReports": 14, "totalReviews": 7320, "newRegistrationsLast30Days": 612 }, "userGrowth": [ { "day": "2026-05-20", "count": 41 } ], "orderVolume": [ { "day": "2026-05-20", "status": "paid", "count": 24 } ], "revenue": [ { "day": "2026-05-20", "currencyCode": "SAR", "grossMinor": 8642300 } ] }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}{ "error": { "code": "AUTH_REQUIRED", "message": "Authentication is required to access this resource." }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}{ "error": { "code": "FORBIDDEN", "message": "You are not allowed to perform this action." }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}{ "error": { "code": "VALIDATION_ERROR", "message": "One or more fields are invalid.", "fields": [ { "path": "email", "rule": "email", "message": "Must be a valid email address." } ] }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}