# Sana

> Browse and manage Sana Learn users, groups, programs, courses, and teamspaces.

App · 18 actions. Web page: https://docs.lodol.com/docs/integrations/sana

## Actions

### Create a group

Create a group in your Sana Learn organization.

**Inputs**

- Name (`record_name`, text, required): The name of the group
- Type (`type`, text): Type of group: program, user, user_manual. One of: `program`, `user`, `user_manual` (User manual).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "id": "example",
      "name": "example",
      "type": "example"
    }
  }
}
```

### Create a user

Create a user in your Sana Learn organization.

**Inputs**

- Email (`email`, text, required): The user's email address
- First name (`first_name`, text): The first name of the user
- Last name (`last_name`, text): The last name of the user
- Role (`role`, text): One of `learner`, `group-admin` or `admin`. One of: `learner`, `group-admin`, `admin`.
- Language (`language`, text): A language tag (IETF BCP 47) supported by your organization.
- Custom attributes (`custom_attributes`, text): For storing arbitrary key/value pairs. The keyset needs to be pre-configured.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "createdAt": "example",
      "customAttributes": {},
      "email": "example",
      "firstName": "example",
      "id": "example",
      "inviteLink": "example",
      "language": "example",
      "lastName": "example",
      "role": "example",
      "status": "example"
    }
  }
}
```

### Delete a group

Delete a group in your Sana Learn organization.

**Inputs**

- Group (`group_id`, text, required): Group id.

**Outputs**

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

**Example output**

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

### Get a course

Get a course in your Sana Learn organization.

**Inputs**

- Course (`course_id`, text, required): Course id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "contentAttributes": {
        "categoryIds": [],
        "customAttributes": []
      },
      "defaultDuration": false,
      "description": "example",
      "durationMinutes": 1,
      "externalId": "example",
      "id": "example",
      "imageUrl": "example",
      "tags": [],
      "title": "example",
      "type": "example"
    }
  }
}
```

### Get a group

Get a group in your Sana Learn organization.

**Inputs**

- Group (`group_id`, text, required): Group id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "id": "example",
      "name": "example",
      "type": "example"
    }
  }
}
```

### Get a program

Get a program in your Sana Learn organization.

**Inputs**

- Program (`program_id`, text, required): Program id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "description": "example",
      "id": "example",
      "imageUrl": "example",
      "name": "example",
      "selfEnrollmentEnabled": false
    }
  }
}
```

### Get a teamspace

Get a teamspace in your Sana Learn organization.

**Inputs**

- Teamspace (`teamspace_id`, text, required): Teamspace id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "teamspace": {
        "defaultRole": "example",
        "description": "example",
        "id": "example",
        "isPrivate": false,
        "managedViaApi": false,
        "name": "example"
      }
    }
  }
}
```

### Get a user

Get a user in your Sana Learn organization.

**Inputs**

- User (`record_user_id`, text, required): User id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "activatedAt": "example",
      "createdAt": "example",
      "customAttributes": {},
      "disabled": false,
      "email": "example",
      "firstName": "example",
      "id": "example",
      "isManager": false,
      "isSsoEmail": false,
      "lastInviteSentAt": "example",
      "lastName": "example",
      "role": "example",
      "status": "example",
      "type": "example"
    }
  }
}
```

### List all groups

List all groups in your Sana Learn organization.

**Inputs**

- Next (`next`, text): Set to fetch the next batch of groups.
- Limit (`limit`, number): The number of groups to return. Max: 1000. From 1 to 1000.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "links": {
      "next": "example"
    }
  }
}
```

### List all programs

List all programs in your Sana Learn organization.

**Inputs**

- Next (`next`, text): Set to fetch the next batch of programs.
- Limit (`limit`, number): The number of programs to return. Max: 1000. From 1 to 1000.
- Only with self enrollment (`only_with_self_enrollment`, true/false): List only programs with self-enrollment.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "links": {
      "next": "example"
    }
  }
}
```

### List all teamspaces

List all teamspaces in your Sana Learn organization.

**Inputs**

- Next (`next`, text): Set to fetch the next batch of teamspaces.
- Limit (`limit`, number): The number of teamspaces to return. Max: 1000. From 1 to 1000.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "links": {
      "next": "example"
    }
  }
}
```

### List all users

List all users in your Sana Learn organization.

**Inputs**

- Next (`next`, text): Set to fetch the next batch of users.
- Limit (`limit`, number): The number of users to return. Max: 1000. From 1 to 1000.
- Created after (`created_after`, date): Specify to fetch users created after this date (format: 2023-05-31)
- Email (`email`, text): Email address to filter users.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "links": {
      "next": "example"
    }
  }
}
```

### List all users in a group

List all users in a group in your Sana Learn organization.

**Inputs**

- Group (`group_id`, text, required): Group id.
- Next (`next`, text): Set to fetch the next batch of users.
- Limit (`limit`, number): The number of users to return. Max: 1000. From 1 to 1000.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "links": {
      "next": "example"
    }
  }
}
```

### List available reports

List available reports in your Sana Learn organization.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": []
  }
}
```

### List courses

List courses in your Sana Learn organization.

**Inputs**

- Next (`next`, text): Set to fetch the next batch of courses.
- Limit (`limit`, number): The number of courses to return. Max: 1000. From 1 to 1000.
- External ID (`external_id`, text): Set to fetch the course with matching external identifier.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [],
    "links": {
      "next": "example"
    }
  }
}
```

### List user assignments

List user assignments in your Sana Learn organization.

**Inputs**

- User (`record_user_id`, text, required): User id.
- Content type (`content_type`, text): Filter assignments using content types. Allowed values: `course`. One of: `course`.
- Identity type (`identity_type`, text): Filter assignments using identity types. Allowed values: `user`, `program`. One of: `user`, `program`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": []
  }
}
```

### Update a group

Update a group in your Sana Learn organization.

**Inputs**

- Group (`group_id`, text, required): Group id.
- Name (`record_name`, text): The name of the group

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "id": "example",
      "name": "example",
      "type": "example"
    }
  }
}
```

### Update a user

Update a user in your Sana Learn organization.

**Inputs**

- User (`record_user_id`, text, required): User id.
- Email (`email`, text): The user's email address
- First name (`first_name`, text): The first name of the user
- Last name (`last_name`, text): The last name of the user
- Disabled (`disabled`, true/false): If set to `true` the account is deactivated. If set to `false` the account is reactivated.
- Role (`role`, text): One of `learner`, `group-admin` or `admin`. One of: `learner`, `group-admin`, `admin`.
- Language (`language`, text): A language tag (IETF BCP 47) supported by your organization.
- Custom attributes (`custom_attributes`, text): For storing arbitrary key/value pairs. The keyset needs to be pre-configured.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "activatedAt": "example",
      "createdAt": "example",
      "customAttributes": {},
      "disabled": false,
      "email": "example",
      "firstName": "example",
      "id": "example",
      "isManager": false,
      "isSsoEmail": false,
      "lastName": "example",
      "role": "example",
      "status": "example",
      "type": "example"
    }
  }
}
```
