Modules

Get all available modules for Pro users

get
/api/v2/getModules
Authorizations
Responses
200

Successfully fetched all modules

application/json
get
/api/v2/getModules
GET /api/v2/getModules HTTP/1.1
Host: api-dev.jsmon.sh
Accept: */*
{
  "message": "Successfully fetched all the modules...",
  "data": [
    {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ]
}

Update a module by its ID

put
/modules/{moduleId}

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.

Authorizations
Path parameters
moduleIdstringRequired

The ID of the module to be updated.

Example: 60e8c41f2bfa1c001748f7a9
Body
moduleNamestringOptional

The name of the module.

Example: User Management
moduleRegexstringOptional

The regex pattern associated with the module.

Example: ^[a-zA-Z0-9]+$
Responses
200

Module updated successfully

application/json
put
/modules/{moduleId}
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]+$"
  }
}

Delete a module by its ID

delete
/modules/{moduleId}

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.

Authorizations
Path parameters
moduleIdstringRequired

The ID of the module to be deleted.

Example: 60e8c41f2bfa1c001748f7a9
Responses
200

Module deleted successfully

application/json
delete
/modules/{moduleId}
DELETE /modules/{moduleId} HTTP/1.1
Host: api-dev.jsmon.sh
Accept: */*
{
  "message": "Module deleted successfully",
  "data": {
    "acknowledged": true,
    "deletedCount": 1
  }
}

Fetch all modules for the authenticated user

get
/modules

This endpoint retrieves all modules associated with the authenticated user.

Authorizations
Responses
200

Modules retrieved successfully

application/json
get
/modules
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]+$"
    }
  ]
}

Test module regex against an array of strings

post
/api/v2/testModules

This endpoint tests a module's regex against an array of test strings and returns the matching results.

Authorizations
Body
moduleRegexstringOptionalExample: ^[a-zA-Z]+$
teststring[]OptionalExample: ["testModule","123Invalid","anotherTest"]
Responses
200

Matches processed successfully

application/json
post
/api/v2/testModules
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

post
/api/v2/changeVisibility

This endpoint updates the visibility of a specified module to 'inVerification' and sends an email notification to inform about the visibility change.

Authorizations
Body
moduleIdstringOptionalExample: 64c1f678aceb400011a0c8b5
Responses
200

Module visibility updated and email sent successfully

application/json
post
/api/v2/changeVisibility
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"
  }
}