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

# Courses Overview

> Import and manage online courses, lessons, categories, and membership products using the HoopAI Platform REST API. Automate course delivery and content structure for your membership sites.

The Courses API lets you programmatically import and manage online courses, lesson content, categories, and membership products on the HoopAI Platform. Use it to migrate existing course libraries into the platform, automate content updates, and keep your membership product catalog in sync with external systems. The API supports rich course structures including nested categories, sub-categories, individual lesson posts, attached materials, and instructor details — giving you full control over how courses are organized and delivered to your members.

## Base URL

```
https://services.leadconnectorhq.com
```

## Authentication

All requests require a Bearer token in the `Authorization` header. Obtain tokens through the [OAuth 2.0 flow](/api-reference/oauth/overview).

```http theme={null}
Authorization: Bearer <access_token>
Version: 2021-07-28
```

The `Version` header is required on every request and must be set to `2021-07-28`.

## OAuth scopes

| Scope              | Access                                                            |
| ------------------ | ----------------------------------------------------------------- |
| `courses.readonly` | Read course data, categories, and lesson content                  |
| `courses.write`    | Full read and write access including import and update operations |

## Quick start

Import a course into a location:

```bash theme={null}
curl --request POST \
  --url 'https://services.leadconnectorhq.com/courses/courses-exporter/public/import' \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Version: 2021-07-28' \
  --header 'Content-Type: application/json' \
  --data '{
    "locationId": "YOUR_LOCATION_ID",
    "products": [
      {
        "title": "Intro to Basketball Analytics",
        "description": "A foundational course on basketball data and analytics.",
        "categories": [
          {
            "title": "Module 1 — Fundamentals",
            "visibility": "published",
            "posts": [
              {
                "title": "Lesson 1 — Reading the Box Score",
                "visibility": "published",
                "contentType": "video",
                "description": "Learn how to interpret standard box score statistics."
              }
            ]
          }
        ]
      }
    ]
  }'
```

## Endpoints

| Method | Path                                      | Description                                |
| ------ | ----------------------------------------- | ------------------------------------------ |
| `POST` | `/courses/courses-exporter/public/import` | Import one or more courses into a location |

## Course structure

When importing courses, the request body follows a nested structure:

| Field                          | Type   | Description                                   |
| ------------------------------ | ------ | --------------------------------------------- |
| `locationId`                   | string | The location to import courses into           |
| `userId`                       | string | Optional. The user performing the import      |
| `products`                     | array  | Array of course product objects               |
| `products[].title`             | string | Course title                                  |
| `products[].description`       | string | Course description                            |
| `products[].imageUrl`          | string | Course thumbnail URL                          |
| `products[].categories`        | array  | Top-level categories (modules)                |
| `products[].instructorDetails` | object | Instructor name and description               |
| `categories[].title`           | string | Category (module) title                       |
| `categories[].visibility`      | string | `published` or `draft`                        |
| `categories[].posts`           | array  | Lessons within this category                  |
| `categories[].subCategories`   | array  | Nested sub-categories                         |
| `posts[].title`                | string | Lesson title                                  |
| `posts[].contentType`          | string | `video`, `assignment`, or `quiz`              |
| `posts[].visibility`           | string | `published` or `draft`                        |
| `posts[].description`          | string | Lesson description                            |
| `posts[].bucketVideoUrl`       | string | Video URL for video lessons                   |
| `posts[].postMaterials`        | array  | Downloadable materials attached to the lesson |

## Related

* [OAuth 2.0 overview](/api-reference/oauth/overview) — how to obtain and refresh access tokens
* [Contacts API](/api-reference/contacts/overview) — manage the members enrolled in your courses
* [Payments API](/api-reference/payments/overview) — sell course access through products and subscriptions
