headless lms

Add an activity

POST /api/courses/{courseId}/modules/{moduleId}/activities. Add an activity. Headless LMS Content API reference.

POST
/api/courses/{courseId}/modules/{moduleId}/activities

Requires courses:write. Records the library files the activity uses; each must be a ready library file (409 otherwise). A file the course does not already use must be uploaded for the course, or the caller needs media:read (403 otherwise). Returns the course's modules.

Path Parameters

courseId*string
moduleId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/courses/string/modules/string/activities" \  -H "Content-Type: application/json" \  -d '{}'
[  {    "orgId": "string",    "id": "string",    "courseId": "string",    "title": "string",    "seq": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }]
{  "error": "string",  "message": "string",  "requestId": "string",  "issues": [    {      "path": "string",      "message": "string"    }  ]}
{  "error": "string",  "message": "string",  "requestId": "string"}
{  "error": "string",  "message": "string",  "requestId": "string"}
{  "error": "string",  "message": "string",  "requestId": "string"}
{  "error": "string",  "message": "string",  "requestId": "string"}
{  "error": "string",  "message": "string",  "requestId": "string"}