REST API GUIDE

tutorhub-tutorcatalog-service

Version: 1.0.45

Handles tutor public profiles, course packs, public categories, and course pack materials with strict public/private access enforcement for course pack content and materials.

Architectural Design Credit and Contact Information

The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to:

Email:

We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice.

Documentation Scope

Welcome to the official documentation for the TutorCatalog Service’s REST API. This document is designed to provide a comprehensive guide to interfacing with our TutorCatalog Service exclusively through RESTful API endpoints.

Intended Audience

This documentation is intended for developers and integrators who are looking to interact with the TutorCatalog Service via HTTP requests for purposes such as creating, updating, deleting and querying TutorCatalog objects.

Overview

Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases.

Beyond REST It’s important to note that the TutorCatalog Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation.

Authentication And Authorization

To ensure secure access to the TutorCatalog service’s protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it’s important to note that access control varies across different routes:

Protected API: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected.

**Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token.

Token Locations

When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters.

Location Token Name / Param Name
Query access_token
Authorization Header Bearer
Header tutorhub-access-token
Cookie tutorhub-access-token

Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies.

Api Definitions

This section outlines the API endpoints available within the TutorCatalog service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It’s important to understand the flexibility in how parameters can be included in requests to effectively interact with the TutorCatalog service.

This service is configured to listen for HTTP requests on port 3000, serving both the main API interface and default administrative endpoints.

The following routes are available by default:

This service is accessible via the following environment-specific URLs:

Parameter Inclusion Methods: Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests:

Query Parameters: Included directly in the URL’s query string.

Path Parameters: Embedded within the URL’s path.

Body Parameters: Sent within the JSON body of the request.

Session Parameters: Automatically read from the session object. This method is used for parameters that are intrinsic to the user’s session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request.

Note on Session Parameters: Session parameters represent a unique method of parameter inclusion, relying on the context of the user’s session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request.

By adhering to the specified parameter inclusion methods, you can effectively utilize the TutorCatalog service’s API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below.

Common Parameters

The TutorCatalog service’s business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL.

Supported Common Parameters:

By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the TutorCatalog service.

Error Response

If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity:

Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently.

{
  "result": "ERR",
  "status": 400,
  "message": "errMsg_organizationIdisNotAValidID",
  "errCode": 400,
  "date": "2024-03-19T12:13:54.124Z",
  "detail": "String"
}

Object Structure of a Successfull Response

When the TutorCatalog service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client.

Key Characteristics of the Response Envelope:

Design Considerations: The structure of a API’s response data is meticulously crafted during the service’s architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information.

Brief Data: Certain API’s return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect.

API Response Structure

The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response.

HTTP Status Codes:

Success Response Format:

For successful operations, the response includes a "status": "OK" property, signaling the successful execution of the request. The structure of a successful response is outlined below:

{
  "status":"OK",
  "statusCode": 200,   
  "elapsedMs":126,
  "ssoTime":120,
  "source": "db",
  "cacheKey": "hexCode",
  "userId": "ID",
  "sessionId": "ID",
  "requestId": "ID",
  "dataName":"products",
  "method":"GET",
  "action":"list",
  "appVersion":"Version",
  "rowCount":3
  "products":[{},{},{}],
  "paging": {
    "pageNumber":1, 
    "pageRowCount":25, 
    "totalRowCount":3,
    "pageCount":1
  },
  "filters": [],
  "uiPermissions": []
}

Handling Errors:

For details on handling error scenarios and understanding the structure of error responses, please refer to the “Error Response” section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages.

Resources

TutorCatalog service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service.

TutorProfile resource

Resource Definition : Public-facing profile for a tutor, includes certifications, experience, subjects, bio, and photo. TutorProfile Resource Properties

Name Type Required Default Definition
tutorId ID **
certifications String Tutor's certifications (list of certificates, degrees, etc.).
experience Text Brief experience summary or bio.
subjects String Areas of expertise/subjects offered for teaching.
bio Text Optional full-length bio/description.
profilePhoto String Public profile photo URL (may be external or uploaded).
profileStatus Enum **
displayName String Tutor's display name, copied from auth user fullname at profile creation.

Enum Properties

Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer.

profileStatus Enum Property

Enum Options

Name Value Index
pending "pending"" 0
approved "approved"" 1
rejected "rejected"" 2

CoursePack resource

Resource Definition : Publicly listed course pack/structured course offered by a tutor. CoursePack Resource Properties

Name Type Required Default Definition
tutorProfileId ID **
title String **
description Text **
price Double **
category String **
schedulingType Enum **
minWeeklyClasses Integer **
preliminaryMeetingRequired Boolean **
isPublished Boolean **
maxDailyLessons Integer **
requiredClassesCount Integer **
moderationStatus Enum Content moderation status.
moderationNote String Admin note for flagged/removed course packs.
maxPeriodValue Integer Maximum time period value for strict scheduling (e.g. 3 for 3 months)
maxPeriodUnit Enum Time unit for maxPeriodValue in strict scheduling

Enum Properties

Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer.

schedulingType Enum Property

Enum Options

Name Value Index
flexible "flexible"" 0
strict "strict"" 1
moderationStatus Enum Property

Property Definition : Content moderation status.Enum Options

Name Value Index
approved "approved"" 0
flagged "flagged"" 1
removed "removed"" 2
maxPeriodUnit Enum Property

Property Definition : Time unit for maxPeriodValue in strict schedulingEnum Options

Name Value Index
weeks "weeks"" 0
months "months"" 1

CourseMaterial resource

Resource Definition : Material (file, video, link, doc) attached to coursePack. Only visible to the owning tutor and students enrolled in the course pack. CourseMaterial Resource Properties

Name Type Required Default Definition
coursePackId ID FK to coursePack.
fileUrl String URL for file/video/document. For downloads or video links (protected).
fileType Enum Type: file, video, document, externalLink.
title String Material title (unique per pack).
description Text Additional details about the material resource.
linkUrl String Optional URL for external resource (if fileType = externalLink).

Enum Properties

Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer.

fileType Enum Property

Property Definition : Type: file, video, document, externalLink.Enum Options

Name Value Index
file "file"" 0
video "video"" 1
document "document"" 2
externalLink "externalLink"" 3

CourseCategory resource

Resource Definition : Represents a course subject/category; used for filtering and navigation. Admin-maintained. CourseCategory Resource Properties

Name Type Required Default Definition
name String Unique category/subject name.
description Text Category description.
icon String Emoji icon displayed next to the category name (e.g. 📐, 🗣️, 🎵)

Business Api

Create Tutorprofile API

Rest Route

The createTutorProfile API REST controller can be triggered via the following route:

/v1/tutorprofiles

Rest Request Parameters

The createTutorProfile api has got 8 regular request parameters

Parameter Type Required Population
tutorId ID true request.body?.[“tutorId”]
bio Text false request.body?.[“bio”]
experience Text false request.body?.[“experience”]
profileStatus String false request.body?.[“profileStatus”]
certifications String false request.body?.[“certifications”]
subjects String false request.body?.[“subjects”]
profilePhoto String false request.body?.[“profilePhoto”]
displayName String false request.body?.[“displayName”]
tutorId : ID of the auth user who is becoming a tutor
bio : Tutor’s biography
experience : Tutor’s experience/qualifications
profileStatus : Approval status - should be ‘approved’ when created from auth
certifications : Tutor’s certifications (list of certificates, degrees, etc.).
subjects : Areas of expertise/subjects offered for teaching.
profilePhoto : Public profile photo URL (may be external or uploaded).
displayName : Tutor’s display name, copied from auth user fullname at profile creation.

REST Request To access the api you can use the REST controller with the path POST /v1/tutorprofiles

  axios({
    method: 'POST',
    url: '/v1/tutorprofiles',
    data: {
            tutorId:"ID",  
            bio:"Text",  
            experience:"Text",  
            profileStatus:"String",  
            certifications:"String",  
            subjects:"String",  
            profilePhoto:"String",  
            displayName:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "tutorProfile",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"tutorProfile": {
		"id": "ID",
		"tutorId": "ID",
		"certifications": "String",
		"experience": "Text",
		"subjects": "String",
		"bio": "Text",
		"profilePhoto": "String",
		"profileStatus": "Enum",
		"profileStatus_idx": "Integer",
		"displayName": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Tutorprofile API

[Default update API] — This is the designated default update API for the tutorProfile data object. Frontend generators and AI agents should use this API for standard CRUD operations. Tutor updates their own profile. Only owner tutor or admin can update.

Rest Route

The updateTutorProfile API REST controller can be triggered via the following route:

/v1/tutorprofiles/:tutorProfileId

Rest Request Parameters

The updateTutorProfile api has got 9 regular request parameters

Parameter Type Required Population
tutorProfileId ID true request.params?.[“tutorProfileId”]
tutorId ID false request.body?.[“tutorId”]
certifications String false request.body?.[“certifications”]
experience Text false request.body?.[“experience”]
subjects String false request.body?.[“subjects”]
bio Text false request.body?.[“bio”]
profilePhoto String false request.body?.[“profilePhoto”]
profileStatus Enum false request.body?.[“profileStatus”]
displayName String false request.body?.[“displayName”]
tutorProfileId : This id paremeter is used to select the required data object that will be updated
tutorId :
certifications : Tutor’s certifications (list of certificates, degrees, etc.).
experience : Brief experience summary or bio.
subjects : Areas of expertise/subjects offered for teaching.
bio : Optional full-length bio/description.
profilePhoto : Public profile photo URL (may be external or uploaded).
profileStatus :
displayName : Tutor’s display name, copied from auth user fullname at profile creation.

REST Request To access the api you can use the REST controller with the path PATCH /v1/tutorprofiles/:tutorProfileId

  axios({
    method: 'PATCH',
    url: `/v1/tutorprofiles/${tutorProfileId}`,
    data: {
            tutorId:"ID",  
            certifications:"String",  
            experience:"Text",  
            subjects:"String",  
            bio:"Text",  
            profilePhoto:"String",  
            profileStatus:"Enum",  
            displayName:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "tutorProfile",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"tutorProfile": {
		"id": "ID",
		"tutorId": "ID",
		"certifications": "String",
		"experience": "Text",
		"subjects": "String",
		"bio": "Text",
		"profilePhoto": "String",
		"profileStatus": "Enum",
		"profileStatus_idx": "Integer",
		"displayName": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Tutorprofile API

[Default get API] — This is the designated default get API for the tutorProfile data object. Frontend generators and AI agents should use this API for standard CRUD operations. Publicly get a tutor profile by ID. No login required.

Rest Route

The getTutorProfile API REST controller can be triggered via the following route:

/v1/tutorprofiles/:tutorProfileId

Rest Request Parameters

The getTutorProfile api has got 1 regular request parameter

Parameter Type Required Population
tutorProfileId ID true request.params?.[“tutorProfileId”]
tutorProfileId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/tutorprofiles/:tutorProfileId

  axios({
    method: 'GET',
    url: `/v1/tutorprofiles/${tutorProfileId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "tutorProfile",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"tutorProfile": {
		"id": "ID",
		"tutorId": "ID",
		"certifications": "String",
		"experience": "Text",
		"subjects": "String",
		"bio": "Text",
		"profilePhoto": "String",
		"profileStatus": "Enum",
		"profileStatus_idx": "Integer",
		"displayName": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Tutorprofiles API

Rest Route

The listTutorProfiles API REST controller can be triggered via the following route:

/v1/tutorprofiles

Rest Request Parameters The listTutorProfiles api has got no request parameters.

REST Request To access the api you can use the REST controller with the path GET /v1/tutorprofiles

  axios({
    method: 'GET',
    url: '/v1/tutorprofiles',
    data: {
    
    },
    params: {
    
        }
  });

REST Response

This route’s response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "tutorProfiles",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"tutorProfiles": [
		{
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Create Coursepack API

[Default create API] — This is the designated default create API for the coursePack data object. Frontend generators and AI agents should use this API for standard CRUD operations. Tutor creates a new course offering. Only accessible to tutors (or admin, for moderation).

Rest Route

The createCoursePack API REST controller can be triggered via the following route:

/v1/coursepacks

Rest Request Parameters

The createCoursePack api has got 14 regular request parameters

Parameter Type Required Population
tutorProfileId ID true request.body?.[“tutorProfileId”]
title String true request.body?.[“title”]
description Text false request.body?.[“description”]
price Double true request.body?.[“price”]
category String true request.body?.[“category”]
schedulingType Enum true request.body?.[“schedulingType”]
minWeeklyClasses Integer false request.body?.[“minWeeklyClasses”]
preliminaryMeetingRequired Boolean true request.body?.[“preliminaryMeetingRequired”]
isPublished Boolean true request.body?.[“isPublished”]
maxDailyLessons Integer false request.body?.[“maxDailyLessons”]
requiredClassesCount Integer false request.body?.[“requiredClassesCount”]
moderationNote String false request.body?.[“moderationNote”]
maxPeriodValue Integer false request.body?.[“maxPeriodValue”]
maxPeriodUnit Enum false request.body?.[“maxPeriodUnit”]
tutorProfileId :
title :
description :
price :
category :
schedulingType :
minWeeklyClasses :
preliminaryMeetingRequired :
isPublished :
maxDailyLessons :
requiredClassesCount :
moderationNote : Admin note for flagged/removed course packs.
maxPeriodValue : Maximum time period value for strict scheduling (e.g. 3 for 3 months)
maxPeriodUnit : Time unit for maxPeriodValue in strict scheduling

REST Request To access the api you can use the REST controller with the path POST /v1/coursepacks

  axios({
    method: 'POST',
    url: '/v1/coursepacks',
    data: {
            tutorProfileId:"ID",  
            title:"String",  
            description:"Text",  
            price:"Double",  
            category:"String",  
            schedulingType:"Enum",  
            minWeeklyClasses:"Integer",  
            preliminaryMeetingRequired:"Boolean",  
            isPublished:"Boolean",  
            maxDailyLessons:"Integer",  
            requiredClassesCount:"Integer",  
            moderationNote:"String",  
            maxPeriodValue:"Integer",  
            maxPeriodUnit:"Enum",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "coursePack",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"coursePack": {
		"id": "ID",
		"tutorProfileId": "ID",
		"title": "String",
		"description": "Text",
		"price": "Double",
		"category": "String",
		"schedulingType": "Enum",
		"schedulingType_idx": "Integer",
		"minWeeklyClasses": "Integer",
		"preliminaryMeetingRequired": "Boolean",
		"isPublished": "Boolean",
		"maxDailyLessons": "Integer",
		"requiredClassesCount": "Integer",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"moderationNote": "String",
		"maxPeriodValue": "Integer",
		"maxPeriodUnit": "Enum",
		"maxPeriodUnit_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Coursepack API

[Default update API] — This is the designated default update API for the coursePack data object. Frontend generators and AI agents should use this API for standard CRUD operations. Tutor updates their course pack. Only owner tutor or admin can update. Ownership is verified via tutorProfile and user session.

Rest Route

The updateCoursePack API REST controller can be triggered via the following route:

/v1/coursepacks/:coursePackId

Rest Request Parameters

The updateCoursePack api has got 16 regular request parameters

Parameter Type Required Population
coursePackId ID true request.params?.[“coursePackId”]
tutorProfileId ID request.body?.[“tutorProfileId”]
title String false request.body?.[“title”]
description Text false request.body?.[“description”]
price Double false request.body?.[“price”]
category String false request.body?.[“category”]
schedulingType Enum false request.body?.[“schedulingType”]
minWeeklyClasses Integer false request.body?.[“minWeeklyClasses”]
preliminaryMeetingRequired Boolean false request.body?.[“preliminaryMeetingRequired”]
isPublished Boolean false request.body?.[“isPublished”]
maxDailyLessons Integer false request.body?.[“maxDailyLessons”]
requiredClassesCount Integer false request.body?.[“requiredClassesCount”]
moderationStatus Enum false request.body?.[“moderationStatus”]
moderationNote String false request.body?.[“moderationNote”]
maxPeriodValue Integer false request.body?.[“maxPeriodValue”]
maxPeriodUnit Enum false request.body?.[“maxPeriodUnit”]
coursePackId : This id paremeter is used to select the required data object that will be updated
tutorProfileId :
title :
description :
price :
category :
schedulingType :
minWeeklyClasses :
preliminaryMeetingRequired :
isPublished :
maxDailyLessons :
requiredClassesCount :
moderationStatus : Content moderation status.
moderationNote : Admin note for flagged/removed course packs.
maxPeriodValue : Maximum time period value for strict scheduling (e.g. 3 for 3 months)
maxPeriodUnit : Time unit for maxPeriodValue in strict scheduling

REST Request To access the api you can use the REST controller with the path PATCH /v1/coursepacks/:coursePackId

  axios({
    method: 'PATCH',
    url: `/v1/coursepacks/${coursePackId}`,
    data: {
            tutorProfileId:"ID",  
            title:"String",  
            description:"Text",  
            price:"Double",  
            category:"String",  
            schedulingType:"Enum",  
            minWeeklyClasses:"Integer",  
            preliminaryMeetingRequired:"Boolean",  
            isPublished:"Boolean",  
            maxDailyLessons:"Integer",  
            requiredClassesCount:"Integer",  
            moderationStatus:"Enum",  
            moderationNote:"String",  
            maxPeriodValue:"Integer",  
            maxPeriodUnit:"Enum",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "coursePack",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"coursePack": {
		"id": "ID",
		"tutorProfileId": "ID",
		"title": "String",
		"description": "Text",
		"price": "Double",
		"category": "String",
		"schedulingType": "Enum",
		"schedulingType_idx": "Integer",
		"minWeeklyClasses": "Integer",
		"preliminaryMeetingRequired": "Boolean",
		"isPublished": "Boolean",
		"maxDailyLessons": "Integer",
		"requiredClassesCount": "Integer",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"moderationNote": "String",
		"maxPeriodValue": "Integer",
		"maxPeriodUnit": "Enum",
		"maxPeriodUnit_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Delete Coursepack API

[Default delete API] — This is the designated default delete API for the coursePack data object. Frontend generators and AI agents should use this API for standard CRUD operations. Tutor deletes their course pack. Only owner tutor or admin can delete. Tutors are blocked if active enrollments exist. Admin can force-delete with a reason, which triggers pro-rata refunds and student notifications.

API Frontend Description By The Backend Architect

Tutors cannot delete a course with active enrollments — they should unpublish instead. Admin can force-delete with a mandatory reason; this triggers automatic pro-rata refunds and email notifications to affected students.

Rest Route

The deleteCoursePack API REST controller can be triggered via the following route:

/v1/coursepacks/:coursePackId

Rest Request Parameters

The deleteCoursePack api has got 2 regular request parameters

Parameter Type Required Population
coursePackId ID true request.params?.[“coursePackId”]
removalReason String request.body?.[“removalReason”]
coursePackId : This id paremeter is used to select the required data object that will be deleted
removalReason : Required when admin deletes a course with active enrollments. Reason is sent to affected students via email.

REST Request To access the api you can use the REST controller with the path DELETE /v1/coursepacks/:coursePackId

  axios({
    method: 'DELETE',
    url: `/v1/coursepacks/${coursePackId}`,
    data: {
            removalReason:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "coursePack",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"coursePack": {
		"id": "ID",
		"tutorProfileId": "ID",
		"title": "String",
		"description": "Text",
		"price": "Double",
		"category": "String",
		"schedulingType": "Enum",
		"schedulingType_idx": "Integer",
		"minWeeklyClasses": "Integer",
		"preliminaryMeetingRequired": "Boolean",
		"isPublished": "Boolean",
		"maxDailyLessons": "Integer",
		"requiredClassesCount": "Integer",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"moderationNote": "String",
		"maxPeriodValue": "Integer",
		"maxPeriodUnit": "Enum",
		"maxPeriodUnit_idx": "Integer",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Coursepack API

[Default get API] — This is the designated default get API for the coursePack data object. Frontend generators and AI agents should use this API for standard CRUD operations. Publicly get a course pack by ID. No login required.

Rest Route

The getCoursePack API REST controller can be triggered via the following route:

/v1/coursepacks/:coursePackId

Rest Request Parameters

The getCoursePack api has got 1 regular request parameter

Parameter Type Required Population
coursePackId ID true request.params?.[“coursePackId”]
coursePackId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/coursepacks/:coursePackId

  axios({
    method: 'GET',
    url: `/v1/coursepacks/${coursePackId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

This route’s response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "coursePack",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"coursePack": {
		"tutorProfile": {
			"tutorId": "ID",
			"certifications": "String",
			"experience": "Text",
			"subjects": "String",
			"bio": "Text",
			"profilePhoto": "String",
			"displayName": "String"
		},
		"isActive": true
	}
}

List Coursepacks API

Rest Route

The listCoursePacks API REST controller can be triggered via the following route:

/v1/coursepacks

Rest Request Parameters The listCoursePacks api has got no request parameters.

REST Request To access the api you can use the REST controller with the path GET /v1/coursepacks

  axios({
    method: 'GET',
    url: '/v1/coursepacks',
    data: {
    
    },
    params: {
    
        }
  });

REST Response

This route’s response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "coursePacks",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"coursePacks": [
		{
			"tutorProfile": [
				{
					"tutorId": "ID",
					"certifications": "String",
					"experience": "Text",
					"subjects": "String",
					"bio": "Text",
					"profilePhoto": "String",
					"displayName": "String"
				},
				{},
				{}
			],
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Create Coursematerial API

[Default create API] — This is the designated default create API for the courseMaterial data object. Frontend generators and AI agents should use this API for standard CRUD operations. Tutor uploads a material to a course pack they own. Only tutor or admin can create.

Rest Route

The createCourseMaterial API REST controller can be triggered via the following route:

/v1/coursematerials

Rest Request Parameters

The createCourseMaterial api has got 6 regular request parameters

Parameter Type Required Population
coursePackId ID true request.body?.[“coursePackId”]
fileUrl String true request.body?.[“fileUrl”]
fileType Enum true request.body?.[“fileType”]
title String true request.body?.[“title”]
description Text false request.body?.[“description”]
linkUrl String false request.body?.[“linkUrl”]
coursePackId : FK to coursePack.
fileUrl : URL for file/video/document. For downloads or video links (protected).
fileType : Type: file, video, document, externalLink.
title : Material title (unique per pack).
description : Additional details about the material resource.
linkUrl : Optional URL for external resource (if fileType = externalLink).

REST Request To access the api you can use the REST controller with the path POST /v1/coursematerials

  axios({
    method: 'POST',
    url: '/v1/coursematerials',
    data: {
            coursePackId:"ID",  
            fileUrl:"String",  
            fileType:"Enum",  
            title:"String",  
            description:"Text",  
            linkUrl:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "courseMaterial",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"courseMaterial": {
		"id": "ID",
		"coursePackId": "ID",
		"fileUrl": "String",
		"fileType": "Enum",
		"fileType_idx": "Integer",
		"title": "String",
		"description": "Text",
		"linkUrl": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Coursematerial API

[Default update API] — This is the designated default update API for the courseMaterial data object. Frontend generators and AI agents should use this API for standard CRUD operations. Tutor updates course material. Only course’s tutor or admin can update.

Rest Route

The updateCourseMaterial API REST controller can be triggered via the following route:

/v1/coursematerials/:courseMaterialId

Rest Request Parameters

The updateCourseMaterial api has got 6 regular request parameters

Parameter Type Required Population
courseMaterialId ID true request.params?.[“courseMaterialId”]
fileUrl String false request.body?.[“fileUrl”]
fileType Enum false request.body?.[“fileType”]
title String false request.body?.[“title”]
description Text false request.body?.[“description”]
linkUrl String false request.body?.[“linkUrl”]
courseMaterialId : This id paremeter is used to select the required data object that will be updated
fileUrl : URL for file/video/document. For downloads or video links (protected).
fileType : Type: file, video, document, externalLink.
title : Material title (unique per pack).
description : Additional details about the material resource.
linkUrl : Optional URL for external resource (if fileType = externalLink).

REST Request To access the api you can use the REST controller with the path PATCH /v1/coursematerials/:courseMaterialId

  axios({
    method: 'PATCH',
    url: `/v1/coursematerials/${courseMaterialId}`,
    data: {
            fileUrl:"String",  
            fileType:"Enum",  
            title:"String",  
            description:"Text",  
            linkUrl:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "courseMaterial",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"courseMaterial": {
		"id": "ID",
		"coursePackId": "ID",
		"fileUrl": "String",
		"fileType": "Enum",
		"fileType_idx": "Integer",
		"title": "String",
		"description": "Text",
		"linkUrl": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Delete Coursematerial API

[Default delete API] — This is the designated default delete API for the courseMaterial data object. Frontend generators and AI agents should use this API for standard CRUD operations. Tutor deletes course material. Only course’s tutor or admin can delete.

Rest Route

The deleteCourseMaterial API REST controller can be triggered via the following route:

/v1/coursematerials/:courseMaterialId

Rest Request Parameters

The deleteCourseMaterial api has got 1 regular request parameter

Parameter Type Required Population
courseMaterialId ID true request.params?.[“courseMaterialId”]
courseMaterialId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/coursematerials/:courseMaterialId

  axios({
    method: 'DELETE',
    url: `/v1/coursematerials/${courseMaterialId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "courseMaterial",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"courseMaterial": {
		"id": "ID",
		"coursePackId": "ID",
		"fileUrl": "String",
		"fileType": "Enum",
		"fileType_idx": "Integer",
		"title": "String",
		"description": "Text",
		"linkUrl": "String",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Coursematerial API

[Default get API] — This is the designated default get API for the courseMaterial data object. Frontend generators and AI agents should use this API for standard CRUD operations. Get course material. Only accessible by tutor owner or enrolled student or admin.

Rest Route

The getCourseMaterial API REST controller can be triggered via the following route:

/v1/coursematerials/:courseMaterialId

Rest Request Parameters

The getCourseMaterial api has got 1 regular request parameter

Parameter Type Required Population
courseMaterialId ID true request.params?.[“courseMaterialId”]
courseMaterialId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/coursematerials/:courseMaterialId

  axios({
    method: 'GET',
    url: `/v1/coursematerials/${courseMaterialId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

This route’s response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "courseMaterial",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"courseMaterial": {
		"coursePack": {
			"tutorProfileId": "ID",
			"title": "String"
		},
		"isActive": true
	}
}

List Coursematerials API

[Default list API] — This is the designated default list API for the courseMaterial data object. Frontend generators and AI agents should use this API for standard CRUD operations. List course materials for a coursePack. Only accessible to enrolled students, tutor owner, or admin.

Rest Route

The listCourseMaterials API REST controller can be triggered via the following route:

/v1/coursematerials

Rest Request Parameters The listCourseMaterials api has got no request parameters.

REST Request To access the api you can use the REST controller with the path GET /v1/coursematerials

  axios({
    method: 'GET',
    url: '/v1/coursematerials',
    data: {
    
    },
    params: {
    
        }
  });

REST Response

This route’s response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "courseMaterials",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"courseMaterials": [
		{
			"coursePack": [
				{
					"tutorProfileId": "ID",
					"title": "String"
				},
				{},
				{}
			],
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Create Coursecategory API

[Default create API] — This is the designated default create API for the courseCategory data object. Frontend generators and AI agents should use this API for standard CRUD operations. Admin creates new course category/subject tag.

Rest Route

The createCourseCategory API REST controller can be triggered via the following route:

/v1/coursecategories

Rest Request Parameters

The createCourseCategory api has got 3 regular request parameters

Parameter Type Required Population
name String true request.body?.[“name”]
description Text false request.body?.[“description”]
icon String false request.body?.[“icon”]
name : Unique category/subject name.
description : Category description.
icon : Emoji icon displayed next to the category name (e.g. 📐, 🗣️, 🎵)

REST Request To access the api you can use the REST controller with the path POST /v1/coursecategories

  axios({
    method: 'POST',
    url: '/v1/coursecategories',
    data: {
            name:"String",  
            description:"Text",  
            icon:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "courseCategory",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"courseCategory": {
		"id": "ID",
		"name": "String",
		"description": "Text",
		"icon": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Coursecategory API

[Default update API] — This is the designated default update API for the courseCategory data object. Frontend generators and AI agents should use this API for standard CRUD operations. Admin updates course category/subject tag.

Rest Route

The updateCourseCategory API REST controller can be triggered via the following route:

/v1/coursecategories/:courseCategoryId

Rest Request Parameters

The updateCourseCategory api has got 4 regular request parameters

Parameter Type Required Population
courseCategoryId ID true request.params?.[“courseCategoryId”]
name String false request.body?.[“name”]
description Text false request.body?.[“description”]
icon String false request.body?.[“icon”]
courseCategoryId : This id paremeter is used to select the required data object that will be updated
name : Unique category/subject name.
description : Category description.
icon : Emoji icon displayed next to the category name (e.g. 📐, 🗣️, 🎵)

REST Request To access the api you can use the REST controller with the path PATCH /v1/coursecategories/:courseCategoryId

  axios({
    method: 'PATCH',
    url: `/v1/coursecategories/${courseCategoryId}`,
    data: {
            name:"String",  
            description:"Text",  
            icon:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "courseCategory",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"courseCategory": {
		"id": "ID",
		"name": "String",
		"description": "Text",
		"icon": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Delete Coursecategory API

[Default delete API] — This is the designated default delete API for the courseCategory data object. Frontend generators and AI agents should use this API for standard CRUD operations. Admin deletes a course category/subject tag. Only admin allowed.

Rest Route

The deleteCourseCategory API REST controller can be triggered via the following route:

/v1/coursecategories/:courseCategoryId

Rest Request Parameters

The deleteCourseCategory api has got 1 regular request parameter

Parameter Type Required Population
courseCategoryId ID true request.params?.[“courseCategoryId”]
courseCategoryId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/coursecategories/:courseCategoryId

  axios({
    method: 'DELETE',
    url: `/v1/coursecategories/${courseCategoryId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "courseCategory",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"courseCategory": {
		"id": "ID",
		"name": "String",
		"description": "Text",
		"icon": "String",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Coursecategory API

[Default get API] — This is the designated default get API for the courseCategory data object. Frontend generators and AI agents should use this API for standard CRUD operations. Publicly fetch a course category/subject by name. No login required.

Rest Route

The getCourseCategory API REST controller can be triggered via the following route:

/v1/coursecategories/:name

Rest Request Parameters

The getCourseCategory api has got 1 regular request parameter

Parameter Type Required Population
name String true request.params?.[“name”]
name : Unique category/subject name… The parameter is used to query data.

REST Request To access the api you can use the REST controller with the path GET /v1/coursecategories/:name

  axios({
    method: 'GET',
    url: `/v1/coursecategories/${name}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

This route’s response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "courseCategory",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"courseCategory": {
		"isActive": true
	}
}

List Coursecategories API

[Default list API] — This is the designated default list API for the courseCategory data object. Frontend generators and AI agents should use this API for standard CRUD operations. Publicly list all course categories/subjects for navigation, filtering, and display. No login required.

Rest Route

The listCourseCategories API REST controller can be triggered via the following route:

/v1/coursecategories

Rest Request Parameters The listCourseCategories api has got no request parameters.

REST Request To access the api you can use the REST controller with the path GET /v1/coursecategories

  axios({
    method: 'GET',
    url: '/v1/coursecategories',
    data: {
    
    },
    params: {
    
        }
  });

REST Response

This route’s response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "courseCategories",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"courseCategories": [
		{
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

On Tutorapplicationreviewed API

API Frontend Description By The Backend Architect

Kafka event handler that creates tutor profile when auth service approves a tutor application. Listens to tutorhub-auth-service-tutorapplication-reviewed topic.

Rest Route

The onTutorApplicationReviewed API REST controller can be triggered via the following route:

/v1/ontutorapplicationreviewed

Rest Request Parameters

The onTutorApplicationReviewed api has got 8 regular request parameters

Parameter Type Required Population
tutorId ID true request.body?.[“tutorId”]
certifications String false request.body?.[“certifications”]
experience Text false request.body?.[“experience”]
subjects String false request.body?.[“subjects”]
bio Text false request.body?.[“bio”]
profilePhoto String false request.body?.[“profilePhoto”]
profileStatus Enum true request.body?.[“profileStatus”]
displayName String false request.body?.[“displayName”]
tutorId :
certifications : Tutor’s certifications (list of certificates, degrees, etc.).
experience : Brief experience summary or bio.
subjects : Areas of expertise/subjects offered for teaching.
bio : Optional full-length bio/description.
profilePhoto : Public profile photo URL (may be external or uploaded).
profileStatus :
displayName : Tutor’s display name, copied from auth user fullname at profile creation.

REST Request To access the api you can use the REST controller with the path POST /v1/ontutorapplicationreviewed

  axios({
    method: 'POST',
    url: '/v1/ontutorapplicationreviewed',
    data: {
            tutorId:"ID",  
            certifications:"String",  
            experience:"Text",  
            subjects:"String",  
            bio:"Text",  
            profilePhoto:"String",  
            profileStatus:"Enum",  
            displayName:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "tutorProfile",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"tutorProfile": {
		"id": "ID",
		"tutorId": "ID",
		"certifications": "String",
		"experience": "Text",
		"subjects": "String",
		"bio": "Text",
		"profilePhoto": "String",
		"profileStatus": "Enum",
		"profileStatus_idx": "Integer",
		"displayName": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Authentication Specific Routes

Common Routes

Route: currentuser

Route Definition: Retrieves the currently authenticated user’s session information.

Route Type: sessionInfo

Access Route: GET /currentuser

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /currentuser call
axios.get("/currentuser", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response Returns the session object, including user-related data and token information.

{
  "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9",
  "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
  "email": "user@example.com",
  "fullname": "John Doe",
  "roleId": "user",
  "tenantId": "abc123",
  "accessToken": "jwt-token-string",
  ...
}

Error Response 401 Unauthorized: No active session found.

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Route: permissions

*Route Definition*: Retrieves all effective permission records assigned to the currently authenticated user.

*Route Type*: permissionFetch

Access Route: GET /permissions

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /permissions call
axios.get("/permissions", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

Returns an array of permission objects.

[
  {
    "id": "perm1",
    "permissionName": "adminPanel.access",
    "roleId": "admin",
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  },
  {
    "id": "perm2",
    "permissionName": "orders.manage",
    "roleId": null,
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  }
]

Each object reflects a single permission grant, aligned with the givenPermissions model:

Error Responses

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Tip: Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations.

Route: permissions/:permissionName

Route Definition: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions.

Route Type: permissionScopeCheck

Access Route: GET /permissions/:permissionName

Parameters

Parameter Type Required Population
permissionName String Yes request.params.permissionName

Behavior

// Sample GET /permissions/orders.manage
axios.get("/permissions/orders.manage", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

{
  "canDo": true,
  "exceptions": [
    "a1f2e3d4-xxxx-yyyy-zzzz-object1",
    "b2c3d4e5-xxxx-yyyy-zzzz-object2"
  ]
}

All sources, documents and other digital materials are copyright of .

About Us

For more information please visit our website: .

. .