Chapters

Chapter CRUD and ordering within courses.

10 endpointsAPI token or sessionToken right: ChaptersWorks with an lh_ API token or a user session. How auth works

Create chapter

POST/​api/​v1/​chapters/​
API token or user session. The token needs the Create right on Chapters (coursechapters:create).

Create a new chapter inside an existing course.

Request bodyapplication/jsonRequired

namestringRequired
descriptionstring | nullOptional
thumbnail_imagestring | nullOptional
lock_typeLockTypeOptional
One ofpublicauthenticatedrestricted
org_idintegerRequired
course_idintegerRequired
extra_metadataExtra Metadata | nullOptional

Responses4

200Chapter created successfullyChapterRead
namestringRequired
descriptionstring | null
thumbnail_imagestring | null
lock_typeLockType
One ofpublicauthenticatedrestricted
org_idintegerRequired
course_idintegerRequired
idintegerRequired
activitiesActivityRead[]Required
20 child attributes
namestringRequired
activity_typeActivityTypeEnumRequired
One ofTYPE_VIDEOTYPE_DOCUMENTTYPE_DYNAMICTYPE_ASSIGNMENTTYPE_CUSTOMTYPE_SCORMTYPE_LIVE_SESSION
activity_sub_typeActivitySubTypeEnumRequired
One ofSUBTYPE_DYNAMIC_PAGESUBTYPE_DYNAMIC_MARKDOWNSUBTYPE_DYNAMIC_EMBEDSUBTYPE_DYNAMIC_RESOURCESUBTYPE_VIDEO_YOUTUBESUBTYPE_VIDEO_HOSTEDSUBTYPE_DOCUMENT_PDFSUBTYPE_DOCUMENT_DOCSUBTYPE_ASSIGNMENT_ANYSUBTYPE_CUSTOMSUBTYPE_SCORM_12SUBTYPE_SCORM_2004SUBTYPE_LIVE_SESSION
contentContentOptional
detailsDetails | nullOptional
publishedbooleanOptional
Defaultfalse
lock_typeActivityLockTypeOptional
One ofpublicauthenticatedrestricted
idintegerRequired
org_idintegerRequired
course_idintegerRequired
activity_uuidstringRequired
creation_datestringRequired
update_datestringRequired
extra_metadataExtra Metadata | nullOptional
current_versionintegerOptional
Default1
last_modified_by_idinteger | nullOptional
last_modified_by_usernamestring | nullOptional
is_lockedbooleanOptional
Defaultfalse
drip_unlock_atstring | nullOptional
drip_reasonstring | nullOptional
chapter_uuidstringRequired
creation_datestringRequired
update_datestringRequired
extra_metadataExtra Metadata | null
is_lockedboolean
Defaultfalse
drip_ruleDrip Rule | null
drip_lockedboolean
Defaultfalse
drip_unlock_atstring | null
drip_reasonstring | null
drip_closes_atstring | null
403User lacks permission to create chapters on this course
404Course not found
422Invalid chapter payload
Request
curl -X POST \
  "https://api.learnhouse.io/api/v1/chapters/" \
  -H "Authorization: Bearer lh_YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Example name","description":"An example description","thumbnail_image":"string","lock_type":"public","org_id":1,"course_id":1,"extra_metadata":{}}'
Response
{
  "name": "Example name",
  "description": "An example description",
  "thumbnail_image": "string",
  "lock_type": "public",
  "org_id": 1,
  "course_id": 1,
  "id": 1,
  "activities": [
    {
      "name": "Example name",
      "activity_type": "TYPE_VIDEO",
      "activity_sub_type": "SUBTYPE_DYNAMIC_PAGE",
      "content": {},
      "details": {},
      "published": false,
      "lock_type": "public",
      "id": 1,
      "org_id": 1,
      "course_id": 1,
      "activity_uuid": "string",
      "creation_date": "string",
      "update_date": "string",
      "extra_metadata": {},
      "current_version": 1,
      "last_modified_by_id": 1,
      "last_modified_by_username": "string",
      "is_locked": false,
      "drip_unlock_at": "string",
      "drip_reason": "string"
    }
  ],
  "chapter_uuid": "string",
  "creation_date": "string",
  "update_date": "string",
  "extra_metadata": {},
  "is_locked": false,
  "drip_rule": {},
  "drip_locked": false,
  "drip_unlock_at": "string",
  "drip_reason": "string",
  "drip_closes_at": "string"
}

Get chapter by ID

GET/​api/​v1/​chapters/​{chapter_id}
API token or user session. The token needs the Read right on Chapters (coursechapters:read).

Retrieve a single chapter by its numeric ID.

Path parameters1 required

NameTypeDescription
chapter_idRequiredinteger

No description.

Responses5

200Chapter retrieved successfullyChapterRead
namestringRequired
descriptionstring | null
thumbnail_imagestring | null
lock_typeLockType
One ofpublicauthenticatedrestricted
org_idintegerRequired
course_idintegerRequired
idintegerRequired
activitiesActivityRead[]Required
20 child attributes
namestringRequired
activity_typeActivityTypeEnumRequired
One ofTYPE_VIDEOTYPE_DOCUMENTTYPE_DYNAMICTYPE_ASSIGNMENTTYPE_CUSTOMTYPE_SCORMTYPE_LIVE_SESSION
activity_sub_typeActivitySubTypeEnumRequired
One ofSUBTYPE_DYNAMIC_PAGESUBTYPE_DYNAMIC_MARKDOWNSUBTYPE_DYNAMIC_EMBEDSUBTYPE_DYNAMIC_RESOURCESUBTYPE_VIDEO_YOUTUBESUBTYPE_VIDEO_HOSTEDSUBTYPE_DOCUMENT_PDFSUBTYPE_DOCUMENT_DOCSUBTYPE_ASSIGNMENT_ANYSUBTYPE_CUSTOMSUBTYPE_SCORM_12SUBTYPE_SCORM_2004SUBTYPE_LIVE_SESSION
contentContentOptional
detailsDetails | nullOptional
publishedbooleanOptional
Defaultfalse
lock_typeActivityLockTypeOptional
One ofpublicauthenticatedrestricted
idintegerRequired
org_idintegerRequired
course_idintegerRequired
activity_uuidstringRequired
creation_datestringRequired
update_datestringRequired
extra_metadataExtra Metadata | nullOptional
current_versionintegerOptional
Default1
last_modified_by_idinteger | nullOptional
last_modified_by_usernamestring | nullOptional
is_lockedbooleanOptional
Defaultfalse
drip_unlock_atstring | nullOptional
drip_reasonstring | nullOptional
chapter_uuidstringRequired
creation_datestringRequired
update_datestringRequired
extra_metadataExtra Metadata | null
is_lockedboolean
Defaultfalse
drip_ruleDrip Rule | null
drip_lockedboolean
Defaultfalse
drip_unlock_atstring | null
drip_reasonstring | null
drip_closes_atstring | null
403User lacks read access to this chapter
404Chapter not found
409Chapter does not exist
422Validation ErrorHTTPValidationError

A list of field errors. Same shape on every endpoint, see validation errors.

Request
curl "https://api.learnhouse.io/api/v1/chapters/{chapter_id}" \
  -H "Authorization: Bearer lh_YOUR_API_TOKEN"
Response
{
  "name": "Example name",
  "description": "An example description",
  "thumbnail_image": "string",
  "lock_type": "public",
  "org_id": 1,
  "course_id": 1,
  "id": 1,
  "activities": [
    {
      "name": "Example name",
      "activity_type": "TYPE_VIDEO",
      "activity_sub_type": "SUBTYPE_DYNAMIC_PAGE",
      "content": {},
      "details": {},
      "published": false,
      "lock_type": "public",
      "id": 1,
      "org_id": 1,
      "course_id": 1,
      "activity_uuid": "string",
      "creation_date": "string",
      "update_date": "string",
      "extra_metadata": {},
      "current_version": 1,
      "last_modified_by_id": 1,
      "last_modified_by_username": "string",
      "is_locked": false,
      "drip_unlock_at": "string",
      "drip_reason": "string"
    }
  ],
  "chapter_uuid": "string",
  "creation_date": "string",
  "update_date": "string",
  "extra_metadata": {},
  "is_locked": false,
  "drip_rule": {},
  "drip_locked": false,
  "drip_unlock_at": "string",
  "drip_reason": "string",
  "drip_closes_at": "string"
}

Update chapter

PUT/​api/​v1/​chapters/​{chapter_id}
API token or user session. The token needs the Update right on Chapters (coursechapters:update).

Update the name or other metadata of a chapter by its ID.

Path parameters1 required

NameTypeDescription
chapter_idRequiredinteger

No description.

Request bodyapplication/jsonRequired

namestring | nullOptional
descriptionstring | nullOptional
thumbnail_imagestring | nullOptional
lock_typeenum | nullOptional
One ofpublicauthenticatedrestricted
extra_metadataExtra Metadata | nullOptional

Responses5

200Chapter updated successfullyChapterRead
namestringRequired
descriptionstring | null
thumbnail_imagestring | null
lock_typeLockType
One ofpublicauthenticatedrestricted
org_idintegerRequired
course_idintegerRequired
idintegerRequired
activitiesActivityRead[]Required
20 child attributes
namestringRequired
activity_typeActivityTypeEnumRequired
One ofTYPE_VIDEOTYPE_DOCUMENTTYPE_DYNAMICTYPE_ASSIGNMENTTYPE_CUSTOMTYPE_SCORMTYPE_LIVE_SESSION
activity_sub_typeActivitySubTypeEnumRequired
One ofSUBTYPE_DYNAMIC_PAGESUBTYPE_DYNAMIC_MARKDOWNSUBTYPE_DYNAMIC_EMBEDSUBTYPE_DYNAMIC_RESOURCESUBTYPE_VIDEO_YOUTUBESUBTYPE_VIDEO_HOSTEDSUBTYPE_DOCUMENT_PDFSUBTYPE_DOCUMENT_DOCSUBTYPE_ASSIGNMENT_ANYSUBTYPE_CUSTOMSUBTYPE_SCORM_12SUBTYPE_SCORM_2004SUBTYPE_LIVE_SESSION
contentContentOptional
detailsDetails | nullOptional
publishedbooleanOptional
Defaultfalse
lock_typeActivityLockTypeOptional
One ofpublicauthenticatedrestricted
idintegerRequired
org_idintegerRequired
course_idintegerRequired
activity_uuidstringRequired
creation_datestringRequired
update_datestringRequired
extra_metadataExtra Metadata | nullOptional
current_versionintegerOptional
Default1
last_modified_by_idinteger | nullOptional
last_modified_by_usernamestring | nullOptional
is_lockedbooleanOptional
Defaultfalse
drip_unlock_atstring | nullOptional
drip_reasonstring | nullOptional
chapter_uuidstringRequired
creation_datestringRequired
update_datestringRequired
extra_metadataExtra Metadata | null
is_lockedboolean
Defaultfalse
drip_ruleDrip Rule | null
drip_lockedboolean
Defaultfalse
drip_unlock_atstring | null
drip_reasonstring | null
drip_closes_atstring | null
403User lacks permission to modify this chapter
404Chapter not found
409Chapter does not exist
422Invalid chapter payload
Request
curl -X PUT \
  "https://api.learnhouse.io/api/v1/chapters/{chapter_id}" \
  -H "Authorization: Bearer lh_YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Example name","description":"An example description","thumbnail_image":"string","lock_type":"public","extra_metadata":{}}'
Response
{
  "name": "Example name",
  "description": "An example description",
  "thumbnail_image": "string",
  "lock_type": "public",
  "org_id": 1,
  "course_id": 1,
  "id": 1,
  "activities": [
    {
      "name": "Example name",
      "activity_type": "TYPE_VIDEO",
      "activity_sub_type": "SUBTYPE_DYNAMIC_PAGE",
      "content": {},
      "details": {},
      "published": false,
      "lock_type": "public",
      "id": 1,
      "org_id": 1,
      "course_id": 1,
      "activity_uuid": "string",
      "creation_date": "string",
      "update_date": "string",
      "extra_metadata": {},
      "current_version": 1,
      "last_modified_by_id": 1,
      "last_modified_by_username": "string",
      "is_locked": false,
      "drip_unlock_at": "string",
      "drip_reason": "string"
    }
  ],
  "chapter_uuid": "string",
  "creation_date": "string",
  "update_date": "string",
  "extra_metadata": {},
  "is_locked": false,
  "drip_rule": {},
  "drip_locked": false,
  "drip_unlock_at": "string",
  "drip_reason": "string",
  "drip_closes_at": "string"
}

Delete chapter

DELETE/​api/​v1/​chapters/​{chapter_id}
API token or user session. The token needs the Delete right on Chapters (coursechapters:delete).

Delete a chapter and detach its activities from the course.

Path parameters1 required

NameTypeDescription
chapter_idRequiredinteger

No description.

Responses5

200Chapter deleted successfullyany
403User lacks permission to delete this chapter
404Chapter not found
409Chapter does not exist
422Validation ErrorHTTPValidationError

A list of field errors. Same shape on every endpoint, see validation errors.

Request
curl -X DELETE \
  "https://api.learnhouse.io/api/v1/chapters/{chapter_id}" \
  -H "Authorization: Bearer lh_YOUR_API_TOKEN"
Response
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get chapters metadata (deprecated)Deprecated

GET/​api/​v1/​chapters/​course/​{course_uuid}/​meta
API token or user session. The token needs the Read right on Chapters (coursechapters:read).

Deprecated endpoint returning chapter metadata for a course. Use /course/{course_uuid}/meta on the courses router instead.

Path parameters1 required

NameTypeDescription
course_uuidRequiredstring

No description.

Responses4

200Chapter metadataany
403User lacks read access to the course
404Course not found
422Validation ErrorHTTPValidationError

A list of field errors. Same shape on every endpoint, see validation errors.

Request
curl "https://api.learnhouse.io/api/v1/chapters/course/{course_uuid}/meta" \
  -H "Authorization: Bearer lh_YOUR_API_TOKEN"
Response
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Reorder chapters and activities

PUT/​api/​v1/​chapters/​course/​{course_uuid}/​order
API token or user session. The token needs the Update right on Chapters (coursechapters:update).

Update the ordering of chapters and the activities nested inside them for a given course.

Path parameters1 required

NameTypeDescription
course_uuidRequiredstring

No description.

Request bodyapplication/jsonRequired

chapter_order_by_idsChapterOrder[]Required
2 child attributes
chapter_idintegerRequired
activities_order_by_idsActivityOrder[]Required
1 child attribute
activity_idintegerRequired

Responses5

200Order updated successfullyany
403User lacks permission to modify this course
404Course not found
409Course does not exist
422Invalid order payload
Request
curl -X PUT \
  "https://api.learnhouse.io/api/v1/chapters/course/{course_uuid}/order" \
  -H "Authorization: Bearer lh_YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"chapter_order_by_ids":[{"chapter_id":1,"activities_order_by_ids":[{"activity_id":1}]}]}'

List course chapters

GET/​api/​v1/​chapters/​course/​{course_id}/​page/​{page}/​limit/​{limit}
API token or user session. The token needs the Read right on Chapters (coursechapters:read).

Paginated list of chapters for the specified course.

Path parameters3 required

NameTypeDescription
course_idRequiredinteger

No description.

pageRequiredinteger

No description.

limitRequiredinteger

No description.

Responses4

200Paginated list of chaptersChapterRead[]
namestringRequired
descriptionstring | null
thumbnail_imagestring | null
lock_typeLockType
One ofpublicauthenticatedrestricted
org_idintegerRequired
course_idintegerRequired
idintegerRequired
activitiesActivityRead[]Required
20 child attributes
namestringRequired
activity_typeActivityTypeEnumRequired
One ofTYPE_VIDEOTYPE_DOCUMENTTYPE_DYNAMICTYPE_ASSIGNMENTTYPE_CUSTOMTYPE_SCORMTYPE_LIVE_SESSION
activity_sub_typeActivitySubTypeEnumRequired
One ofSUBTYPE_DYNAMIC_PAGESUBTYPE_DYNAMIC_MARKDOWNSUBTYPE_DYNAMIC_EMBEDSUBTYPE_DYNAMIC_RESOURCESUBTYPE_VIDEO_YOUTUBESUBTYPE_VIDEO_HOSTEDSUBTYPE_DOCUMENT_PDFSUBTYPE_DOCUMENT_DOCSUBTYPE_ASSIGNMENT_ANYSUBTYPE_CUSTOMSUBTYPE_SCORM_12SUBTYPE_SCORM_2004SUBTYPE_LIVE_SESSION
contentContentOptional
detailsDetails | nullOptional
publishedbooleanOptional
Defaultfalse
lock_typeActivityLockTypeOptional
One ofpublicauthenticatedrestricted
idintegerRequired
org_idintegerRequired
course_idintegerRequired
activity_uuidstringRequired
creation_datestringRequired
update_datestringRequired
extra_metadataExtra Metadata | nullOptional
current_versionintegerOptional
Default1
last_modified_by_idinteger | nullOptional
last_modified_by_usernamestring | nullOptional
is_lockedbooleanOptional
Defaultfalse
drip_unlock_atstring | nullOptional
drip_reasonstring | nullOptional
chapter_uuidstringRequired
creation_datestringRequired
update_datestringRequired
extra_metadataExtra Metadata | null
is_lockedboolean
Defaultfalse
drip_ruleDrip Rule | null
drip_lockedboolean
Defaultfalse
drip_unlock_atstring | null
drip_reasonstring | null
drip_closes_atstring | null
403User lacks read access to the course
404Course not found
422Validation ErrorHTTPValidationError

A list of field errors. Same shape on every endpoint, see validation errors.

Request
curl "https://api.learnhouse.io/api/v1/chapters/course/{course_id}/page/{page}/limit/{limit}" \
  -H "Authorization: Bearer lh_YOUR_API_TOKEN"
Response
[
  {
    "name": "Example name",
    "description": "An example description",
    "thumbnail_image": "string",
    "lock_type": "public",
    "org_id": 1,
    "course_id": 1,
    "id": 1,
    "activities": [
      {
        "name": "Example name",
        "activity_type": "TYPE_VIDEO",
        "activity_sub_type": "SUBTYPE_DYNAMIC_PAGE",
        "content": {},
        "details": {},
        "published": false,
        "lock_type": "public",
        "id": 1,
        "org_id": 1,
        "course_id": 1,
        "activity_uuid": "string",
        "creation_date": "string",
        "update_date": "string",
        "extra_metadata": {},
        "current_version": 1,
        "last_modified_by_id": 1,
        "last_modified_by_username": "string",
        "is_locked": false,
        "drip_unlock_at": "string",
        "drip_reason": "string"
      }
    ],
    "chapter_uuid": "string",
    "creation_date": "string",
    "update_date": "string",
    "extra_metadata": {},
    "is_locked": false,
    "drip_rule": {},
    "drip_locked": false,
    "drip_unlock_at": "string",
    "drip_reason": "string",
    "drip_closes_at": "string"
  }
]

List user groups assigned to a locked chapter

GET/​api/​v1/​chapters/​{chapter_uuid}/​usergroups
API token or user session. The token needs the Read right on Chapters (coursechapters:read).

Return the user groups that can access this chapter when lock_type is 'restricted'.

Path parameters1 required

NameTypeDescription
chapter_uuidRequiredstring

No description.

Responses2

200Successful Responseany
422Validation ErrorHTTPValidationError

A list of field errors. Same shape on every endpoint, see validation errors.

Request
curl "https://api.learnhouse.io/api/v1/chapters/{chapter_uuid}/usergroups" \
  -H "Authorization: Bearer lh_YOUR_API_TOKEN"
Response
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Grant a user group access to a locked chapter

POST/​api/​v1/​chapters/​{chapter_uuid}/​usergroups/​{usergroup_uuid}
API token or user session. The token needs the Create right on Chapters (coursechapters:create).

Associate a user group with this chapter so its members can access it when lock_type is 'restricted'.

Path parameters2 required

NameTypeDescription
chapter_uuidRequiredstring

No description.

usergroup_uuidRequiredstring

No description.

Responses2

200Successful Responseany
422Validation ErrorHTTPValidationError

A list of field errors. Same shape on every endpoint, see validation errors.

Request
curl -X POST \
  "https://api.learnhouse.io/api/v1/chapters/{chapter_uuid}/usergroups/{usergroup_uuid}" \
  -H "Authorization: Bearer lh_YOUR_API_TOKEN"
Response
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Revoke a user group's access to a locked chapter

DELETE/​api/​v1/​chapters/​{chapter_uuid}/​usergroups/​{usergroup_uuid}
API token or user session. The token needs the Delete right on Chapters (coursechapters:delete).

Remove the association between a user group and this chapter.

Path parameters2 required

NameTypeDescription
chapter_uuidRequiredstring

No description.

usergroup_uuidRequiredstring

No description.

Responses2

200Successful Responseany
422Validation ErrorHTTPValidationError

A list of field errors. Same shape on every endpoint, see validation errors.

Request
curl -X DELETE \
  "https://api.learnhouse.io/api/v1/chapters/{chapter_uuid}/usergroups/{usergroup_uuid}" \
  -H "Authorization: Bearer lh_YOUR_API_TOKEN"
Response
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}