---
title: "Generate a course from a prompt (internal only)"
method: POST
path: "/api/v2/courses/generate-from-prompt"
tags: ["Courses"]
---

# Generate a course from a prompt (internal only)

`POST /api/v2/courses/generate-from-prompt`

> 🔑
>
> Required OAuth scope: `courses:internal`.

Triggers the generation of a course from a text prompt. This is an internal-only endpoint restricted to demo platforms. The course generation happens asynchronously, and you will receive an email notification when it completes. Retrieve the generated course using GET /courses sorted by created_at.

## Headers

- `360-api-version` 'v2.0', required

## Request body

- GenerateFromPromptBody
  - `prompt` string, required — The prompt to use for generating the course.
  - `authorId` string, ObjectId, required — The unique ID of the author of the course.
  - `groupId` string, ObjectId — The unique ID of the group where the course will be created.

## Response `200`

The course generation has been successfully triggered. The course will be created asynchronously.

## Other responses

- `400` — The user `userId` does not correspond to an editor in the company.
- `401` — The given access token is either missing, invalid, has expired, or has been revoked.
- `403` — The given access token does not have the required OAuth scope to execute the request.
- `404` — The given `groupId` does not correspond to any existing group.
- `429` — The client has sent too many requests in a short amount of time.

---

[API](https://skmtc.net/360learning/apis/core-api.md) · [All operations](https://skmtc.net/360learning/apis/core-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/360learning/core-api/revisions/94b691b0b72c/schema)
