Developer reference

API Documentation

Available HTTP endpoints for PMS Service API, including request methods, controllers, authentication, and payload details.

Route index

Method Path Handler
POST /api/v1/access/token AuthController.getToken
POST / GET /api/v1/access/tokenValid AuthController.tokenValid
GET /api/v1/users UserController.getUsers
PUT /api/v1/entrance/login entrance/login
POST /api/v1/entrance/signup entrance/signup
GET /ping view-ping

Authentication

POST /api/v1/access/token AuthController.getToken Public

Issue a Bearer JWT for machine-to-machine API access. Route mapping: 'POST /api/v1/access/token': 'AuthController.getToken'.

Headers

NameValue
Content-Typeapplication/json

Payload

FieldTypeRequiredDescription
user_namestringYesAPI user name
client_idstringYesMust match the user’s client ID
client_secretstringYesMust match the user’s client secret
security_tokenstringYesMust match the user’s security token
access_idstringYesAccess identity / device / account id
access_typestringYesMust be allowed for the user (e.g. quickgrind-netsuite, vmcs-register)
instancestringNoOptional instance identifier stored in the JWT
expirynumberNoOptional token lifetime override (seconds)

Example request

POST /api/v1/access/token
Content-Type: application/json

{
  "user_name": "api.user",
  "client_id": "your-client-id",
  "client_secret": "your-client-secret",
  "security_token": "your-security-token",
  "access_id": "plant-001",
  "access_type": "quickgrind-netsuite",
  "instance": "prod",
  "expiry": 3600
}

Success response

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer"
}

Error responses

StatusWhen
401Missing access_id
401User not found for user_name
401Invalid client_id, client_secret, or security_token
401User has no API access
401Invalid access_type for the user
POST /api/v1/access/tokenValid AuthController.tokenValid Public

Verify a Bearer JWT. Returns the token payload when valid, or an error when invalid/expired. Also available as GET /api/v1/access/tokenValid.

How to send the token

SourceExample
HeaderAuthorization: Bearer <token>
Body (POST){ "token": "<token>" }
Query?token=<token>

Example request

POST /api/v1/access/tokenValid
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Type: application/json

Success response

{
  "valid": true,
  "id": 12,
  "access_type": "quickgrind-netsuite",
  "access_id": "plant-001",
  "instance": "prod",
  "expiresIn": 3600,
  "iat": 1710000000,
  "exp": 1710003600
}

Error responses

StatusWhen
400No token provided / bad Authorization header format
401Invalid or expired token
PUT /api/v1/entrance/login Public

Sign in with email/password and create a browser session cookie.

Payload

FieldTypeRequiredDescription
email_addressstringYesUser email
passwordstringYesPlain-text password
platformstringNoDefaults to quickgrind
rememberMebooleanNoExtend session cookie lifetime

Example request

{
  "email_address": "admin@example.com",
  "password": "your-password",
  "rememberMe": true
}
POST /api/v1/entrance/signup Public

Create a new user account and sign the requester in.

Payload

FieldTypeRequiredDescription
emailAddressstringYesValid email address
passwordstringYesNew password
fullNamestringYesDisplay name
POST /api/v1/entrance/send-password-recovery-email Public

Send a password recovery email when Mailgun is configured.

Payload

FieldTypeRequiredDescription
emailAddressstringYesAccount email to recover
POST /api/v1/entrance/update-password-and-login Public

Set a new password using a recovery token, then log in.

Payload

FieldTypeRequiredDescription
passwordstringYesNew password
tokenstringYesPassword recovery token

Session / Account

GET /api/v1/account/logout Session

Clear the current browser session. Also available via /logout.

Payload

None
PUT /api/v1/account/update-password Session required

Update password for the currently logged-in user.

Payload

FieldTypeRequiredDescription
passwordstringYesNew password
PUT /api/v1/account/update-profile Session required

Update profile fields for the logged-in user.

Payload

FieldTypeRequiredDescription
fullNamestringNoDisplay name
emailAddressstringNoNew email address
PUT /api/v1/account/update-billing-card Session required

Update billing card details when Stripe is configured.

Payload

FieldTypeRequiredDescription
stripeTokenstringNoStripe token (empty clears card)
billingCardBrandstringNoCard brand
billingCardLast4stringNoLast 4 digits
billingCardExpMonthstringNoExpiry month
billingCardExpYearstringNoExpiry year
GET /api/v1/users UserController.getUsers Bearer JWT

Returns the decoded token payload for the authorized caller. Route mapping: 'GET /api/v1/users': 'UserController.getUsers'.

Headers

NameValue
AuthorizationBearer <token>

Payload

None

Example response

{
  "id": 1,
  "access_type": "quickgrind-netsuite",
  "access_id": "plant-001",
  "iat": 1710000000,
  "exp": 1710003600
}

Admin

These endpoints expect an authenticated browser session (logged-in admin).

POST /user/create Session required

Create a user from the admin UI.

Payload

{
  "inputs": {
    "first_name": "Jane",
    "middle_name": "",
    "last_name": "Doe",
    "user_name": "jane.doe",
    "email_address": "jane@example.com",
    "password": "hashed-or-plain-as-configured",
    "client_id": "client-id",
    "client_secret": "client-secret",
    "vmcs-register": true
  }
}
POST /user/updateuserinfo Session required

Update user profile fields from admin.

Payload

{
  "id": 12,
  "inputs": {
    "first_name": "Jane",
    "last_name": "Doe",
    "email_address": "jane@example.com",
    "user_name": "jane.doe"
  }
}
POST /user/updatepassword Session required

Update a user’s password from admin.

Payload

{
  "id": 12,
  "inputs": {
    "password": "new-password"
  }
}
POST /user/changeaccesstypes Session required

Replace a user’s access types.

Payload

{
  "id": 12,
  "inputs": {
    "vmcs-register": "true",
    "quickgrind-netsuite": "true"
  }
}
POST /user/resetsecuritytoken Session required

Generate and save a new security token for a user.

Payload

{
  "id": 12
}
POST /api/v1/deliver-contact-form-message Public

Deliver the public contact form message (email features depend on Mailgun config).

Utility

GET /ping Public

Health check endpoint.

Example response

{
  "success": true
}