# OneLogin

> Manage OneLogin users and their roles: create, update, lock, sign out and delete users, assign roles and apps, and read apps, groups and the activity log.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/onelogin

## Actions

### Add users to role

Give a role to one or more users.

**Inputs**

- Role (`role_id`, number, required): The role. At least 1.
- Users (`user_ids`, list, required): The users.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": 1
  }
}
```

### Assign roles to user

Give a user one or more roles, and with them the roles' apps.

**Inputs**

- User (`onelogin_user_id`, number, required): The OneLogin user. At least 1.
- Roles (`role_ids`, list, required): The roles.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": 1
  }
}
```

### Create role

Create a role, optionally with apps, users and administrators.

**Inputs**

- Name (`name`, text, required): The role's name.
- Apps (`apps`, list): Apps the role gives access to.
- Users (`users`, list): Users to give the role.
- Administrators (`admins`, list): Users who may manage the role.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": 1
  }
}
```

### Create user

Add a user to OneLogin. Give an email address, a username, or both.

**Inputs**

- Email (`email`, text): The user's email address.
- Username (`username`, text): The user's username.
- First name (`firstname`, text): The user's first name.
- Last name (`lastname`, text): The user's last name.
- Job title (`title`, text): The user's job title.
- Department (`department`, text): The user's department.
- Company (`company`, text): The user's company.
- Phone (`phone`, text): The user's phone number, in E.164 format such as +14155550100.
- Comment (`comment`, text): Free text about the user.
- External ID (`external_id`, text): The user's ID in another directory or system.
- Manager (`manager_user_id`, text): The OneLogin user ID of the user's manager.
- Custom attributes (`custom_attributes`, object): Values for the account's custom user fields, by their short names, such as {"employee_number": "1042"}.
- State (`state`, number): Whether the user is approved to use OneLogin. One of: `0` (Unapproved), `1` (Approved), `2` (Rejected), `3` (Unlicensed).
- Status (`status`, number): The user's status: active, suspended, locked and so on. One of: `0` (Unactivated), `1` (Active), `2` (Suspended), `3` (Locked), `4` (Password expired), `5` (Awaiting password reset), `7` (Password pending), `8` (Security questions required).
- Apply mappings (`mappings`, text): When OneLogin applies its user mappings to this change. OneLogin applies them in the background when this is empty. One of: `async` (Apply in the background), `sync` (Apply before answering), `disabled` (Don't apply).

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "activated_at": "example",
    "comment": "example",
    "company": "example",
    "created_at": "example",
    "custom_attributes": {},
    "department": "example",
    "directory_id": 1,
    "distinguished_name": "example",
    "email": "example",
    "external_id": "example",
    "firstname": "example",
    "group_id": 1,
    "id": 1,
    "invalid_login_attempts": 1,
    "invitation_sent_at": "example",
    "last_login": "example",
    "lastname": "example",
    "locked_until": "example",
    "manager_ad_id": "example",
    "manager_user_id": "example",
    "member_of": "example",
    "password_changed_at": "example",
    "phone": "example",
    "preferred_locale_code": "example",
    "role_ids": [
      1
    ],
    "samaccountname": "example",
    "state": 1,
    "status": 1,
    "title": "example",
    "trusted_idp_id": 1,
    "updated_at": "example",
    "username": "example",
    "userprincipalname": "example"
  }
}
```

### Delete role

Delete a role. Its users lose the apps it gave them.

**Inputs**

- Role (`role_id`, number, required): The role. At least 1.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": 1
  }
}
```

### Delete user

Delete a user from OneLogin. This can't be undone.

**Inputs**

- User (`onelogin_user_id`, number, required): The OneLogin user. At least 1.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": 1
  }
}
```

### Get app

Get an app: its connector, sign-in method, policy and roles.

**Inputs**

- App (`app_id`, number, required): The app. At least 1.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "allow_assumed_signin": true,
    "auth_method": 1,
    "connector_id": 1,
    "created_at": "example",
    "description": "example",
    "icon_url": "example",
    "id": 1,
    "name": "example",
    "notes": "example",
    "policy_id": 1,
    "role_ids": [
      1
    ],
    "tab_id": 1,
    "updated_at": "example",
    "visible": true
  }
}
```

### Get role

Get a role, with the IDs of its apps, users and administrators.

**Inputs**

- Role (`role_id`, number, required): The role. At least 1.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "admins": [
      1
    ],
    "apps": [
      1
    ],
    "id": 1,
    "name": "example",
    "users": [
      1
    ]
  }
}
```

### Get user

Get a user: their profile, status, roles, last sign-in and custom attributes.

**Inputs**

- User (`onelogin_user_id`, number, required): The OneLogin user. At least 1.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "activated_at": "example",
    "comment": "example",
    "company": "example",
    "created_at": "example",
    "custom_attributes": {},
    "department": "example",
    "directory_id": 1,
    "distinguished_name": "example",
    "email": "example",
    "external_id": "example",
    "firstname": "example",
    "group_id": 1,
    "id": 1,
    "invalid_login_attempts": 1,
    "invitation_sent_at": "example",
    "last_login": "example",
    "lastname": "example",
    "locked_until": "example",
    "manager_ad_id": "example",
    "manager_user_id": "example",
    "member_of": "example",
    "password_changed_at": "example",
    "phone": "example",
    "preferred_locale_code": "example",
    "role_ids": [
      1
    ],
    "samaccountname": "example",
    "state": 1,
    "status": 1,
    "title": "example",
    "trusted_idp_id": 1,
    "updated_at": "example",
    "username": "example",
    "userprincipalname": "example"
  }
}
```

### List app users

List the users who have access to an app.

**Inputs**

- App (`app_id`, number, required): The app. At least 1.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): How many records to return, up to 100. From 1 to 100.

**Outputs**

- `data` (list): The response from OneLogin.

**Example output**

```json
{
  "data": [
    {
      "email": "example",
      "firstname": "example",
      "id": 1,
      "lastname": "example",
      "username": "example"
    }
  ]
}
```

### List apps

List the apps set up in the account.

**Inputs**

- Name (`name`, text): Only apps whose name contains this.
- Connector ID (`connector_id`, number): Only apps built on this connector. At least 1.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): How many records to return, up to 100. From 1 to 100.

**Outputs**

- `data` (list): The response from OneLogin.

**Example output**

```json
{
  "data": [
    {
      "allow_assumed_signin": true,
      "auth_method": 1,
      "connector_id": 1,
      "created_at": "example",
      "description": "example",
      "icon_url": "example",
      "id": 1,
      "name": "example",
      "notes": "example",
      "policy_id": 1,
      "role_ids": [
        1
      ],
      "tab_id": 1,
      "updated_at": "example",
      "visible": true
    }
  ]
}
```

### List event types

List every kind of event OneLogin records, with its ID and description.

**Inputs**: None.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "description": "example",
        "id": 1,
        "name": "example"
      }
    ],
    "status": {
      "code": 1,
      "error": true,
      "message": "example",
      "type": "example"
    }
  }
}
```

### List events

List events from the account's activity log, newest first: sign-ins, password changes, app access and admin changes.

**Inputs**

- Event types (`event_type_id`, list): Only events of these types.
- User (`onelogin_user_id`, number): Only events about this user. At least 1.
- After (`since`, date and time): Only events after this time.
- Before (`until`, date and time): Only events before this time.
- Limit (`limit`, number): How many events to return, up to 50. From 1 to 50.
- Next page cursor (`after_cursor`, text): The cursor from a previous page's pagination, to read the next page.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "account_id": 1,
        "actor_system": "example",
        "actor_user_id": 1,
        "actor_user_name": "example",
        "app_id": 1,
        "app_name": "example",
        "created_at": "example",
        "custom_message": "example",
        "directory_id": 1,
        "error_description": "example",
        "event_type_id": 1,
        "group_id": 1,
        "group_name": "example",
        "id": 1,
        "ipaddr": "example",
        "notes": "example",
        "otp_device_id": 1,
        "otp_device_name": "example",
        "policy_id": 1,
        "policy_name": "example",
        "risk_reasons": "example",
        "risk_score": 1,
        "role_id": 1,
        "role_name": "example",
        "user_id": 1,
        "user_name": "example"
      }
    ],
    "pagination": {
      "after_cursor": "example",
      "before_cursor": "example",
      "next_link": "example",
      "previous_link": "example"
    },
    "status": {
      "code": 1,
      "error": true,
      "message": "example",
      "type": "example"
    }
  }
}
```

### List groups

List the account's groups, which set the security policy for their users.

**Inputs**: None.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "id": 1,
        "name": "example",
        "reference": "example"
      }
    ],
    "status": {
      "code": 1,
      "error": true,
      "message": "example",
      "type": "example"
    }
  }
}
```

### List role users

List the users who have a role.

**Inputs**

- Role (`role_id`, number, required): The role. At least 1.
- Search (`name`, text): Only users whose name, username or email contains this.
- Include users without the role (`include_unassigned`, true/false): Also list users who don't have the role.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): How many records to return, up to 100. From 1 to 100.

**Outputs**

- `data` (list): The response from OneLogin.

**Example output**

```json
{
  "data": [
    {
      "assigned": true,
      "email": "example",
      "id": 1,
      "name": "example",
      "username": "example"
    }
  ]
}
```

### List roles

List the account's roles, filtered by name or by an app they include.

**Inputs**

- Name (`name`, text): Only roles with this name.
- App (`app_id`, number): Only roles that include this app. At least 1.
- App name (`app_name`, text): Only roles that include an app with this name.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): How many records to return, up to 100. From 1 to 100.

**Outputs**

- `data` (list): The response from OneLogin.

**Example output**

```json
{
  "data": [
    {
      "admins": [
        1
      ],
      "apps": [
        1
      ],
      "id": 1,
      "name": "example",
      "users": [
        1
      ]
    }
  ]
}
```

### List user's apps

List the apps a user can use, with each one's provisioning state.

**Inputs**

- User (`onelogin_user_id`, number, required): The OneLogin user. At least 1.
- Include hidden apps (`ignore_visibility`, true/false): Include apps hidden from the user's portal.

**Outputs**

- `data` (list): The response from OneLogin.

**Example output**

```json
{
  "data": [
    {
      "extension": true,
      "icon_url": "example",
      "id": 1,
      "login_id": 1,
      "name": "example",
      "provisioning_enabled": true,
      "provisioning_state": "example",
      "provisioning_status": "example"
    }
  ]
}
```

### List users

List the account's users, filtered by name, email, when they were created or updated, or when they last signed in.

**Inputs**

- Email (`email`, text): Only the user with this email address.
- Username (`username`, text): Only the user with this username.
- First name (`firstname`, text): Only users with this first name.
- Last name (`lastname`, text): Only users with this last name.
- External ID (`external_id`, text): Only the user with this external ID.
- Directory ID (`directory_id`, number): Only users from this directory. At least 1.
- Created after (`created_since`, date and time): Only users created after this time.
- Created before (`created_until`, date and time): Only users created before this time.
- Updated after (`updated_since`, date and time): Only users updated after this time.
- Updated before (`updated_until`, date and time): Only users updated before this time.
- Last signed in after (`last_login_since`, date and time): Only users who last signed in after this time.
- Last signed in before (`last_login_until`, date and time): Only users who last signed in before this time.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): How many records to return, up to 100. From 1 to 100.

**Outputs**

- `data` (list): The response from OneLogin.

**Example output**

```json
{
  "data": [
    {
      "activated_at": "example",
      "comment": "example",
      "company": "example",
      "created_at": "example",
      "custom_attributes": {},
      "department": "example",
      "directory_id": 1,
      "distinguished_name": "example",
      "email": "example",
      "external_id": "example",
      "firstname": "example",
      "group_id": 1,
      "id": 1,
      "invalid_login_attempts": 1,
      "invitation_sent_at": "example",
      "last_login": "example",
      "lastname": "example",
      "locked_until": "example",
      "manager_ad_id": "example",
      "manager_user_id": "example",
      "member_of": "example",
      "password_changed_at": "example",
      "phone": "example",
      "preferred_locale_code": "example",
      "role_ids": [
        1
      ],
      "samaccountname": "example",
      "state": 1,
      "status": 1,
      "title": "example",
      "trusted_idp_id": 1,
      "updated_at": "example",
      "username": "example",
      "userprincipalname": "example"
    }
  ]
}
```

### Lock user

Lock a user out of OneLogin for a number of minutes. Set the user's status to Active with Update user to unlock them sooner.

**Inputs**

- User (`onelogin_user_id`, number, required): The OneLogin user. At least 1.
- Minutes (`locked_until`, number, required): How many minutes to lock the account for. 0 locks it for the time the user's policy sets, or until it is unlocked if no policy applies. At least 0.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": 1
  }
}
```

### Remove roles from user

Take one or more roles away from a user.

**Inputs**

- User (`onelogin_user_id`, number, required): The OneLogin user. At least 1.
- Roles (`role_ids`, list, required): The roles.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": 1
  }
}
```

### Remove users from role

Take a role away from one or more users.

**Inputs**

- Role (`role_id`, number, required): The role. At least 1.
- Users (`user_ids`, list, required): The users.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": 1
  }
}
```

### Rename role

Change a role's name.

**Inputs**

- Role (`role_id`, number, required): The role. At least 1.
- Name (`name`, text, required): The role's new name.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": 1
  }
}
```

### Set user state

Approve, reject or unlicense a user.

**Inputs**

- User (`onelogin_user_id`, number, required): The OneLogin user. At least 1.
- State (`state`, number, required): Whether the user is approved to use OneLogin. One of: `0` (Unapproved), `1` (Approved), `2` (Rejected), `3` (Unlicensed).

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": 1
  }
}
```

### Sign user out

End a user's OneLogin session, so they have to sign in again.

**Inputs**

- User (`onelogin_user_id`, number, required): The OneLogin user. At least 1.

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": 1
  }
}
```

### Update user

Change a user's profile, status or state. Set the status to Active to unlock or reactivate someone, or to Suspended to stop them signing in. Empty fields are left as they are.

**Inputs**

- User (`onelogin_user_id`, number, required): The OneLogin user. At least 1.
- Email (`email`, text): The user's email address.
- Username (`username`, text): The user's username.
- First name (`firstname`, text): The user's first name.
- Last name (`lastname`, text): The user's last name.
- Job title (`title`, text): The user's job title.
- Department (`department`, text): The user's department.
- Company (`company`, text): The user's company.
- Phone (`phone`, text): The user's phone number, in E.164 format such as +14155550100.
- Comment (`comment`, text): Free text about the user.
- External ID (`external_id`, text): The user's ID in another directory or system.
- Manager (`manager_user_id`, text): The OneLogin user ID of the user's manager.
- Custom attributes (`custom_attributes`, object): Values for the account's custom user fields, by their short names, such as {"employee_number": "1042"}.
- State (`state`, number): Whether the user is approved to use OneLogin. One of: `0` (Unapproved), `1` (Approved), `2` (Rejected), `3` (Unlicensed).
- Status (`status`, number): The user's status: active, suspended, locked and so on. One of: `0` (Unactivated), `1` (Active), `2` (Suspended), `3` (Locked), `4` (Password expired), `5` (Awaiting password reset), `7` (Password pending), `8` (Security questions required).
- Apply mappings (`mappings`, text): When OneLogin applies its user mappings to this change. OneLogin applies them in the background when this is empty. One of: `async` (Apply in the background), `sync` (Apply before answering), `disabled` (Don't apply).

**Outputs**

- `data` (object): The response from OneLogin.

**Example output**

```json
{
  "data": {
    "activated_at": "example",
    "comment": "example",
    "company": "example",
    "created_at": "example",
    "custom_attributes": {},
    "department": "example",
    "directory_id": 1,
    "distinguished_name": "example",
    "email": "example",
    "external_id": "example",
    "firstname": "example",
    "group_id": 1,
    "id": 1,
    "invalid_login_attempts": 1,
    "invitation_sent_at": "example",
    "last_login": "example",
    "lastname": "example",
    "locked_until": "example",
    "manager_ad_id": "example",
    "manager_user_id": "example",
    "member_of": "example",
    "password_changed_at": "example",
    "phone": "example",
    "preferred_locale_code": "example",
    "role_ids": [
      1
    ],
    "samaccountname": "example",
    "state": 1,
    "status": 1,
    "title": "example",
    "trusted_idp_id": 1,
    "updated_at": "example",
    "username": "example",
    "userprincipalname": "example"
  }
}
```
