> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search CourseLessons

> Search and list CourseLesson records with filtering, sorting, and pagination.

A **CourseLesson** is an individual learning unit within a Course. Lessons are the building blocks that customers complete to work through a course's content. Each lesson belongs to a `Course` and optionally to a `CourseSection` that groups related lessons together.

Lessons have two key behavioural settings:

**`UnlockType`** — controls when a lesson becomes available to enrolled members:

| Value      | Meaning                                                        |
| ---------- | -------------------------------------------------------------- |
| Immediate  | Available as soon as the member enrols                         |
| Sequential | Unlocked only after the previous lesson is completed           |
| Timed      | Unlocked after a number of days specified by `UnlockAfterDays` |

**`CompletionType`** — defines what action marks the lesson as done:

| Value   | Meaning                                                                    |
| ------- | -------------------------------------------------------------------------- |
| None    | No completion tracking                                                     |
| Visited | Marked complete when the member opens the lesson                           |
| Button  | Member must click a completion button                                      |
| Video   | Member must finish watching the embedded video (must be hosted on YouTube) |

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`CourseLesson-List`** role.
</Note>

## Enums

<Accordion title="eLessonUnlockType — UnlockType values">
  | Value | Name       |
  | ----- | ---------- |
  | 1     | Immediate  |
  | 2     | Sequential |
  | 3     | Timed      |
</Accordion>

<Accordion title="eLessonCompletionType — CompletionType values">
  | Value | Name    |
  | ----- | ------- |
  | 1     | None    |
  | 2     | Visited |
  | 3     | Button  |
  | 4     | Video   |
</Accordion>

## Query Parameters

### Pagination & Sorting

<ParamField query="page" type="integer" default="1">
  The page number to retrieve.
</ParamField>

<ParamField query="size" type="integer" default="25">
  The number of records per page.
</ParamField>

<ParamField query="orderBy" type="string">
  The property name to sort results by (e.g. `Name`, `CreatedOn`).
</ParamField>

<ParamField query="dir" type="integer">
  Sort direction. `0` for ascending, `1` for descending.
</ParamField>

### Filters

<ParamField query="CourseLesson_Course" type="integer">
  Filter by iD of the course this lesson belongs to.
</ParamField>

<ParamField query="CourseLesson_Course_Title" type="string">
  Filter by title of the parent course.
</ParamField>

<ParamField query="CourseLesson_Section" type="integer">
  Filter by iD of the course section this lesson belongs to (optional; lessons without a section appear ungrouped).
</ParamField>

<ParamField query="CourseLesson_Section_DisplayOrder" type="integer">
  Filter by display order of the parent section.
</ParamField>

<ParamField query="CourseLesson_Section_Title" type="string">
  Filter by title of the parent section.
</ParamField>

<ParamField query="CourseLesson_Instructor" type="integer">
  Filter by iD of the coworker attributed as instructor for this lesson (optional; overrides the course-level host for this lesson).
</ParamField>

<ParamField query="CourseLesson_Instructor_FullName" type="string">
  Filter by instructor full name.
</ParamField>

<ParamField query="CourseLesson_Instructor_CompanyName" type="string">
  Filter by instructor company name.
</ParamField>

<ParamField query="CourseLesson_Instructor_TeamNames" type="string">
  Filter by comma-separated list of teams the instructor belongs to.
</ParamField>

<ParamField query="CourseLesson_Title" type="string">
  Filter by lesson title displayed to members.
</ParamField>

<ParamField query="CourseLesson_SummaryText" type="string">
  Filter by short summary shown in the lesson listing.
</ParamField>

<ParamField query="CourseLesson_LessonContents" type="string">
  Filter by full HTML or rich-text body of the lesson displayed to members when they open it.
</ParamField>

<ParamField query="CourseLesson_Active" type="boolean">
  Filter by whether the lesson is active and visible to enrolled members.
</ParamField>

<ParamField query="CourseLesson_DisplayOrder" type="integer">
  Filter by position of the lesson within its section (or the course if unsectioned); lower numbers appear first.
</ParamField>

<ParamField query="CourseLesson_UnlockType" type="integer">
  Filter by when the lesson becomes available: Immediate (1), after the previous lesson is done — Sequential (2), or after a set number of days — Timed (3).
</ParamField>

<ParamField query="CourseLesson_ImageFileName" type="string">
  Filter by stored filename of the lesson thumbnail image (read-only; use `NewImageUrl` to set).
</ParamField>

<ParamField query="CourseLesson_NewImageUrl" type="string">
  Filter by uRL of a new thumbnail image to upload (JPG/JPEG, PNG, or GIF, max 10 MB).
</ParamField>

<ParamField query="CourseLesson_ClearImage" type="boolean">
  Filter by set to true to remove the existing thumbnail image.
</ParamField>

<ParamField query="CourseLesson_UnlockAfterDays" type="integer">
  Filter by number of days after enrolment before the lesson unlocks; only used when UnlockType is Timed (3).
</ParamField>

<ParamField query="CourseLesson_CompletionType" type="integer">
  Filter by how completion is tracked: None (1), Visited (2), completion Button (3), or Video watched (4). Video completion requires the lesson to embed a YouTube-hosted video..
</ParamField>

### Range Filters

<ParamField query="from_CourseLesson_SectionDisplayOrder" type="integer">
  Filter by display order of the parent section greater than or equal to this value.
</ParamField>

<ParamField query="to_CourseLesson_SectionDisplayOrder" type="integer">
  Filter by display order of the parent section less than or equal to this value.
</ParamField>

<ParamField query="from_CourseLesson_DisplayOrder" type="integer">
  Filter by position of the lesson within its section (or the course if unsectioned); lower numbers appear first greater than or equal to this value.
</ParamField>

<ParamField query="to_CourseLesson_DisplayOrder" type="integer">
  Filter by position of the lesson within its section (or the course if unsectioned); lower numbers appear first less than or equal to this value.
</ParamField>

<ParamField query="from_CourseLesson_UnlockAfterDays" type="integer">
  Filter by number of days after enrolment before the lesson unlocks; only used when UnlockType is Timed (3) greater than or equal to this value.
</ParamField>

<ParamField query="to_CourseLesson_UnlockAfterDays" type="integer">
  Filter by number of days after enrolment before the lesson unlocks; only used when UnlockType is Timed (3) less than or equal to this value.
</ParamField>

<ParamField query="from_CourseLesson_CreatedOn" type="string">
  Filter records created on or after this date. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="to_CourseLesson_CreatedOn" type="string">
  Filter records created on or before this date. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="from_CourseLesson_UpdatedOn" type="string">
  Filter records updated on or after this date. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="to_CourseLesson_UpdatedOn" type="string">
  Filter records updated on or before this date. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

## Code Examples

### Simple listing

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    "https://spaces.nexudus.com/api/content/courselessons?page=1&size=15&orderBy=Title&dir=0" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/content/courselessons?' + new URLSearchParams({
      page: 1,
      size: 15,
      orderBy: 'Title',
      dir: 1 // Ascending
    }),
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://spaces.nexudus.com/api/content/courselessons',
      params={
          'page': 1,
          'size': 15,
          'orderBy': 'Title',
          'dir': 0 // Ascending
      },
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

  data = response.json()
  ```
</CodeGroup>

### Filtering by Title

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    "https://spaces.nexudus.com/api/content/courselessons?CourseLesson_Title=example-value&orderBy=Title&dir=0" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/content/courselessons?' + new URLSearchParams({
      CourseLesson_Title: 'example-value',
      orderBy: 'Title',
      dir: 1
    }),
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://spaces.nexudus.com/api/content/courselessons',
      params={
          'CourseLesson_Title': 'example-value',
          'orderBy': 'Title',
          'dir': 0 // Ascending
      },
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

  data = response.json()
  ```
</CodeGroup>

### Range filters

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    "https://spaces.nexudus.com/api/content/courselessons?from_CourseLesson_UpdatedOn=2025-01-01T00:00&to_CourseLesson_UpdatedOn=2025-12-31T23:59&orderBy=UpdatedOn&dir=0" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/content/courselessons?' + new URLSearchParams({
      from_CourseLesson_UpdatedOn: '2025-01-01T00:00',
      to_CourseLesson_UpdatedOn: '2025-12-31T23:59',
      orderBy: 'UpdatedOn',
      dir: 1 // Descending
     }),
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://spaces.nexudus.com/api/content/courselessons',
      params={
          'from_CourseLesson_UpdatedOn': '2025-01-01T00:00',
          'to_CourseLesson_UpdatedOn': '2025-12-31T23:59',
          'orderBy': 'UpdatedOn',
          'dir': 1 // Descending
      },
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="Records" type="CourseLesson[]">
  The list of CourseLesson records matching the query. See the [Get one CourseLesson](/rest-api/content/get-courselessons-by-id) endpoint for the full list of properties returned for each record.
</ResponseField>

<Warning>
  **Partial records** — The listing endpoint returns a summary representation of each CourseLesson. The following fields are **not populated** in the `Records[]` response: `LessonContents`, `UnlockType`, `CompletionType`.

  To get all fields, fetch the full record using the [Get one CourseLesson](/rest-api/content/get-courselessons-by-id) endpoint.

  **Important for updates:** When updating a record via `PUT`, always retrieve the full record with a `GET` request first, apply your changes to that complete data, and then send the updated record. Do not use data from a listing response as the base for a `PUT` request, as missing fields may be unintentionally cleared.
</Warning>

<ResponseField name="CurrentPage" type="integer">
  Current page number.
</ResponseField>

<ResponseField name="CurrentPageSize" type="integer">
  Number of records per page.
</ResponseField>

<ResponseField name="CurrentOrderField" type="string">
  The field used for sorting.
</ResponseField>

<ResponseField name="CurrentSortDirection" type="integer">
  The sort direction (`0` = ascending, `1` = descending).
</ResponseField>

<ResponseField name="FirstItem" type="integer">
  Index of the first item on the current page.
</ResponseField>

<ResponseField name="LastItem" type="integer">
  Index of the last item on the current page.
</ResponseField>

<ResponseField name="TotalItems" type="integer">
  Total number of matching records across all pages.
</ResponseField>

<ResponseField name="TotalPages" type="integer">
  Total number of pages.
</ResponseField>

<ResponseField name="HasNextPage" type="boolean">
  Whether there is a next page of results.
</ResponseField>

<ResponseField name="HasPreviousPage" type="boolean">
  Whether there is a previous page of results.
</ResponseField>

```json Example Response theme={null}
{
  "Records": [
    {
      "CourseId": 0,
      "CourseTitle": null,
      "SectionId": null,
      "SectionDisplayOrder": null,
      "SectionTitle": null,
      "InstructorId": null,
      "InstructorFullName": null,
      "InstructorCompanyName": null,
      "InstructorTeamNames": null,
      "Title": "",
      "SummaryText": null,
      "Active": false,
      "DisplayOrder": 0,
      "ImageFileName": null,
      "NewImageUrl": null,
      "ClearImageFile": null,
      "UnlockAfterDays": 0,
      "Id": 87654321,
      "UpdatedOn": "2025-01-15T10:30:00Z",
      "CreatedOn": "2025-01-10T08:00:00Z",
      "UniqueId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "UpdatedBy": "admin@example.com",
      "IsNew": false,
      "SystemId": null,
      "ToStringText": "CourseLesson Example",
      "LocalizationDetails": null,
      "CustomFields": null
    }
  ],
  "CurrentPageSize": 15,
  "CurrentPage": 1,
  "CurrentOrderField": "Title",
  "CurrentSortDirection": 1,
  "FirstItem": 1,
  "HasNextPage": false,
  "HasPreviousPage": false,
  "LastItem": 1,
  "PageNumber": 1,
  "PageSize": 15,
  "TotalItems": 1,
  "TotalPages": 1
}
```
