Use this API to search and page through the events in your OneLogin account. Events are returned newest first.
The list can be filtered by event type, user, app, role, group, directory, time window, IP address, risk score, and free text. See the Query Parameters section for the full set of filters.
This call returns up to 100 events per page (50 by default).
Fast pagination at any depth
This endpoint uses cursor-based (keyset) pagination. Each page is read directly from the position of the previous page’s
next_cursor, so the thousandth page costs the same as the first. The v1 endpoint (/api/1/events) has to read and discard every earlier event on each page, which makes deep pagination progressively slower and can time out on large accounts. If you page through events in bulk, use this endpoint.
For details about each element in the response, see Event Resource.
Resource URL
https://<subdomain>.onelogin.com/api/2/eventsHeader Parameters
Authorization required string | Set to Set The access token must have been generated using an API credential pair created using the scope required to call this API. This API can be called using any one of the following scopes: |
Query Parameters
All parameters are optional. Combine any number of filters with &; an event must match every filter you supply.
Pagination
limit integer | Number of events to return per page. Default |
after_cursor string | Set to the |
Filters
event_type_id integer | Return only events of this type. See List Event Types for the list of IDs. To match several types, pass a comma-separated list ( |
user_id integer | Return only events where this user was acted upon. |
app_id integer | Return only events involving this app. |
role_id integer | Return only events involving this role. |
group_id integer | Return only events involving this group. |
directory_id integer | Return only events involving this directory. |
resource_type_id integer | Return only events associated with this resource type. |
client_id string | Return only events generated by API calls made with this API credential |
actor_system string | Return only events triggered by this system rather than by a user, e.g. |
resolution integer | Return only exception events with this resolution: |
since string | An ISO8601 timestamp. Return only events created at or after this time, e.g. |
until string | An ISO8601 timestamp. Return only events created at or before this time. When both |
ip string | An IPv4 or IPv6 address. Return only events whose |
risk_score_min integer | Return only events with a |
risk_score_max integer | Return only events with a |
search string | Free-text search, 2 to 255 characters. Returns events where the text appears (case-insensitively) anywhere in |
Examples
The following examples illustrate how to use the query parameters to return subsets of events:
- Return events whose
event_type_idvalue equals5(user logged into OneLogin):https://<subdomain>.onelogin.com/api/2/events?event_type_id=5 - Return events whose
event_type_idvalue is either5or6:https://<subdomain>.onelogin.com/api/2/events?event_type_id=5,6 - Return unresolved exception events:
https://<subdomain>.onelogin.com/api/2/events?resolution=0 - Return the 100 most recent events for one user:
https://<subdomain>.onelogin.com/api/2/events?user_id=12345678&limit=100 - Return events created within a window of time using the
sinceanduntilparameters:https://<subdomain>.onelogin.com/api/2/events?since=2026-09-01T00:00:00Z&until=2026-09-02T00:00:00Z - Return everything that happened from a given IP address:
https://<subdomain>.onelogin.com/api/2/events?ip=203.0.113.10 - Return high-risk login events:
https://<subdomain>.onelogin.com/api/2/events?event_type_id=5&risk_score_min=70 - Return events mentioning a word or a name:
https://<subdomain>.onelogin.com/api/2/events?search=provisioning - Return the next page of a previous query. Repeat the original filters and add the
next_cursorvalue from the previous response:https://<subdomain>.onelogin.com/api/2/events?event_type_id=5&after_cursor=OTk5OTk5OTk5fDE0MTg5NTQ1NTk
Paging through results
Each response includes a pagination object:
next_cursor string or null | Opaque cursor for the next page. Pass it as |
has_more boolean |
|
size integer | Number of events in this page's |
limit integer | The |
To walk the full result set, keep requesting with after_cursor set to the previous next_cursor until has_more is false. There is no before_cursor; to start over, drop after_cursor. Because results are ordered newest first, events created while you are paging appear before your starting point and are not included in the walk. To pick up only what is new on the next run, record the created_at of the first event you saw and pass it as since. Because since is inclusive, that boundary event (and any others with the same timestamp) is returned again, so de-duplicate by id.
Sample Responses
- 200 OK
- 400 Bad Request
- 401 Unauthorized
Important: The user_name and actor_user_name elements displayed in the response refer to the first and last name of the relevant user, not to their username in OneLogin. If their first and last name user attributes are empty, your results will instead return the user’s email address.
{
"data": [
{
"id": 999999999,
"created_at": "2026-09-15T03:38:19.899Z",
"account_id": 55555,
"user_id": 77777777,
"event_type_id": 5,
"notes": "Authentication method: password.",
"ipaddr": "22.222.22.222",
"actor_user_id": 77777777,
"assuming_acting_user_id": null,
"role_id": null,
"app_id": null,
"group_id": null,
"otp_device_id": null,
"policy_id": null,
"actor_system": "",
"custom_message": null,
"role_name": null,
"app_name": null,
"group_name": null,
"actor_user_name": "Jimena Xie",
"user_name": "Jimena Xie",
"policy_name": null,
"otp_device_name": null,
"directory_sync_run_id": null,
"directory_id": null,
"resolution": null,
"client_id": null,
"resource_type_id": null,
"error_description": null,
"proxy_ip": null,
"risk_score": 48,
"risk_reasons": "Infrequent access from 73.68.253.46 (13%)\nLow trust for session (15%)....",
"risk_cookie_id": "1cc3xx9-6a0d-4643-8111-b5xx",
"browser_fingerprint": "71fxxxxxxxxxxxbc184748e5a6b"
},
...
{
"id": 888888888,
"created_at": "2026-09-15T02:02:39.276Z",
"account_id": 55555,
"user_id": 88888888,
"event_type_id": 13,
"notes": null,
"ipaddr": "11.111.11.111",
"actor_user_id": 7777777,
"assuming_acting_user_id": null,
"role_id": null,
"app_id": null,
"group_id": null,
"otp_device_id": null,
"policy_id": null,
"actor_system": "",
"custom_message": null,
"role_name": null,
"app_name": null,
"group_name": null,
"actor_user_name": "Xavier Wong",
"user_name": "Xavier Wong",
"policy_name": null,
"otp_device_name": null,
"directory_sync_run_id": null,
"directory_id": null,
"resolution": null,
"client_id": null,
"resource_type_id": null,
"error_description": null,
"proxy_ip": null,
"risk_score": null,
"risk_reasons": null,
"risk_cookie_id": null,
"browser_fingerprint": null
}
],
"pagination": {
"next_cursor": "ODg4ODg4ODg4fDE0MTg5NjAyOTk",
"has_more": true,
"size": 50,
"limit": 50
}
}Returned when a query parameter fails validation. The message says which one and why, for example a non-numeric ID, a since later than until, a date window over 365 days, a search term under 2 characters, or an after_cursor that was not issued by this API.
{
"name": "BadRequestError",
"message": "Invalid user_id format: abc",
"statusCode": 400
}Typically, this error means that your access token value is invalid, has expired, or was generated with a credential whose scope does not include reading events.
{
"name": "UnauthorizedError",
"message": "Authentication required",
"statusCode": 401
}Sample Code
cURL
Replace sample values indicated by < > with your actual values.
List Events
curl 'https://<subdomain>.onelogin.com/api/2/events' \
-X GET \
-H "Authorization: bearer <access_token>"List Events Created within a Date/Time Range
curl 'https://<subdomain>.onelogin.com/api/2/events?since=<since>&until=<until>' \
-X GET \
-H "Authorization: bearer <access_token>"List Events by Event Type ID
curl 'https://<subdomain>.onelogin.com/api/2/events?event_type_id=<event_type_id>' \
-X GET \
-H "Authorization: bearer <access_token>"Fetch the Next Page
curl 'https://<subdomain>.onelogin.com/api/2/events?event_type_id=<event_type_id>&after_cursor=<next_cursor>' \
-X GET \
-H "Authorization: bearer <access_token>"Walk Every Event for a User
cursor=""
while :; do
page=$(curl -s "https://<subdomain>.onelogin.com/api/2/events?user_id=<user_id>&limit=100${cursor:+&after_cursor=$cursor}" \
-H "Authorization: bearer <access_token>")
echo "$page" | jq -c '.data[]'
[ "$(echo "$page" | jq -r '.pagination.has_more')" = "true" ] || break
cursor=$(echo "$page" | jq -r '.pagination.next_cursor')
doneHave a Question?
Found a problem or a bug? Submit a support ticket.
Looking for walkthroughs or how-to guides? Check out our Knowledge Base.
Have a product idea or request? Share it in our Ideas Portal.