See api-docs Menu

Get Event by ID

For details about each element in the Event resource and a list of event type IDs, see Event Resource and Types.

Resource URL

https://api.<us_or_eu>.onelogin.com/api/1/events/:id

Header Parameter

Authorization

required

string

Set to bearer:<access_token>.

Set <access_token> to the access token you generated using the Generate Token API.

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: Read Users, Manage users, Read All, or Manage All.

Resource Parameter

id

required

string

Set to the id of the event that you want to return. If you don’t know the event’s id, use the Get Events API call to return all events and their id values.

Sample Response

{
    "status": {
        "error": false,
        "code": 200,
        "type": "success",
        "message": "Success"
    },
    "data": [
        {
            "id": 123456,
            "created_at": "2014-02-18T02:34:15.626Z",
            "account_id": 1,
            "user_id": 654321,
            "event_type_id": 8,
            "notes": "Initiated by OneLogin via SAML",
            "ipaddr": "123.456.789.0",
            "actor_user_id": 987654,
            "assuming_acting_user_id": null,
            "role_id": null,
            "app_id": 11111,
            "group_id": null,
            "otp_device_id": null,
            "policy_id": null,
            "actor_system": "",
            "custom_message": null,
            "role_name": null,
            "app_name": "AppWonder",
            "group_name": null,
            "actor_user_name": "Santiago Cuong",
            "user_name": "Santiago Cuong",
            "policy_name": null,
            "otp_device_name": null,
            "operation_name": null,
            "directory_sync_run_id": null,
            "directory_id": null,
            "resolution": null,
            "client_id": null,
            "resource_type_id": null,
            "error_description": null
        }
    ]
}

Typically, the following error means that your Authorization header value is missing or incorrectly formatted. The Authorization header value should use this format: bearer:<access_token.

{
    "status": {
        "error": true,
        "code": 400,
        "type": "bad request",
        "message": "Authorization Information is incorrect"
    }
}

{
    "status": {
        "error": true,
        "code": 400,
        "type": "bad request",
        "message": {
            "attribute": "id",
            "description": "ID is incorrect"
        }
    }
}

Typically, this error means that your access token value is invalid.

{
    "status": {
        "error": true,
        "code": 401,
        "type": "Unauthorized",
        "message": "Authentication Failure"
    }
}
{
    "status": {
        "error": true,
        "code": 404,
        "type": "not found",
        "message": "Event for id 111111111 was not found"
    }
}

Postman Collection

Be sure to set Postman-specific environment variables indicated by {{ }}.

Download for the Events API

Sample cURL Request

Replace sample values indicated by < > with your actual values.

curl 'https://api.<us_or_eu>.onelogin.com/api/1/events/<id>' \
-X GET \
-H "Authorization: bearer:<access_token>"

Have a Question?

Have a how-to question? Seeing a weird error? Ask us about it on StackOverflow.

Found a bug? Submit a support ticket.

Have a product idea or request? Share it with us in our Ideas Portal.