Modules
Successfully fetched all modules
Feature restricted to Pro users
Unauthorized - User not found
Internal Server Error
GET /api/v2/getModules HTTP/1.1
Host: api-dev.jsmon.sh
Accept: */*
{
"message": "Successfully fetched all the modules...",
"data": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
]
}
This endpoint allows users to update a specific module by its moduleId
. The user must be authenticated, and only the user's own modules can be updated.
The ID of the module to be updated.
60e8c41f2bfa1c001748f7a9
The name of the module.
User Management
The regex pattern associated with the module.
^[a-zA-Z0-9]+$
Module updated successfully
Invalid input data
Module not found
Internal server error
PUT /modules/{moduleId} HTTP/1.1
Host: api-dev.jsmon.sh
Content-Type: application/json
Accept: */*
Content-Length: 63
{
"moduleName": "User Management",
"moduleRegex": "^[a-zA-Z0-9]+$"
}
{
"message": "Module updated successfully",
"data": {
"_id": "60e8c41f2bfa1c001748f7a9",
"moduleName": "User Management",
"moduleRegex": "^[a-zA-Z0-9]+$"
}
}
This endpoint allows users to delete a specific module by its moduleId
. The user must be authenticated, and only the user's own modules can be deleted.
The ID of the module to be deleted.
60e8c41f2bfa1c001748f7a9
Module deleted successfully
Module not found
Internal server error
DELETE /modules/{moduleId} HTTP/1.1
Host: api-dev.jsmon.sh
Accept: */*
{
"message": "Module deleted successfully",
"data": {
"acknowledged": true,
"deletedCount": 1
}
}
This endpoint retrieves all modules associated with the authenticated user.
Modules retrieved successfully
Unauthenticated user. Login required.
Internal server error
GET /modules HTTP/1.1
Host: api-dev.jsmon.sh
Accept: */*
{
"message": "Modules retrieved",
"data": [
{
"_id": "60e8c41f2bfa1c001748f7a9",
"moduleName": "User Management",
"moduleRegex": "^[a-zA-Z0-9]+$"
}
]
}
This endpoint tests a module's regex against an array of test strings and returns the matching results.
^[a-zA-Z]+$
["testModule","123Invalid","anotherTest"]
Matches processed successfully
Bad request - validation errors
Unauthorized user
Internal server error
POST /api/v2/testModules HTTP/1.1
Host: api-dev.jsmon.sh
Content-Type: application/json
Accept: */*
Content-Length: 78
{
"moduleRegex": "^[a-zA-Z]+$",
"test": [
"testModule",
"123Invalid",
"anotherTest"
]
}
{
"message": "Matches processed",
"data": [
{
"moduleRegex": "^[a-zA-Z]+$",
"testString": "testModule",
"matches": [
"testModule"
]
}
]
}
Change module visibility to 'inVerification' and send an email notification
This endpoint updates the visibility of a specified module to 'inVerification' and sends an email notification to inform about the visibility change.
64c1f678aceb400011a0c8b5
Module visibility updated and email sent successfully
Bad request - missing or invalid fields
Unauthorized user
Module not found
Internal server error
POST /api/v2/changeVisibility HTTP/1.1
Host: api-dev.jsmon.sh
Content-Type: application/json
Accept: */*
Content-Length: 39
{
"moduleId": "64c1f678aceb400011a0c8b5"
}
{
"message": "Module updated successfully and email sent",
"data": {
"moduleId": "64c1f678aceb400011a0c8b5",
"visibility": "inVerification"
}
}