# Courses

`GET https://api.tentary.com/v1/courses`

Source: https://tentary.com/en/help/api/list-courses/
Area: Courses
MCP tool: `list_courses`. Reads only. Changes nothing in the account.

---

The online courses of the account: name, number of lessons (drafts included) and the products that give access.

- Archived courses are left out.
- `legacy_courses` are old courses that nobody has opened in the new course editor yet.

For the modules, lessons and number of participants of one course, call [`GET /v1/courses/{course_id}`](https://tentary.com/en/help/api/get-course-outline/).

## Authorization

`Authorization: Bearer <API key>`

A personal API key (tnt_...). Create it in the Tentary app on the page AI & API.

## Response

- `courses` (array of object): The courses, newest first.
  - `id` (integer): The ID.
  - `name` (string): The name.
  - `lessons` (integer): Lessons, drafts included.
  - `products` (array of object): Products that give access.
    - `id` (integer): The ID.
    - `name` (string): Product name.
    - `status` (string): archived = deleted. Allowed values: `live`, `draft`, `archived`.
  - `admin_url` (string<uri>): The page in the Tentary app.
- `legacy_courses` (array of object): Old courses that the seller has not opened in the new course editor yet.
  - `product_id` (integer): The product ID.
  - `name` (string): The name.
  - `admin_url` (string<uri>): The page in the Tentary app.
- `truncated` (boolean): true = the account has more than 200 courses.
- `links` (object): Pages in the Tentary app or on tentary.com.
  - `courses` (string<uri>): Page in the Tentary app.

## Example request

```bash
curl "https://api.tentary.com/v1/courses" \
  -H "Authorization: Bearer $TENTARY_API_KEY"
```

## Example response

```json
{
  "courses": [
    {
      "id": 201,
      "name": "Morning Yoga in 30 Days",
      "lessons": 3,
      "products": [
        {
          "id": 102,
          "name": "Morning Yoga in 30 Days",
          "status": "live"
        },
        {
          "id": 104,
          "name": "Retreat Bundle",
          "status": "draft"
        }
      ],
      "admin_url": "https://app.tentary.com/courses/edit/201"
    }
  ],
  "legacy_courses": [],
  "truncated": false,
  "links": {
    "courses": "https://app.tentary.com/courses"
  }
}
```
