Skip to content

Get user stats

GET
/orgs/{org}/insights/api/user-stats/{user_id}

Get API usage statistics within an organization for a user broken down by the type of access.

Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up.

API method documentation

org
required
string

The organization name. The name is not case sensitive.

user_id
required
string

The ID of the user to query for stats

min_timestamp
required
string

The minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

max_timestamp
string

The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

page
integer
default: 1

The page number of the results to fetch. For more information, see “Using pagination in the REST API.”

per_page
integer
default: 30

The number of results per page (max 100). For more information, see “Using pagination in the REST API.”

direction
string
default: desc
Allowed values: asc desc

The direction to sort the results by.

sort
Array<string>
Allowed values: last_rate_limited_timestamp last_request_timestamp rate_limited_request_count subject_name total_request_count

The property to sort the results by.

actor_name_substring
string

Providing a substring will filter results where the actor name contains the substring. This is a case-insensitive search.

Response

Media typeapplication/json
User Stats

API Insights usage stats for a user

Array<object>
object
actor_type
string
actor_name
string
actor_id
integer format: int64
integration_id
integer format: int64
nullable
oauth_application_id
integer format: int64
nullable
total_request_count
integer
rate_limited_request_count
integer
last_rate_limited_timestamp
string
nullable
last_request_timestamp
string
Examples
Exampledefault
[
{
"actor_type": "oauth_app",
"actor_id": 954453,
"actor_name": "GitHub Actions",
"oauth_application_id": 1245,
"total_request_count": 544665,
"rate_limited_request_count": 13,
"last_request_timestamp": "2024-09-18T15:43:03Z",
"last_rate_limited_timestamp": "2024-09-18T06:30:09Z"
}
]