# Courses

## All Courses

<mark style="color:blue;">`GET`</mark> `https://yoursite.mavenseed.com/api/v1/courses`

Retrieve all courses

#### Path Parameters

| Name | Type    | Description            |
| ---- | ------- | ---------------------- |
| page | integer | Results are paginated. |

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | Auth token  |

{% tabs %}
{% tab title="200 Returns an array of courses. Only the first 20 are returned. Passing the page param will paginate the results.
" %}

```ruby
[
    {
        "id": 5,
        "title": "Creating a Realistic 3D Photo Scanned Pumpkin",
        "slug": "creating-a-realistic-3d-photo-scanned-pumpkin",
        "status": "published",
        "created_at": "2019-02-20T14:15:01.393-05:00",
        "updated_at": "2019-03-13T00:25:50.419-04:00",
        "scheduled_at": "2019-02-21T12:00:00.000-05:00",
        "published_at": null,
        "excerpt": "In this Blender tutorial course, we’ll be using Meshroom, a free photogrammetry software, and Blender 3D to create a realistic 3D scanned pumpkin!\t",
        "free": true,
        "questions_enabled": true
    },
    {
        "id": 6,
        "title": "Fundamentals of Lighting in Unity",
        "slug": "fundamentals-of-lighting-in-unity",
        "status": "published",
        "created_at": "2019-02-22T11:17:18.814-05:00",
        "updated_at": "2019-02-22T11:37:17.599-05:00",
        "scheduled_at": "2019-02-21T12:00:00.000-05:00",
        "published_at": null,
        "excerpt": "Learn the fundamentals of global illumination in Unity. Adjust ambient lighting, skyboxes, lightmaps then take a look at the individual lights to improve the mood of your game.",
        "free": false,
        "questions_enabled": true
    }
]
```

{% endtab %}
{% endtabs %}

## Show Course

<mark style="color:blue;">`GET`</mark> `https://yoursite.mavenseed.com/api/v1/courses/:id`

Retrieve a single course

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | Auth token  |

{% tabs %}
{% tab title="200 " %}

```ruby
{
    "id": 5,
    "title": "Creating a Realistic 3D Photo Scanned Pumpkin",
    "slug": "creating-a-realistic-3d-photo-scanned-pumpkin",
    "status": "published",
    "created_at": "2019-02-20T14:15:01.393-05:00",
    "updated_at": "2019-03-13T00:25:50.419-04:00",
    "scheduled_at": "2019-02-21T12:00:00.000-05:00",
    "published_at": null,
    "excerpt": "In this Blender tutorial course, we’ll be using Meshroom, a free photogrammetry software, and Blender 3D to create a realistic 3D scanned pumpkin!\t",
    "free": true,
    "questions_enabled": true
}
```

{% endtab %}

{% tab title="404 " %}

```ruby
null
```

{% endtab %}
{% endtabs %}

## Create Course

<mark style="color:green;">`POST`</mark> `https://yoursite.mavenseed.com/api/v1/courses`

Create a course.

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | Auth Token  |

#### Request Body

| Name               | Type    | Description                               |
| ------------------ | ------- | ----------------------------------------- |
| title              | string  | Title of the course                       |
| status             | integer | 0 - draft, 1 - published                  |
| scheduled\_at      | string  | Optional datetime if course is scheduled  |
| published\_at      | string  | Published date in datetime format         |
| excerpt            | string  | Course excerpt                            |
| free               | boolean | Whether or not the course is free         |
| questions\_enabled | boolean | Should questions be enabled on the course |

{% tabs %}
{% tab title="201 " %}

```ruby
{
    "id": 5,
    "title": "Creating a Realistic 3D Photo Scanned Pumpkin",
    "slug": "creating-a-realistic-3d-photo-scanned-pumpkin",
    "status": "published",
    "created_at": "2019-02-20T14:15:01.393-05:00",
    "updated_at": "2019-03-13T00:25:50.419-04:00",
    "scheduled_at": "2019-02-21T12:00:00.000-05:00",
    "published_at": null,
    "excerpt": "In this Blender tutorial course, we’ll be using Meshroom, a free photogrammetry software, and Blender 3D to create a realistic 3D scanned pumpkin!\t",
    "free": true,
    "questions_enabled": true
}
```

{% endtab %}
{% endtabs %}

## Update Course

<mark style="color:purple;">`PATCH`</mark> `https://yoursite.mavenseed.com/api/v1/courses/:id`

Update a single course. All of the above properties in create course are valid.

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | Auth token  |

{% tabs %}
{% tab title="200 " %}

```ruby
{
    "id": 5,
    "title": "Creating a Realistic 3D Photo Scanned Pumpkin",
    "slug": "creating-a-realistic-3d-photo-scanned-pumpkin",
    "status": "published",
    "created_at": "2019-02-20T14:15:01.393-05:00",
    "updated_at": "2019-03-13T00:25:50.419-04:00",
    "scheduled_at": "2019-02-21T12:00:00.000-05:00",
    "published_at": null,
    "excerpt": "In this Blender tutorial course, we’ll be using Meshroom, a free photogrammetry software, and Blender 3D to create a realistic 3D scanned pumpkin!\t",
    "free": true,
    "questions_enabled": true
}
```

{% endtab %}
{% endtabs %}

## Delete a Course

<mark style="color:red;">`DELETE`</mark> `https://yoursite.mavenseed.com/api/v1/courses/:id`

Delete a course.

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | Auth toke   |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mavenseed.com/developers/api/courses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
