# LearnWorlds

> Manage LearnWorlds learners, courses, enrollments, user groups, payments and certificates.

App · 27 actions. Web page: https://docs.lodol.com/docs/integrations/learnworlds

## Actions

### Add a user to a user group

Add a user to a user group.

**Inputs**

- User group (`group_id`, text, required): The user group.
- Learner (`learner_id`, text, required): The learner, by LearnWorlds user ID or email address.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "success": false
  }
}
```

### Add or remove user tags

Add tags to a user or take tags off them, leaving their other tags as they are.

**Inputs**

- Learner (`learner_id`, text, required): The learner, by LearnWorlds user ID or email address.
- Tags (`tags`, list, required): The tags to add or remove.
- Change (`change`, text, required): Add the tags (attach) or remove them (detach). One of: `attach`, `detach`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billing_info": {},
    "created": 1.0,
    "email": "example",
    "eu_customer": false,
    "fields": {
      "address": "example",
      "behance": "example",
      "bio": "example",
      "birthday": "example",
      "company": "example",
      "company_size": "example",
      "country": "example",
      "dribbble": "example",
      "fb": "example",
      "github": "example",
      "graduation_year": "example",
      "instagram": "example",
      "linkedin": "example",
      "location": "example",
      "phone": "example",
      "skype": "example",
      "twitter": "example",
      "university": "example",
      "url": "example"
    },
    "first_name": "example",
    "id": "example",
    "is_admin": false,
    "is_affiliate": false,
    "is_instructor": false,
    "is_reporter": false,
    "is_suspended": false,
    "last_login": 1.0,
    "last_name": "example",
    "nps_comment": "example",
    "nps_score": 1,
    "referrer_id": "example",
    "role": {
      "level": "admin",
      "name": "example"
    },
    "signup_approval_status": "passed",
    "subscribed_for_marketing_emails": false,
    "tags": [],
    "username": "example",
    "utms": {
      "fc_country": "example",
      "fc_landing": "example",
      "fc_referrer": "example",
      "fc_utm_campaign": "example",
      "fc_utm_content": "example",
      "fc_utm_medium": "example",
      "fc_utm_source": "example",
      "fc_utm_term": "example",
      "lc_country": "example",
      "lc_landing": "example",
      "lc_referrer": "example",
      "lc_utm_campaign": "example",
      "lc_utm_content": "example",
      "lc_utm_medium": "example",
      "lc_utm_source": "example",
      "lc_utm_term": "example"
    }
  }
}
```

### Create a course

Create an empty course, ready to fill in LearnWorlds' course editor.

**Inputs**

- Course ID (`course_key`, text, required): A unique ID for the course, used in its address, such as intro-to-sales.
- Title (`title`, text, required): The course title.
- Access (`access`, text, required): Who can reach the course. One of: `paid`, `free`, `coming_soon` (Coming soon), `private`, `draft`.
- Description (`description`, text): The course description.
- Price (`price`, number): The course price. At least 0.
- Categories (`categories`, list): The categories the course belongs in.
- Label (`label`, text): A label shown on the course card.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "access": "paid",
    "afterPurchase": {
      "navigationType": "global",
      "settings": {
        "page": "example",
        "url": "example"
      },
      "type": "thankyou"
    },
    "author": {
      "image": "example",
      "name": "example"
    },
    "categories": [],
    "courseImage": "example",
    "created": 1.0,
    "description": "example",
    "discount_price": 1.0,
    "dripFeed": "date",
    "expires": 1,
    "expiresType": "days",
    "final_price": 1.0,
    "id": "example",
    "identifiers": {
      "apple_store_id": "example",
      "google_store_id": "example",
      "slug": "example"
    },
    "label": "example",
    "modified": 1.0,
    "original_price": 1.0,
    "taxSettings": {
      "taxExemptionMode": "school_default",
      "taxExemptionRegulationReference": "example"
    },
    "title": "example"
  }
}
```

### Create a user

Create a user in the school. LearnWorlds sends them a registration email unless you turn it off.

**Inputs**

- Email (`email`, text, required): The learner's email address.
- Username (`username`, text, required): The learner's username, shown in the school.
- Password (`password`, text): A password for the learner. Leave blank and they set their own.
- Location (`location`, text): Where the learner is based.
- Phone (`phone`, text): The learner's phone number.
- Company (`company`, text): The learner's company.
- Country (`country`, text): The learner's country.
- Tags (`tags`, list): Tags to give the learner.
- Subscribed to marketing emails (`subscribed_for_marketing_emails`, true/false): Whether the learner agreed to receive marketing emails.
- Send registration email (`send_registration_email`, true/false): Whether LearnWorlds sends the learner its registration email.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billing_info": {},
    "created": 1.0,
    "email": "example",
    "eu_customer": false,
    "fields": {
      "address": "example",
      "behance": "example",
      "bio": "example",
      "birthday": "example",
      "company": "example",
      "company_size": "example",
      "country": "example",
      "dribbble": "example",
      "fb": "example",
      "github": "example",
      "graduation_year": "example",
      "instagram": "example",
      "linkedin": "example",
      "location": "example",
      "phone": "example",
      "skype": "example",
      "twitter": "example",
      "university": "example",
      "url": "example"
    },
    "first_name": "example",
    "id": "example",
    "is_admin": false,
    "is_affiliate": false,
    "is_instructor": false,
    "is_reporter": false,
    "is_suspended": false,
    "last_login": 1.0,
    "last_name": "example",
    "nps_comment": "example",
    "nps_score": 1,
    "referrer_id": "example",
    "role": {
      "level": "admin",
      "name": "example"
    },
    "signup_approval_status": "passed",
    "subscribed_for_marketing_emails": false,
    "tags": [],
    "username": "example",
    "utms": {
      "fc_country": "example",
      "fc_landing": "example",
      "fc_referrer": "example",
      "fc_utm_campaign": "example",
      "fc_utm_content": "example",
      "fc_utm_medium": "example",
      "fc_utm_source": "example",
      "fc_utm_term": "example",
      "lc_country": "example",
      "lc_landing": "example",
      "lc_referrer": "example",
      "lc_utm_campaign": "example",
      "lc_utm_content": "example",
      "lc_utm_medium": "example",
      "lc_utm_source": "example",
      "lc_utm_term": "example"
    }
  }
}
```

### Create a user group

Create a user group, optionally with courses its members get.

**Inputs**

- Title (`title`, text, required): The group's name.
- Description (`description`, text): What the group is for.
- Courses (`courses`, list): Courses the group's members get.
- Enroll members in courses (`enroll_users_on_courses`, true/false): Enroll members in the group's courses as soon as they join.
- Maximum members (`max_number_of_users`, number): The most members the group can have. Leave blank for no limit. At least 1.
- Tags (`tags`, list): Tags given to everyone added to the group.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "created": 1.0,
    "description": "example",
    "enroll_users_on_courses": false,
    "group_managers": [],
    "id": "example",
    "max_number_of_users": 1.0,
    "modified": 1.0,
    "products": {
      "courses": [],
      "learning_programs": []
    },
    "tags": [],
    "title": "example"
  }
}
```

### Delete a user group

Delete a user group. LearnWorlds finishes the deletion in the background.

**Inputs**

- User group (`group_id`, text, required): The user group.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "async": false,
    "job_id": "example"
  }
}
```

### Enroll a user

Enroll a user in a course, bundle or subscription.

**Inputs**

- Learner (`learner_id`, text, required): The learner, by LearnWorlds user ID or email address.
- Product ID (`product_id`, text, required): The ID of the course, bundle or subscription.
- Product type (`product_type`, text, required): What kind of product it is. One of: `course`, `bundle`, `subscription`.
- Price (`price`, number): What the user paid, recorded on the enrollment. Leave blank for 0. At least 0.
- Justification (`justification`, text): A note on why the user was enrolled.
- Send enrollment email (`send_enrollment_email`, true/false): Whether LearnWorlds sends the user its enrollment email.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "success": false
  }
}
```

### Get a course

Get one course.

**Inputs**

- Course (`course_id`, text, required): The course.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "access": "paid",
    "afterPurchase": {
      "navigationType": "global",
      "settings": {
        "page": "example",
        "url": "example"
      },
      "type": "thankyou"
    },
    "author": {
      "image": "example",
      "name": "example"
    },
    "categories": [],
    "courseImage": "example",
    "created": 1.0,
    "description": "example",
    "discount_price": 1.0,
    "dripFeed": "date",
    "expires": 1,
    "expiresType": "days",
    "final_price": 1.0,
    "id": "example",
    "identifiers": {
      "apple_store_id": "example",
      "google_store_id": "example",
      "slug": "example"
    },
    "label": "example",
    "modified": 1.0,
    "original_price": 1.0,
    "taxSettings": {
      "taxExemptionMode": "school_default",
      "taxExemptionRegulationReference": "example"
    },
    "title": "example"
  }
}
```

### Get a payment

Get one payment.

**Inputs**

- Payment ID (`payment_id`, text, required): The payment's ID.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "affiliate": {
      "code": "example",
      "commission_amount": 1.0,
      "commission_percentage": 1.0,
      "id": "example",
      "payment_status": "new",
      "username": "example"
    },
    "billing_info": {},
    "coupon": "example",
    "created": 1.0,
    "discount": 1.0,
    "gateway": "example",
    "id": "example",
    "instructors": [],
    "instructors_total_percentage": 1.0,
    "invoice": "example",
    "paid_at": 1.0,
    "payment_plan_current_payment": 1,
    "payment_plan_total_payments": 1,
    "period": "example",
    "price": 1.0,
    "product": {
      "description": "example",
      "discount_price": 1.0,
      "final_price": 1.0,
      "id": "example",
      "image": "example",
      "name": "example",
      "original_price": 1.0,
      "trial_days": 1,
      "type": "course"
    },
    "refund_at": 1.0,
    "tax_amount": 1.0,
    "tax_percentage": 1.0,
    "transaction_id": "example",
    "type": "subscription",
    "user_id": "example"
  }
}
```

### Get a user

Get a user by ID or email address.

**Inputs**

- Learner (`learner_id`, text, required): The learner, by LearnWorlds user ID or email address.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billing_info": {},
    "created": 1.0,
    "email": "example",
    "eu_customer": false,
    "fields": {
      "address": "example",
      "behance": "example",
      "bio": "example",
      "birthday": "example",
      "company": "example",
      "company_size": "example",
      "country": "example",
      "dribbble": "example",
      "fb": "example",
      "github": "example",
      "graduation_year": "example",
      "instagram": "example",
      "linkedin": "example",
      "location": "example",
      "phone": "example",
      "skype": "example",
      "twitter": "example",
      "university": "example",
      "url": "example"
    },
    "first_name": "example",
    "id": "example",
    "is_admin": false,
    "is_affiliate": false,
    "is_instructor": false,
    "is_reporter": false,
    "is_suspended": false,
    "last_login": 1.0,
    "last_name": "example",
    "nps_comment": "example",
    "nps_score": 1,
    "referrer_id": "example",
    "role": {
      "level": "admin",
      "name": "example"
    },
    "signup_approval_status": "passed",
    "subscribed_for_marketing_emails": false,
    "tags": [],
    "username": "example",
    "utms": {
      "fc_country": "example",
      "fc_landing": "example",
      "fc_referrer": "example",
      "fc_utm_campaign": "example",
      "fc_utm_content": "example",
      "fc_utm_medium": "example",
      "fc_utm_source": "example",
      "fc_utm_term": "example",
      "lc_country": "example",
      "lc_landing": "example",
      "lc_referrer": "example",
      "lc_utm_campaign": "example",
      "lc_utm_content": "example",
      "lc_utm_medium": "example",
      "lc_utm_source": "example",
      "lc_utm_term": "example"
    }
  }
}
```

### Get a user group

Get one user group.

**Inputs**

- User group (`group_id`, text, required): The user group.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "created": 1.0,
    "description": "example",
    "enroll_users_on_courses": false,
    "group_managers": [],
    "id": "example",
    "max_number_of_users": 1.0,
    "modified": 1.0,
    "products": {
      "courses": [],
      "learning_programs": []
    },
    "tags": [],
    "title": "example"
  }
}
```

### Get a user's course progress

Get how far a user has got in a course: status, progress, score, time spent and completion date.

**Inputs**

- Learner (`learner_id`, text, required): The learner, by LearnWorlds user ID or email address.
- Course (`course_id`, text, required): The course.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "average_score_rate": 1.0,
    "completed_at": 1.0,
    "completed_units": 1,
    "progress_per_section_unit": [],
    "progress_rate": 1.0,
    "status": "not_started",
    "time_on_course": 1,
    "total_units": 1
  }
}
```

### List a course's users

List the users enrolled in a course.

**Inputs**

- Course (`course_id`, text, required): The course.
- Include suspended (`include_suspended`, true/false): Include suspended users.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.
- Items per page (`items_per_page`, number): How many results to return on each page. From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "meta": {
      "itemsPerPage": 1.0,
      "page": 1.0,
      "totalItems": 1.0,
      "totalPages": 1.0
    }
  }
}
```

### List a user's courses

List the courses a user is enrolled in, with their enrollment dates and prices.

**Inputs**

- Learner (`learner_id`, text, required): The learner, by LearnWorlds user ID or email address.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "meta": {
      "itemsPerPage": 1.0,
      "page": 1.0,
      "totalItems": 1.0,
      "totalPages": 1.0
    }
  }
}
```

### List bundles

List the school's bundles.

**Inputs**

- Page (`page`, number): Which page of results to return, starting at 1. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "meta": {
      "itemsPerPage": 1.0,
      "page": 1.0,
      "totalItems": 1.0,
      "totalPages": 1.0
    }
  }
}
```

### List certificates

List the certificates issued to a user or for a course. Give at least one of the two.

**Inputs**

- User (`learner`, text): Only certificates of this user, by ID or email address.
- Course (`course_id`, text): Only certificates for this course.
- Status (`status`, text): Only certificates with this status. One of: `active`, `expired`, `revoked`.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "meta": {
      "itemsPerPage": 1.0,
      "page": 1.0,
      "totalItems": 1.0,
      "totalPages": 1.0
    }
  }
}
```

### List courses

List the school's courses, newest first, optionally only some categories.

**Inputs**

- Categories (`categories`, text): Only courses in these categories, separated by commas.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "meta": {
      "itemsPerPage": 1.0,
      "page": 1.0,
      "totalItems": 1.0,
      "totalPages": 1.0
    }
  }
}
```

### List payments

List payments, newest first, optionally for one user or product or a date range.

**Inputs**

- User (`learner`, text): Only payments by this user, by ID or email address.
- Product ID (`product_id`, text): Only payments for this product.
- Product type (`product_type`, text): Only payments for this kind of product. One of: `course`, `bundle`, `subscription`.
- Created after (`created_after`, date and time): Only payments made after this time.
- Created before (`created_before`, date and time): Only payments made before this time.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.
- Items per page (`items_per_page`, number): How many results to return on each page. From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "meta": {
      "itemsPerPage": 1.0,
      "page": 1.0,
      "totalItems": 1.0,
      "totalPages": 1.0
    }
  }
}
```

### List user groups

List the school's user groups.

**Inputs**

- Page (`page`, number): Which page of results to return, starting at 1. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "meta": {
      "itemsPerPage": 1.0,
      "page": 1.0,
      "totalItems": 1.0,
      "totalPages": 1.0
    }
  }
}
```

### List users

List the school's users, newest first, optionally filtered by status, role, tags or registration date.

**Inputs**

- Status (`status`, text): Only users with this status. One of: `paying`, `non_paying` (Non paying), `suspended`, `never_logged_in` (Never logged in).
- Role (`role`, text): Only users with this role. One of: `user`, `admin`, `instructor`, `reporter`, `license_reporter` (License reporter).
- Tags (`tags`, text): Only users with these tags, separated by commas.
- Registered after (`registered_after`, date and time): Only users who registered after this time.
- Registered before (`registered_before`, date and time): Only users who registered before this time.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.
- Items per page (`items_per_page`, number): How many results to return on each page. From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "meta": {
      "itemsPerPage": 1.0,
      "page": 1.0,
      "totalItems": 1.0,
      "totalPages": 1.0
    }
  }
}
```

### Remove a user from a user group

Take a user out of a user group.

**Inputs**

- User group (`group_id`, text, required): The user group.
- Learner (`learner_id`, text, required): The learner, by LearnWorlds user ID or email address.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Suspend a user

Suspend a user so they cannot sign in. This also removes them from their user groups and seats.

**Inputs**

- Learner (`learner_id`, text, required): The learner, by LearnWorlds user ID or email address.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billing_info": {},
    "created": 1.0,
    "email": "example",
    "eu_customer": false,
    "fields": {
      "address": "example",
      "behance": "example",
      "bio": "example",
      "birthday": "example",
      "company": "example",
      "company_size": "example",
      "country": "example",
      "dribbble": "example",
      "fb": "example",
      "github": "example",
      "graduation_year": "example",
      "instagram": "example",
      "linkedin": "example",
      "location": "example",
      "phone": "example",
      "skype": "example",
      "twitter": "example",
      "university": "example",
      "url": "example"
    },
    "first_name": "example",
    "id": "example",
    "is_admin": false,
    "is_affiliate": false,
    "is_instructor": false,
    "is_reporter": false,
    "is_suspended": false,
    "last_login": 1.0,
    "last_name": "example",
    "nps_comment": "example",
    "nps_score": 1,
    "referrer_id": "example",
    "role": {
      "level": "admin",
      "name": "example"
    },
    "signup_approval_status": "passed",
    "subscribed_for_marketing_emails": false,
    "tags": [],
    "username": "example",
    "utms": {
      "fc_country": "example",
      "fc_landing": "example",
      "fc_referrer": "example",
      "fc_utm_campaign": "example",
      "fc_utm_content": "example",
      "fc_utm_medium": "example",
      "fc_utm_source": "example",
      "fc_utm_term": "example",
      "lc_country": "example",
      "lc_landing": "example",
      "lc_referrer": "example",
      "lc_utm_campaign": "example",
      "lc_utm_content": "example",
      "lc_utm_medium": "example",
      "lc_utm_source": "example",
      "lc_utm_term": "example"
    }
  }
}
```

### Unenroll a user

Take a user out of a course, bundle or subscription.

**Inputs**

- Learner (`learner_id`, text, required): The learner, by LearnWorlds user ID or email address.
- Product ID (`product_id`, text, required): The ID of the course, bundle or subscription.
- Product type (`product_type`, text, required): What kind of product it is. One of: `course`, `bundle`, `subscription`.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Unsuspend a user

Let a suspended user sign in again. Their earlier groups and seats are not restored.

**Inputs**

- Learner (`learner_id`, text, required): The learner, by LearnWorlds user ID or email address.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billing_info": {},
    "created": 1.0,
    "email": "example",
    "eu_customer": false,
    "fields": {
      "address": "example",
      "behance": "example",
      "bio": "example",
      "birthday": "example",
      "company": "example",
      "company_size": "example",
      "country": "example",
      "dribbble": "example",
      "fb": "example",
      "github": "example",
      "graduation_year": "example",
      "instagram": "example",
      "linkedin": "example",
      "location": "example",
      "phone": "example",
      "skype": "example",
      "twitter": "example",
      "university": "example",
      "url": "example"
    },
    "first_name": "example",
    "id": "example",
    "is_admin": false,
    "is_affiliate": false,
    "is_instructor": false,
    "is_reporter": false,
    "is_suspended": false,
    "last_login": 1.0,
    "last_name": "example",
    "nps_comment": "example",
    "nps_score": 1,
    "referrer_id": "example",
    "role": {
      "level": "admin",
      "name": "example"
    },
    "signup_approval_status": "passed",
    "subscribed_for_marketing_emails": false,
    "tags": [],
    "username": "example",
    "utms": {
      "fc_country": "example",
      "fc_landing": "example",
      "fc_referrer": "example",
      "fc_utm_campaign": "example",
      "fc_utm_content": "example",
      "fc_utm_medium": "example",
      "fc_utm_source": "example",
      "fc_utm_term": "example",
      "lc_country": "example",
      "lc_landing": "example",
      "lc_referrer": "example",
      "lc_utm_campaign": "example",
      "lc_utm_content": "example",
      "lc_utm_medium": "example",
      "lc_utm_source": "example",
      "lc_utm_term": "example"
    }
  }
}
```

### Update a course

Change a course's title, description, price, access, categories or label.

**Inputs**

- Course (`course_id`, text, required): The course.
- Title (`title`, text): The course title.
- Description (`description`, text): The course description.
- Price (`price`, number): The course price. At least 0.
- Access (`access`, text): Who can reach the course. One of: `paid`, `free`, `coming_soon` (Coming soon), `enrollment_closed` (Enrollment closed), `private`, `draft`.
- Categories (`categories`, list): The categories the course belongs in.
- Label (`label`, text): A label shown on the course card.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "access": "paid",
    "afterPurchase": {
      "navigationType": "global",
      "settings": {
        "page": "example",
        "url": "example"
      },
      "type": "thankyou"
    },
    "author": {
      "image": "example",
      "name": "example"
    },
    "categories": [],
    "courseImage": "example",
    "created": 1.0,
    "description": "example",
    "discount_price": 1.0,
    "dripFeed": "date",
    "expires": 1,
    "expiresType": "days",
    "final_price": 1.0,
    "id": "example",
    "identifiers": {
      "apple_store_id": "example",
      "google_store_id": "example",
      "slug": "example"
    },
    "label": "example",
    "modified": 1.0,
    "original_price": 1.0,
    "taxSettings": {
      "taxExemptionMode": "school_default",
      "taxExemptionRegulationReference": "example"
    },
    "title": "example"
  }
}
```

### Update a user

Change a user's email, username, profile fields or tags.

**Inputs**

- Learner (`learner_id`, text, required): The learner, by LearnWorlds user ID or email address.
- Email (`email`, text): The learner's email address.
- Username (`username`, text): The learner's username, shown in the school.
- Location (`location`, text): Where the learner is based.
- Phone (`phone`, text): The learner's phone number.
- Company (`company`, text): The learner's company.
- Country (`country`, text): The learner's country.
- Tags (`tags`, list): Tags to give the learner.
- Subscribed to marketing emails (`subscribed_for_marketing_emails`, true/false): Whether the learner agreed to receive marketing emails.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billing_info": {},
    "created": 1.0,
    "email": "example",
    "eu_customer": false,
    "fields": {
      "address": "example",
      "behance": "example",
      "bio": "example",
      "birthday": "example",
      "company": "example",
      "company_size": "example",
      "country": "example",
      "dribbble": "example",
      "fb": "example",
      "github": "example",
      "graduation_year": "example",
      "instagram": "example",
      "linkedin": "example",
      "location": "example",
      "phone": "example",
      "skype": "example",
      "twitter": "example",
      "university": "example",
      "url": "example"
    },
    "first_name": "example",
    "id": "example",
    "is_admin": false,
    "is_affiliate": false,
    "is_instructor": false,
    "is_reporter": false,
    "is_suspended": false,
    "last_login": 1.0,
    "last_name": "example",
    "nps_comment": "example",
    "nps_score": 1,
    "referrer_id": "example",
    "role": {
      "level": "admin",
      "name": "example"
    },
    "signup_approval_status": "passed",
    "subscribed_for_marketing_emails": false,
    "tags": [],
    "username": "example",
    "utms": {
      "fc_country": "example",
      "fc_landing": "example",
      "fc_referrer": "example",
      "fc_utm_campaign": "example",
      "fc_utm_content": "example",
      "fc_utm_medium": "example",
      "fc_utm_source": "example",
      "fc_utm_term": "example",
      "lc_country": "example",
      "lc_landing": "example",
      "lc_referrer": "example",
      "lc_utm_campaign": "example",
      "lc_utm_content": "example",
      "lc_utm_medium": "example",
      "lc_utm_source": "example",
      "lc_utm_term": "example"
    }
  }
}
```

### Update a user group

Rename a user group or change its description, courses or settings. A course list given replaces the group's courses.

**Inputs**

- User group (`group_id`, text, required): The user group.
- Title (`title`, text, required): The group's name.
- Description (`description`, text): What the group is for.
- Courses (`courses`, list): Courses the group's members get. Leave blank to keep the current ones.
- Enroll members in courses (`enroll_users_on_courses`, true/false): Enroll members in the group's courses as soon as they join.
- Maximum members (`max_number_of_users`, number): The most members the group can have. At least 1.
- Tags (`tags`, list): Tags given to everyone added to the group.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "created": 1.0,
    "description": "example",
    "enroll_users_on_courses": false,
    "group_managers": [],
    "id": "example",
    "max_number_of_users": 1.0,
    "modified": 1.0,
    "products": {
      "courses": [],
      "learning_programs": []
    },
    "tags": [],
    "title": "example"
  }
}
```
