# LearnUpon

> Run training in your LearnUpon portal: manage users and groups, enroll people in courses, record completions and follow their progress.

App · 24 actions. Web page: https://docs.lodol.com/docs/integrations/learnupon

## Actions

### Add a user to a group

Put a user in a group, enrolling them in the group's courses unless you choose otherwise.

**Inputs**

- Group (`group_id`, number, required): The group. At least 1.
- User (`person_id`, number, required): The user to add. At least 1.
- Enroll in group courses (`process_enrollments`, true/false): Whether to enroll them in the group's courses and learning paths. Yes if left empty.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "id": 1
  }
}
```

### Create a group

Create a group. Its name must be new to the portal.

**Inputs**

- Name (`title`, text, required): The group's name.
- Description (`description`, text): What the group is for.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "id": 1
  }
}
```

### Create a user

Add a user to the portal with an email address and password.

**Inputs**

- Email (`email`, text, required): Their email address, which identifies them in LearnUpon.
- First name (`first_name`, text): Their first name.
- Last name (`last_name`, text): Their last name.
- Password (`password`, text, required): Their password, at least 6 characters.
- User type (`user_type`, text): What they can do in the portal. One of: `learner`, `manager`, `instructor`, `admin`.
- Language (`language`, text): Their language, as an ISO code such as `en` or `de`. Leave empty for the portal's language.
- Enabled (`enabled`, true/false): Whether their account can sign in.
- Account expires (`account_expires`, date): The day their account stops working, at midnight UTC.
- Custom fields (`custom_data`, object): Values for the portal's custom user fields, by field name, such as `{"Department": "Sales"}`.
- Change password at first sign-in (`change_password_on_first_login`, true/false): Whether they must choose a new password the first time they sign in.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "id": 1
  }
}
```

### Delete a group

Delete a group. Its members stay in the portal.

**Inputs**

- Group (`group_id`, number, required): The group. At least 1.
- Delete enrollments (`delete_enrollments`, true/false): Whether to delete the not started and in progress enrollments members got from the group.

**Outputs**

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

**Example output**

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

### Delete a user

Delete a user's account.

**Inputs**

- User (`person_id`, number, required): The user to delete. At least 1.

**Outputs**

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

**Example output**

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

### Enroll a user in a course

Enroll a user in a course, with a due date or access end date if you like.

**Inputs**

- User's email (`email`, text, required): The user's email address.
- Course (`course_id`, number, required): The course. At least 1.
- Due date (`due_date`, date): When they should finish. They can still open it after.
- Access ends (`expires_at`, date): When their access to the course ends.
- Re-enroll if completed (`re_enroll_if_completed`, true/false): Whether to enroll them again if they already completed it.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "id": 1,
    "user_id": 1
  }
}
```

### Find a user by email

Look up a user by their email address.

**Inputs**

- Email (`email`, text, required): Their email address.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "CustomData": {},
        "account_expires": "example",
        "created_at": "example",
        "email": "example",
        "enabled": true,
        "first_name": "example",
        "id": 1,
        "last_name": "example",
        "last_sign_in_at": "example",
        "locale": "example",
        "number_of_enrollments": 1,
        "number_of_enrollments_accessed": 1,
        "sign_in_count": 1,
        "updated_at": "example",
        "user_type": "learner",
        "username": "example"
      }
    ],
    "page": 1
  }
}
```

### Get a course

Read one course, with how many learners are at each stage.

**Inputs**

- Course (`course_id`, number, required): The course. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "cataloged": true,
    "created_at": "example",
    "date_published": "example",
    "description_text": "example",
    "id": 1,
    "keywords": "example",
    "name": "example",
    "num_completed": 1,
    "num_enrolled": 1,
    "num_failed": 1,
    "num_in_progress": 1,
    "num_not_started": 1,
    "num_passed": 1,
    "number_of_modules": 1,
    "owner_email": "example",
    "owner_id": 1,
    "published_status_id": "example",
    "reference_code": "example",
    "sellable": true,
    "source_id": 1,
    "version": 1
  }
}
```

### Get a user

Read one user, with their custom fields.

**Inputs**

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

**Outputs**

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

**Example output**

```json
{
  "data": {
    "CustomData": {},
    "account_expires": "example",
    "created_at": "example",
    "email": "example",
    "enabled": true,
    "first_name": "example",
    "id": 1,
    "last_name": "example",
    "last_sign_in_at": "example",
    "locale": "example",
    "number_of_enrollments": 1,
    "number_of_enrollments_accessed": 1,
    "sign_in_count": 1,
    "updated_at": "example",
    "user_type": "learner",
    "username": "example"
  }
}
```

### Get an enrollment

Read one enrollment: its status, score and dates.

**Inputs**

- Enrollment ID (`enrollment_id`, number, required): The enrollment's ID. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "cert_expires_at": "example",
    "certificate_name": "example",
    "course_access_expires_at": "example",
    "course_id": 1,
    "course_name": "example",
    "date_completed": "example",
    "date_enrolled": "example",
    "date_lastaccessed": "example",
    "date_started": "example",
    "due_date": "example",
    "email": "example",
    "first_name": "example",
    "group_id": 1,
    "id": 1,
    "is_overdue": true,
    "last_name": "example",
    "percentage": 1,
    "percentage_complete": 1,
    "status": "not_started",
    "updated_at": "example",
    "user_id": 1,
    "username": "example"
  }
}
```

### Invite a user

Email someone an invitation to join the portal, and a group if you choose one.

**Inputs**

- Email (`email`, text, required): Who to invite.
- First name (`first_name`, text): Their first name.
- Last name (`last_name`, text): Their last name.
- Group (`group_id`, number): A group to put them in once they accept. At least 1.
- User type (`user_type`, text): What they can do once they join. Learner if left empty. One of: `learner`, `manager`, `instructor`, `admin`.
- Account expires (`expires_at`, date): The day their account stops working, once they accept.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "email": "example",
    "id": 1
  }
}
```

### List a group's members

List the users in a group, with each membership's ID.

**Inputs**

- Group (`group_id`, number, required): The group. At least 1.
- Page (`page`, number): Which page to read, starting at 1. Each page holds up to 500. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "created_at": "example",
        "email": "example",
        "first_name": "example",
        "id": 1,
        "last_name": "example",
        "user_id": 1,
        "username": "example"
      }
    ],
    "page": 1
  }
}
```

### List an enrollment's modules

List the modules of an enrollment, with the learner's progress in each.

**Inputs**

- Enrollment ID (`enrollment_id`, number, required): The enrollment's ID. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "date_completed": "example",
        "date_lastaccessed": "example",
        "date_started": "example",
        "id": 1,
        "sequence": 1,
        "status": "example",
        "title": "example"
      }
    ],
    "page": 1
  }
}
```

### List courses

List the portal's courses, or find them by name.

**Inputs**

- Name (`name`, text): Only courses whose name contains these words.
- Include drafts (`include_draft`, true/false): Whether to include draft courses.
- Page (`page`, number): Which page to read, starting at 1. Each page holds up to 500. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "cataloged": true,
        "created_at": "example",
        "date_published": "example",
        "description_text": "example",
        "id": 1,
        "keywords": "example",
        "name": "example",
        "num_completed": 1,
        "num_enrolled": 1,
        "num_failed": 1,
        "num_in_progress": 1,
        "num_not_started": 1,
        "num_passed": 1,
        "number_of_modules": 1,
        "owner_email": "example",
        "owner_id": 1,
        "published_status_id": "example",
        "reference_code": "example",
        "sellable": true,
        "source_id": 1,
        "version": 1
      }
    ],
    "page": 1
  }
}
```

### List enrollments

List a user's enrollments or a course's, with progress and scores.

**Inputs**

- User (`person_id`, number): Only this user's enrollments. At least 1.
- Course (`course_id`, number): Only this course's enrollments. At least 1.
- Changed from (`updated_from`, date): Only enrollments changed on or after this day.
- Changed to (`updated_to`, date): Only enrollments changed on or before this day.
- Page (`page`, number): Which page to read, starting at 1. Each page holds up to 500. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "cert_expires_at": "example",
        "certificate_name": "example",
        "course_access_expires_at": "example",
        "course_id": 1,
        "course_name": "example",
        "date_completed": "example",
        "date_enrolled": "example",
        "date_lastaccessed": "example",
        "date_started": "example",
        "due_date": "example",
        "email": "example",
        "first_name": "example",
        "group_id": 1,
        "id": 1,
        "is_overdue": true,
        "last_name": "example",
        "percentage": 1,
        "percentage_complete": 1,
        "status": "not_started",
        "updated_at": "example",
        "user_id": 1,
        "username": "example"
      }
    ],
    "page": 1
  }
}
```

### List groups

List the portal's groups, or find them by name.

**Inputs**

- Name (`title`, text): Only groups whose name contains these words.
- Page (`page`, number): Which page to read, starting at 1. Each page holds up to 500. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "created_at": "example",
        "description": "example",
        "id": 1,
        "number_of_members": 1,
        "title": "example",
        "updated_at": "example"
      }
    ],
    "page": 1
  }
}
```

### List manual completions

List enrollments that were marked complete, passed or failed by hand.

**Inputs**

- User (`person_id`, number): Only this user's. At least 1.
- Enrollment ID (`enrollment_id`, number): Only this enrollment's. At least 1.
- Course (`course_id`, number): Only this course's. At least 1.
- Page (`page`, number): Which page to read, starting at 1. Each page holds up to 500. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "action_source_type": "example",
        "created_at": "example",
        "date_completed": "example",
        "enrollment_id": 1,
        "id": 1,
        "notes": "example",
        "percentage": 1,
        "status": "example"
      }
    ],
    "page": 1
  }
}
```

### List users

List the portal's users, 500 to a page.

**Inputs**

- Sign-in enabled (`login_enabled`, true/false): Yes for only users who can sign in, No for only disabled users.
- Page (`page`, number): Which page to read, starting at 1. Each page holds up to 500. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "CustomData": {},
        "account_expires": "example",
        "created_at": "example",
        "email": "example",
        "enabled": true,
        "first_name": "example",
        "id": 1,
        "last_name": "example",
        "last_sign_in_at": "example",
        "locale": "example",
        "number_of_enrollments": 1,
        "number_of_enrollments_accessed": 1,
        "sign_in_count": 1,
        "updated_at": "example",
        "user_type": "learner",
        "username": "example"
      }
    ],
    "page": 1
  }
}
```

### Mark an enrollment complete

Record a result for an enrollment by hand, such as training done offline.

**Inputs**

- Enrollment ID (`enrollment_id`, number, required): The enrollment's ID. At least 1.
- Result (`status`, text, required): The result. One of: `completed`, `passed`, `failed`.
- Completed at (`date_completed`, date and time, required): When they finished.
- Score (`percentage`, number): Their score as a percentage. Needed when the result is Passed or Failed. From 0 to 100.
- Notes (`notes`, text): Why it was marked, up to 2,000 characters.
- Award certificates (`award_certs`, true/false): Whether to award the course's certificates. Yes if left empty.
- Award credits (`award_credits`, true/false): Whether to award the course's credits. Yes if left empty.
- Award badges (`award_badges`, true/false): Whether to award the course's badges. Yes if left empty.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "id": 1
  }
}
```

### Remove a user from a group

Take a user out of a group. They stay in the portal.

**Inputs**

- Group (`group_id`, number, required): The group. At least 1.
- User (`person_id`, number, required): The user to remove. At least 1.
- Unenroll from group courses (`process_unenrollments`, true/false): Whether to also unenroll them from the group's courses and learning paths.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "deleted": true
  }
}
```

### Unenroll a user

Delete an enrollment. Completed enrollments stay in the learner's history unless you choose otherwise.

**Inputs**

- Enrollment ID (`enrollment_id`, number, required): The enrollment's ID. At least 1.
- Remove from history (`remove_from_history`, true/false): Whether to delete it even if it is completed, removing it from reports.

**Outputs**

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

**Example output**

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

### Update a group

Rename a group or change its description.

**Inputs**

- Group (`group_id`, number, required): The group. At least 1.
- Name (`title`, text): The group's new name.
- Description (`description`, text): Its new description.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "id": 1
  }
}
```

### Update a user

Change a user's details. Fields left empty stay as they are.

**Inputs**

- User (`person_id`, number, required): The user. At least 1.
- Email (`email`, text): A new email address for them.
- First name (`first_name`, text): Their first name.
- Last name (`last_name`, text): Their last name.
- Password (`password`, text): Their password, at least 6 characters. Leave empty to keep it.
- User type (`user_type`, text): What they can do in the portal. One of: `learner`, `manager`, `instructor`, `admin`.
- Language (`language`, text): Their language, as an ISO code such as `en` or `de`. Leave empty for the portal's language.
- Enabled (`enabled`, true/false): Whether their account can sign in.
- Account expires (`account_expires`, date): The day their account stops working, at midnight UTC.
- Custom fields (`custom_data`, object): Values for the portal's custom user fields, by field name, such as `{"Department": "Sales"}`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "id": 1
  }
}
```

### Update an enrollment

Change an enrollment's due date or the day access ends.

**Inputs**

- Enrollment ID (`enrollment_id`, number, required): The enrollment's ID. At least 1.
- Due date (`due_date`, date): When they should finish.
- Access ends (`expires_at`, date): When their access to the course ends.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "id": 1
  }
}
```
