SMAO API Documentation
Public APIStatistics

Usage breakdown for a week + assistant filter

Returns the monthly + weekly + last-24h breakdown for the selected week/year window. assistant_id=all aggregates across every assistant; passing a concrete 24-hex ID filters to that assistant's calls only. Supplying an ID that does not belong to the caller's organization returns 404.

All duration fields are integer seconds (billable, with 60s minimum per call), not minutes. hourly_call_counts_last_24h always reflects the 24h window ending at request time — it ignores the week/year filter.

GET
/statistics/usage
AuthorizationBearer <token>

API key in the Authorization: Bearer <key> header. Keys are created in the SMAO dashboard (Settings → API Keys).

In: header

Query Parameters

weekinteger

ISO week number (1–53).

Range1 <= value <= 53
yearinteger
Range2020 <= value <= 2100
assistant_idstring|string

Either the sentinel all or a 24-hex assistant id.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://api.smao.ai/api/v1/statistics/usage?week=17&year=2026&assistant_id=all"
{
  "data": {
    "period": {
      "week": 17,
      "year": 2026
    },
    "assistant_id": "all",
    "monthly": {
      "property1": {
        "call_count": 240,
        "overall_call_seconds": 60000,
        "average_calls_per_day": 12,
        "daily_call_counts": [
          {
            "date": "2026-04-22",
            "count": 12
          }
        ]
      },
      "property2": {
        "call_count": 240,
        "overall_call_seconds": 60000,
        "average_calls_per_day": 12,
        "daily_call_counts": [
          {
            "date": "2026-04-22",
            "count": 12
          }
        ]
      }
    },
    "weekly_call_counts": [
      0
    ],
    "weekly_call_seconds": [
      0
    ],
    "hourly_call_counts_last_24h": [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ]
  }
}
{
  "error": {
    "code": "validation_failed",
    "message": "Validation failed"
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing API key"
  }
}
{
  "error": {
    "code": "subscription_required",
    "message": "This feature is not available in your current subscription. Please upgrade to a higher plan"
  }
}
{
  "error": {
    "code": "forbidden",
    "message": "No permission"
  }
}
{
  "error": {
    "code": "not_found",
    "message": "Assistant not found"
  }
}
{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded"
  }
}
{
  "error": {
    "code": "internal_error",
    "message": "An unexpected error occurred."
  }
}