# Trainual

> Onboard and train your team in Trainual: add and update people, organize groups, give responsibilities, assign content and follow completions.

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

## Actions

### Add a user to a group

Add one person to a group, keeping its other members.

**Inputs**

- Group (`group_id`, number, required): The group. At least 1.
- User (`person_id`, number, required): The user to add. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "description": "example",
    "everyone": true,
    "id": "example",
    "kind": "role",
    "manager_ids": [
      "example"
    ],
    "name": "example",
    "updated_at": "example",
    "user_ids": [
      "example"
    ]
  }
}
```

### Archive a user

Archive (deactivate) a person, so they can no longer sign in.

**Inputs**

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

**Outputs**

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

**Example output**

```json
{
  "data": {
    "archived_scheduled_for": "example",
    "completion_percentage": 1,
    "email": "example",
    "id": "example",
    "invite_scheduled_for": "example",
    "name": "example",
    "permission": "general",
    "phone_number": "example",
    "show_in_directory": true,
    "start_date": "example",
    "status": "active",
    "suites": [
      "example"
    ],
    "time_zone": "example",
    "title": "example"
  }
}
```

### Assign content

Assign a subject or other content to a user, with a due date if you like.

**Inputs**

- User (`person_id`, number, required): The user to assign it to. At least 1.
- Content type (`content_type`, text, required): The kind of content to assign. One of: `subject`, `document`, `page`, `video`, `test`, `checklist`, `flowchart`, `file`, `course`, `scorm_package` (SCORM package).
- Content ID (`content_id`, number, required): The ID of the content. At least 1.
- Completion required (`completion_required`, true/false): Whether they must complete it.
- Due (`due_date_at`, date and time): When it is due.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "assigner_id": 1,
    "completion_required": true,
    "content_id": 1,
    "content_type": "subject",
    "created_at": "example",
    "due_date_at": "example",
    "id": "example",
    "updated_at": "example",
    "user_id": 1
  }
}
```

### Create a group

Create a role, team, department or location, with its members.

**Inputs**

- Name (`name`, text, required): The group's name.
- Description (`description`, text): What the group is for.
- Kind (`group_kind`, text): What sort of group it is. One of: `role`, `team`, `department`, `location`, `other`.
- Members (`member_ids`, list): The users in the group. On an update this replaces every member.
- Managers (`manager_ids`, list): The users who manage the group.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "description": "example",
    "everyone": true,
    "id": "example",
    "kind": "role",
    "name": "example",
    "updated_at": "example"
  }
}
```

### Create a responsibility

Create a responsibility and give it to a user.

**Inputs**

- User (`person_id`, number, required): The user who has the responsibility. At least 1.
- Name (`name`, text, required): What they are responsible for.
- Description (`description`, text): More about the responsibility.
- Content link (`url`, text): A link to the Trainual content that explains it.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "content_urls": [
      {
        "content_id": "example",
        "content_type": "example",
        "title": "example",
        "url": "example"
      }
    ],
    "created_at": "example",
    "description": "example",
    "id": "example",
    "name": "example",
    "updated_at": "example"
  }
}
```

### Create a user

Add a person to Trainual and choose when they get their invite.

**Inputs**

- Name (`name`, text, required): The person's full name.
- Email (`email`, text): Their email address, which they sign in with.
- Job title (`title`, text): Their job title.
- Permission (`permission`, text): What they can do in Trainual. General users can only view and complete content. One of: `general`, `contributor`, `author`, `admin`, `billing_admin` (Billing admin).
- Phone number (`phone_number`, text): Their phone number.
- Start date (`start_date`, date): The day they start.
- Time zone (`time_zone`, text): Their time zone, as Trainual names it, such as `America/Los_Angeles`.
- Show in directory (`show_in_directory`, true/false): Whether they appear in the company directory.
- Manager (`manager_id`, number): The user they report to. At least 1.
- Invite (`send_invite`, text): When Trainual emails them an invite. One of: `now` (Send the invite now), `later` (Don't send an invite yet), `scheduled` (Send the invite at a set time).
- Invite at (`scheduled_invite_at`, date and time): When to send the invite, if Invite is set to a set time.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "archived_scheduled_for": "example",
    "completion_percentage": 1,
    "email": "example",
    "id": "example",
    "invite_scheduled_for": "example",
    "name": "example",
    "permission": "general",
    "phone_number": "example",
    "show_in_directory": true,
    "start_date": "example",
    "status": "active",
    "suites": [
      "example"
    ],
    "time_zone": "example",
    "title": "example"
  }
}
```

### Delete a responsibility

Delete a responsibility, taking it away from every user and group that has it.

**Inputs**

- Responsibility (`responsibility_id`, number, required): The responsibility. At least 1.

**Outputs**

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

**Example output**

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

### Get a group

Read a group with the IDs of its members and managers.

**Inputs**

- Group (`group_id`, number, required): The group. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "description": "example",
    "everyone": true,
    "id": "example",
    "kind": "role",
    "manager_ids": [
      "example"
    ],
    "name": "example",
    "updated_at": "example",
    "user_ids": [
      "example"
    ]
  }
}
```

### Get a subject

Read one subject.

**Inputs**

- Subject (`subject_id`, number, required): The subject. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "archived": true,
    "completion_required": true,
    "created_at": "example",
    "description": "example",
    "emoji": "example",
    "forced_order": true,
    "id": "example",
    "locked": true,
    "minutes_to_read": 1,
    "owner_id": 1,
    "published": true,
    "subject_type": "example",
    "title": "example",
    "updated_at": "example"
  }
}
```

### Get a user

Read one active person's details.

**Inputs**

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

**Outputs**

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

**Example output**

```json
{
  "data": {
    "archived_scheduled_for": "example",
    "completion_percentage": 1,
    "email": "example",
    "id": "example",
    "invite_scheduled_for": "example",
    "name": "example",
    "permission": "general",
    "phone_number": "example",
    "show_in_directory": true,
    "start_date": "example",
    "status": "active",
    "suites": [
      "example"
    ],
    "time_zone": "example",
    "title": "example"
  }
}
```

### Give a user a responsibility

Give an existing responsibility to a user.

**Inputs**

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

**Outputs**

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

**Example output**

```json
{
  "data": {
    "content_urls": [
      {
        "content_id": "example",
        "content_type": "example",
        "title": "example",
        "url": "example"
      }
    ],
    "created_at": "example",
    "description": "example",
    "id": "example",
    "name": "example",
    "updated_at": "example"
  }
}
```

### List activities

List what has happened in the account, newest first: content created, completed, edited and more.

**Inputs**

- User (`person_id`, number): Only activity this user did, or that was about or for them. At least 1.
- Type (`type`, text): Only activity of this kind. One of: `Creation`, `Completion`, `Test attempt`, `Deletion`, `Deletion recovered`, `Edit`, `Published`, `Team activity`, `Content requests`, `User was automatically archived`, and 5 more.
- After (`created_after`, date and time): Only activity from this time on.
- Before (`created_before`, date and time): Only activity up to this time.
- Page (`page_number`, number): Which page of activities to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many activities to return per page, up to 100. Trainual returns 10 if left empty. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "activity_type": "example",
        "created_at": "example",
        "id": "example",
        "key": "example",
        "owner_id": 1,
        "owner_type": "example",
        "recipient_id": 1,
        "recipient_type": "example",
        "trackable_id": 1,
        "trackable_type": "example"
      }
    ],
    "next_page": 1,
    "page": 1,
    "total_count": 1,
    "total_pages": 1
  }
}
```

### List assignments

List the content assigned to people, newest first.

**Inputs**

- User (`person_id`, number): Only this user's assignments. At least 1.
- Content type (`content_type`, text): The kind of content. Anything other than a subject is matched on the subject it belongs to. One of: `subject`, `document`, `page`, `video`, `test`, `checklist`, `flowchart`, `file`, `course`, `scorm_package` (SCORM package).
- Content ID (`content_id`, number): The ID of the content, of the type chosen in Content type. Leave Content type empty for a subject. At least 1.
- Sort (`sort`, text): The order to list them in. One of: `-created_at` (Created, newest first), `created_at` (Created, oldest first), `due_date_at` (Due date, soonest first), `-due_date_at` (Due date, latest first), `id` (Oldest first (by ID)), `-id` (Newest first (by ID)).
- Page (`page_number`, number): Which page of assignments to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many assignments to return per page, up to 100. Trainual returns 10 if left empty. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "assigner_id": 1,
        "completion_required": true,
        "content_id": 1,
        "content_type": "subject",
        "created_at": "example",
        "due_date_at": "example",
        "id": "example",
        "updated_at": "example",
        "user_id": 1
      }
    ],
    "next_page": 1,
    "page": 1,
    "total_count": 1,
    "total_pages": 1
  }
}
```

### List completions

List people's progress on content: scores, counts and when they finished.

**Inputs**

- User (`person_id`, number): Only this user's completions. At least 1.
- Content type (`content_type`, text): The kind of content. Anything other than a subject is matched on the subject it belongs to. One of: `subject`, `document`, `page`, `video`, `test`, `checklist`, `flowchart`, `file`, `course`, `scorm_package` (SCORM package).
- Content ID (`content_id`, number): The ID of the content, of the type chosen in Content type. Leave Content type empty for a subject. At least 1.
- Status (`status`, text): Only completions in this state. One of: `completed`, `uncompleted`, `active`, `inactive`.
- Sort (`sort`, text): The order to list them in. One of: `-created_at` (Created, newest first), `created_at` (Created, oldest first), `-completed_at` (Completed, newest first), `completed_at` (Completed, oldest first), `-updated_at` (Updated, newest first), `updated_at` (Updated, oldest first), `-score` (Score, highest first), `score` (Score, lowest first).
- Page (`page_number`, number): Which page of completions to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many completions to return per page, up to 100. Trainual returns 10 if left empty. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "completed_at": "example",
        "completed_content_count": 1,
        "content_id": 1,
        "content_type": "subject",
        "created_at": "example",
        "expired_at": "example",
        "id": "example",
        "score": 1,
        "total_content_count": 1,
        "updated_at": "example",
        "user_id": 1
      }
    ],
    "next_page": 1,
    "page": 1,
    "total_count": 1,
    "total_pages": 1
  }
}
```

### List groups

List the account's groups (roles, teams, departments and locations), by name.

**Inputs**

- Kind (`group_kind`, text): Only groups of this kind. One of: `role`, `team`, `department`, `location`, `other`.
- User (`person_id`, number): Only the groups this user belongs to. At least 1.
- Everyone group (`everyone`, true/false): Yes for only the account-wide Everyone group, No to leave it out.
- Page (`page_number`, number): Which page of groups to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many groups to return per page, up to 100. Trainual returns 10 if left empty. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "created_at": "example",
        "description": "example",
        "everyone": true,
        "id": "example",
        "kind": "role",
        "name": "example",
        "updated_at": "example"
      }
    ],
    "next_page": 1,
    "page": 1,
    "total_count": 1,
    "total_pages": 1
  }
}
```

### List responsibilities

List responsibilities, for everyone or for one user or group.

**Inputs**

- User (`person_id`, number): Only responsibilities this user has, directly or through a group. At least 1.
- Group (`group_id`, number): Only responsibilities given to this group. At least 1.
- Page (`page_number`, number): Which page of responsibilities to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many responsibilities to return per page, up to 100. Trainual returns 10 if left empty. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "content_urls": [
          {
            "content_id": "example",
            "content_type": "example",
            "title": "example",
            "url": "example"
          }
        ],
        "created_at": "example",
        "description": "example",
        "id": "example",
        "name": "example",
        "updated_at": "example"
      }
    ],
    "next_page": 1,
    "page": 1,
    "total_count": 1,
    "total_pages": 1
  }
}
```

### List subjects

List the subjects (courses of content) the token can see.

**Inputs**

- Page (`page_number`, number): Which page of subjects to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many subjects to return per page, up to 100. Trainual returns 10 if left empty. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "archived": true,
        "completion_required": true,
        "created_at": "example",
        "description": "example",
        "emoji": "example",
        "forced_order": true,
        "id": "example",
        "locked": true,
        "minutes_to_read": 1,
        "owner_id": 1,
        "published": true,
        "subject_type": "example",
        "title": "example",
        "updated_at": "example"
      }
    ],
    "next_page": 1,
    "page": 1,
    "total_count": 1,
    "total_pages": 1
  }
}
```

### List users

List the active people in the Trainual account.

**Inputs**

- Sort (`sort`, text): The order to list them in. One of: `id` (Oldest first (by ID)), `-id` (Newest first (by ID)), `created_at` (Created, oldest first), `-created_at` (Created, newest first), `updated_at` (Updated, oldest first), `-updated_at` (Updated, newest first).
- Page (`page_number`, number): Which page of users to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many users to return per page, up to 100. Trainual returns 10 if left empty. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "archived_scheduled_for": "example",
        "completion_percentage": 1,
        "email": "example",
        "id": "example",
        "invite_scheduled_for": "example",
        "name": "example",
        "permission": "general",
        "phone_number": "example",
        "show_in_directory": true,
        "start_date": "example",
        "status": "active",
        "suites": [
          "example"
        ],
        "time_zone": "example",
        "title": "example"
      }
    ],
    "next_page": 1,
    "page": 1,
    "total_count": 1,
    "total_pages": 1
  }
}
```

### Remove a user from a group

Take one person out of a group, keeping its other members.

**Inputs**

- Group (`group_id`, number, required): The group. At least 1.
- User (`person_id`, number, required): The user to remove. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "description": "example",
    "everyone": true,
    "id": "example",
    "kind": "role",
    "manager_ids": [
      "example"
    ],
    "name": "example",
    "updated_at": "example",
    "user_ids": [
      "example"
    ]
  }
}
```

### Restore a user

Bring back a person who was archived.

**Inputs**

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

**Outputs**

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

**Example output**

```json
{
  "data": {
    "archived_scheduled_for": "example",
    "completion_percentage": 1,
    "email": "example",
    "id": "example",
    "invite_scheduled_for": "example",
    "name": "example",
    "permission": "general",
    "phone_number": "example",
    "show_in_directory": true,
    "start_date": "example",
    "status": "active",
    "suites": [
      "example"
    ],
    "time_zone": "example",
    "title": "example"
  }
}
```

### Search content

Search published Trainual content by words, most relevant first.

**Inputs**

- Search for (`query`, text, required): The words to search for.
- Content types (`types`, list): Only these kinds of content. Leave empty to search all of them. One or more of: `subjects`, `documents`, `pages`, `tests`, `flowcharts`, `videos`, `files`, `checklists`, `courses`.
- Page (`page_number`, number): Which page of results to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many results per page, up to 25. From 1 to 25.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "created_at": "example",
        "description": "example",
        "id": "example",
        "owner_id": 1,
        "status": "example",
        "subject_id": 1,
        "title": "example",
        "type": "example",
        "updated_at": "example"
      }
    ],
    "next_page": 1,
    "page": 1,
    "total_count": 1,
    "total_pages": 1
  }
}
```

### Take a responsibility from a user

Take a responsibility away from a user. The responsibility itself stays.

**Inputs**

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

**Outputs**

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

**Example output**

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

### Unassign content

Delete an assignment, unassigning the content from the user.

**Inputs**

- Assignment ID (`assignment_id`, number, required): The assignment's ID. At least 1.

**Outputs**

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

**Example output**

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

### Update a group

Rename a group, change its kind or description, or replace its members.

**Inputs**

- Group (`group_id`, number, required): The group. At least 1.
- Name (`name`, text): The group's new name. Leave empty to keep it.
- Description (`description`, text): What the group is for.
- Kind (`group_kind`, text): What sort of group it is. One of: `role`, `team`, `department`, `location`, `other`.
- Members (`member_ids`, list): The users in the group. On an update this replaces every member.
- Managers (`manager_ids`, list): The users who manage the group.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "description": "example",
    "everyone": true,
    "id": "example",
    "kind": "role",
    "name": "example",
    "updated_at": "example"
  }
}
```

### Update a user

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

**Inputs**

- User (`person_id`, number, required): The Trainual user. At least 1.
- Name (`name`, text): The person's full name.
- Email (`email`, text): Their email address, which they sign in with.
- Job title (`title`, text): Their job title.
- Permission (`permission`, text): What they can do in Trainual. General users can only view and complete content. One of: `general`, `contributor`, `author`, `admin`, `billing_admin` (Billing admin).
- Phone number (`phone_number`, text): Their phone number.
- Start date (`start_date`, date): The day they start.
- Time zone (`time_zone`, text): Their time zone, as Trainual names it, such as `America/Los_Angeles`.
- Show in directory (`show_in_directory`, true/false): Whether they appear in the company directory.
- Manager (`manager_id`, number): The user they report to. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "archived_scheduled_for": "example",
    "completion_percentage": 1,
    "email": "example",
    "id": "example",
    "invite_scheduled_for": "example",
    "name": "example",
    "permission": "general",
    "phone_number": "example",
    "show_in_directory": true,
    "start_date": "example",
    "status": "active",
    "suites": [
      "example"
    ],
    "time_zone": "example",
    "title": "example"
  }
}
```
