API ReferenceAdmin: Metrics
Top-of-funnel metrics for the admin dashboard.
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
Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/admin/dashboard/metrics"{ "data": { "metrics": { "users": { "total": 12480, "deltaPct": 4.2 }, "trucks": { "active": 318, "featured": 24, "suspended": 6 }, "orders": { "last7Days": 1842, "grossMinor": 8642300, "currencyCode": "SAR" }, "revenue": { "last7DaysMinor": 99800, "currencyCode": "SAR" }, "moderation": { "reportsOpen": 14, "reviewsPending": 7 } } }, "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" }}Complete role-scoped admin dashboard snapshot. GET
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.
User signup growth over time. GET
Monthly series of `signups` for the last N months. `?months=` defaults to 7 (range 1–24).