Error when fetching a custom post from a custom endpoint

I am trying to bring the courses from the end point that a plugin generates.


export const routeCourseArchive = {
  name: "courses",
  priority:  8,
  pattern:  "/courses",  
  func: async ({ route, state, libraries }) => {    
    // 1. get all Courses
    const coursesList = await libraries.source.api.get({
      endpoint: "/llms/v1/courses"
    // 2. add everything to the state.
    const items = await libraries.source.populate({
      response: coursesList,
    // 3. add info to data
    Object.assign([route], {
      GeneralTitle: 'Learning',
      isArchiveCourses: true,
      isPostType: true,
      type: "course",
      items: => ({
        type: item.type,


"postTypes": [
  "type": "course",
  "endpoint": "/llms/v1/courses",
  "archive": "/courses",

ServerError: post type from endpoints “posts,pages,media” with slug coursesundefined" not found

Hi @mautorressantos

Could you provide a link to a repo so that we can take a look at your code and clone it for testing. Thanks.