Skip to main content
Usage

List Identity Usage

GET /api/v1/forward/usage/identities Query Identity-level Usage summaries and session details for the current account within a specified time window.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT or SAT>

Query parameters

ParameterTypeRequiredDefaultDescription
start_timeintegerYes-Unix millisecond timestamp. Start of the time window (inclusive).
end_timeintegerYes-Unix millisecond timestamp. End of the time window (exclusive). Must be greater than start_time and span no more than 31 days.
identity_idstringNo-Filter by a single Forward Identity ID.
identity_idsstring/string[]No-Filter by multiple Forward Identity IDs. Supports comma-separated values or repeated query parameters.
template_idstringNo-Filter by a single Forward Template ID.
template_idsstring/string[]No-Filter by multiple Forward Template IDs. Supports comma-separated values or repeated query parameters.

Example request

curl -s -X GET 'https://api.qoder.com.cn/api/v1/forward/usage/identities?start_time=1783267200000&end_time=1784476800000&identity_id=idn_123' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN"

Example response

HTTP 200 OK
{
  "type": "identity_usage.list",
  "start_time": 1783267200000,
  "end_time": 1784476800000,
  "data": [
    {
      "type": "identity_usage",
      "identity_id": "idn_123",
      "session_count": 5,
      "duration_seconds": 420,
      "credits": 1.23,
      "session_ids": ["sess_1", "sess_2"]
    }
  ]
}

Response fields

FieldTypeDescription
typestringAlways identity_usage.list.
start_timeintegerRequested time window start.
end_timeintegerRequested time window end.
dataarrayUsage list grouped by Identity.
data[].typestringAlways identity_usage.
data[].identity_idstringForward Identity ID.
data[].session_countintegerNumber of Forward sessions.
data[].duration_secondsintegerForward session runtime aggregated and converted to seconds.
data[].creditsnumberCredit consumption aggregated by session, rounded to two decimal places. null when Credit query is unavailable.
data[].session_idsstring[]Forward session ID list for this Identity.

Error codes

HTTPTypeCodeTrigger
400invalid_request_error-Missing start_time/end_time, invalid time format, end_time <= start_time, or time span exceeds 31 days.
401authentication_errorauthentication_requiredThe PAT is invalid or expired.
500api_error-The Forward session query or usage metrics query failed.