# Mosyle

> Manage Apple devices in Mosyle Business or Mosyle Manager: devices, tags, lost mode, users and groups.

App · 17 actions. Web page: https://docs.lodol.com/docs/integrations/mosyle

## Actions

### Add devices to a device group

Add devices to a device group. Mosyle Business only.

**Inputs**

- Device group ID (`device_group_id`, text, required): The device group's ID (from List device groups).
- Devices (`devices`, list, required): The devices to add, by the ID your Mosyle Business account uses for devices in groups.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "results": [
      {}
    ],
    "status": "example"
  }
}
```

### Add users to a user group

Add end users to a user group. Mosyle Business only.

**Inputs**

- User group ID (`user_group_id`, text, required): The user group's ID (from List user groups).
- Users (`users`, list, required): The users' IDs in Mosyle (their `iduser`).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "results": [
      {}
    ],
    "status": "example"
  }
}
```

### Assign a device to a user

Assign a device, found by its serial number, to a user.

**Inputs**

- Serial number (`serial_number`, text, required): The device's serial number.
- User (`user`, text, required): The user: their ID in Mosyle (the `iduser` in Mosyle Business, the user ID in Mosyle Manager).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "results": [
      {}
    ],
    "status": "example"
  }
}
```

### Clear devices' pending commands

Cancel the commands still waiting to reach devices. Mosyle Manager only.

**Inputs**

- Device UDIDs (`device_udids`, list, required): The devices' UDIDs (the `deviceudid` List devices returns).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "results": [
      {}
    ],
    "status": "example"
  }
}
```

### Create a user

Create a user (an end user in Mosyle Business, a student or teacher in Mosyle Manager).

**Inputs**

- User ID (`user_id_text`, text, required): The user's ID, such as their username. Mosyle uses it to match the user.
- Name (`name`, text, required): The user's full name.
- Email (`email`, text): The user's email address.
- School role (`school_role`, text): Student or teacher. Mosyle Manager only; Student when left empty. One of: `student`, `teacher`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "results": [
      {}
    ],
    "status": "example"
  }
}
```

### Create a user group

Create a user group. Mosyle Business only.

**Inputs**

- Name (`name`, text, required): The group's name.
- Identifier (`identifier`, text, required): A unique identifier for the group, such as `engineering`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "results": [
      {}
    ],
    "status": "example"
  }
}
```

### List classes

List classes with their teachers and students. Mosyle Manager only.

**Inputs**

- Page (`page`, number): The page to read, from 1. At least 1. Default: `1`.
- Page size (`page_size`, number): How many records a page holds. From 1 to 1000. Default: `100`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "classes": [
      {
        "class_name": "example",
        "coordinators": [
          "example"
        ],
        "id": "example",
        "location": "example",
        "students": [
          "example"
        ],
        "teacher": [
          "example"
        ]
      }
    ],
    "page": 1,
    "page_size": 1,
    "rows": 1
  }
}
```

### List device groups

List the device groups for one kind of device.

**Inputs**

- Device type (`os`, text, required): The kind of device. One of: `ios`, `mac`, `tvos`, `visionos`.
- Page (`page`, number): The page to read, from 1. At least 1. Default: `1`.
- Page size (`page_size`, number): How many records a page holds. From 1 to 1000. Default: `100`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "groups": [
      {
        "device_numbers": "example",
        "id": "example",
        "name": "example"
      }
    ],
    "page": 1,
    "page_size": 1,
    "rows": 1
  }
}
```

### List devices

List the devices of one kind (Mac, iPhone and iPad, Apple TV or Vision Pro), optionally only some serial numbers or tags.

**Inputs**

- Device type (`os`, text, required): The kind of device. One of: `ios`, `mac`, `tvos`, `visionos`.
- Serial numbers (`serial_numbers`, list): Only these serial numbers.
- Tags (`tags`, list): Only devices with these tags.
- Fields to return (`columns`, list): Only return these device fields (such as `deviceudid`, `serial_number`, `device_name`, `tags`). Leave empty for all.
- Page (`page`, number): The page to read, from 1. At least 1. Default: `1`.
- Page size (`page_size`, number): How many records a page holds. From 1 to 1000. Default: `100`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "devices": [
      {
        "date_last_beat": "example",
        "device_model": "example",
        "device_name": "example",
        "deviceudid": "example",
        "lostmode_status": "example",
        "os": "example",
        "osversion": "example",
        "serial_number": "example",
        "status": "example",
        "tags": "example",
        "useremail": "example",
        "userid": "example",
        "username": "example"
      }
    ],
    "page": 1,
    "page_size": 1,
    "rows": 1
  }
}
```

### List user groups

List user groups. Mosyle Business only.

**Inputs**

- Page (`page`, number): The page to read, from 1. At least 1. Default: `1`.
- Page size (`page_size`, number): How many records a page holds. From 1 to 1000. Default: `100`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "page": 1,
    "page_size": 1,
    "rows": 1,
    "user_groups": [
      {
        "id": "example",
        "identifier": "example",
        "idusergroup": "example",
        "name": "example"
      }
    ]
  }
}
```

### List users

List users, optionally only some user IDs (or, in Mosyle Business, emails).

**Inputs**

- User IDs (`identifiers`, list): Only these user IDs.
- Emails (`emails`, list): Only these email addresses. Mosyle Business only.
- Page (`page`, number): The page to read, from 1. At least 1. Default: `1`.
- Page size (`page_size`, number): How many records a page holds. From 1 to 1000. Default: `100`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "page": 1,
    "page_size": 1,
    "rows": 1,
    "users": [
      {
        "email": "example",
        "id": "example",
        "iduser": "example",
        "managedappleid": "example",
        "name": "example",
        "type": "example"
      }
    ]
  }
}
```

### Play a sound on a lost device

Play a sound on devices in lost mode, to help find them. Mosyle Manager only.

**Inputs**

- Device UDIDs (`device_udids`, list, required): The devices' UDIDs (the `deviceudid` List devices returns).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "results": [
      {}
    ],
    "status": "example"
  }
}
```

### Remove users from a user group

Take end users out of a user group. Mosyle Business only.

**Inputs**

- User group ID (`user_group_id`, text, required): The user group's ID (from List user groups).
- Users (`users`, list, required): The users' IDs in Mosyle (their `iduser`).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "results": [
      {}
    ],
    "status": "example"
  }
}
```

### Restart devices

Send devices the command to restart.

**Inputs**

- Device UDIDs (`device_udids`, list, required): The devices' UDIDs (the `deviceudid` List devices returns).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "results": [
      {}
    ],
    "status": "example"
  }
}
```

### Set a device's tags

Set the tags of a device, found by its serial number.

**Inputs**

- Serial number (`serial_number`, text, required): The device's serial number.
- Tags (`tags`, list, required): The device's tags.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "results": [
      {}
    ],
    "status": "example"
  }
}
```

### Turn off lost mode

Turn off lost mode. Mosyle Manager only.

**Inputs**

- Device UDIDs (`device_udids`, list, required): The devices' UDIDs (the `deviceudid` List devices returns).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "results": [
      {}
    ],
    "status": "example"
  }
}
```

### Turn on lost mode

Turn on lost mode on supervised iPhones and iPads, with a message for whoever finds them. Mosyle Manager only.

**Inputs**

- Device UDIDs (`device_udids`, list, required): The devices' UDIDs (the `deviceudid` List devices returns).
- Message (`message`, text): The message shown on the device's screen.
- Phone number (`phone_number`, text): A phone number shown on the device's screen.
- Footnote (`footnote`, text): A footnote shown on the device's screen.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "results": [
      {}
    ],
    "status": "example"
  }
}
```
