See api-docs Menu

v1-v3 APIs have been deprecated.

Although these APIs are not shut off yet, all new development with APIs should use the newest version of our API if available, and the version /1 in all other cases. These later versions are based on RESTful principles, secured by OAuth 2.0, and provide JSON messages, search, pagination, sorting, and filtering.

Create Event

Creates an event in your OneLogin account.

For example, let’s say you have an app that uses the OneLogin Delegated Auth API and you want to log all authorization failures for the app. You can use this Create Event API to create/log a OneLogin event for each app authorization failure.

Using this API, you can capture all app-related events in OneLogin and use our event-based reporting to analyze performance and behaviors.

For a description of each element in the Event resource, see Event Resource and Types.

Resource URL

https://api.onelogin.com/api/v1/events.xml

Parameters

Content-Type

required

string

Set to application/xml.

event-type-id

required

integer

See Event Resource and Types.

account-id

integer

*

actor-system

string

*

actor-user-id

integer

Value must exist in OneLogin.

actor-user-name

string

*

app-id

integer

*

app-name

string

*

assuming-acting-user-id

integer

Value must exist in OneLogin.

custom-message

string

*

directory-sync-run-id

integer

*

group-id

integer

*

group-name

string

*

ipaddr

string

*

otp-device-id

integer

*

otp-device-name

string

*

policy-id

integer

*

policy-name

string

*

role-id

integer

*

role-name

string

*

user-id

integer

Value must exist in OneLogin.

user-name

string

*

Sample Response

This request generates no response.

Sample Request

<event>
   <account-id>123456</account-id>
   <actor-user-id>654321</actor-user-id>
   <app-id>11111</app-id>
   <event-type-id>9</event-type-id>
   <policy-id>22222</policy-id>
   <policy-name>app-policy</policy-name>
   <role-id>33333</role-id>
   <role-name>employee-role</role-name>
   <group-id>44444</group-id>
   <group-name>sales-group</group-name>
   <otp-device-id>55555</otp-device-id>
   <otp-device-name>j-mobile</otp-device-name>
   <actor-system>API</actor-system>
   <actor-user-name>jgonsales</actor-user-name>
   <ipaddr>127.0.0.1</ipaddr>
   <user-name>Juniper Gonsales</user-name>
   <app-name>Mobile Sales</app-name>
   <user-id>88888</user-id>
   <custom-message>sales app event</custom-message>
</event>

Sample cURL Request

Try it out with a test account first: Start off with using this cURL request with a test OneLogin account and API key. Once you’ve familiarized yourself with the API’s behavior, switch over to using your production OneLogin account and API key.

Be sure to replace placeholder values surrounded by { } with actual values.

curl -v -u {api_key}:x -X POST -H "Content-Type: application/xml" \
-d '<event>
    <event-type-id>{event_type_id}</event-type-id>
    <account-id>{account_id}</account-id>
    <actor-system>{actor_system}</actor-system>
    <actor-user-id>{actor_id}</actor-user-id>
    <actor-user-name>{actor_name}</actor-user-name>
    <app-id>{app_id}</app-id>
    <app-name>{app_name}</app-name>
    <assuming-acting-user-id>{assuming_acting_user_id}</assuming-acting-user-id>
    <custom-message>{custom_message}</custom-message>
    <directory-sync-run-id>{directory_sync_run_id}</directory-sync-run-id>
    <group-id>{group_id}</group-id>
    <group-name>{group_name}</group-name>
    <ipaddr>{ipaddr}</ipaddr>
    <otp-device-id>{otp_device_id}</otp-device-id>
    <otp-device-name>{otp_device_name}</otp-device-name>
    <policy-id>{policy_id}</policy-id>
    <policy-name>{policy_name}</policy-name>
    <role-id>{role_id}</role-id>
    <role-name>{role_name}</role-name>
    <user-id>{user_id}</user-id>
    <user-name>{username}</user-name>
</event>' \
https://api.onelogin.com/api/v1/events.xml

Postman Collection

Run In Postman

    Clicking Run in Postman button navigates to the page where you can fork the collection to your workspace. Forking the collection into your workspace will enable you to contribute to the source collection using pull requests. You can also view the collection in a public workspace if you like and even import a copy of the collection using the links present on the screen.

Have a Question?

Found a problem or a bug? Submit a support ticket.

Looking for walkthroughs or how-to guides on OneLogin's user and admin features? Check out the documentation in our Knowledge Base.

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