POST, PUT, PATCH, DELETE) do.
Getting a Token
Send aPOST request to /api/auth/login with your credentials in the request body.
Request Body Parameters
string
required
Your NodeForgeCMS admin username.
string
required
Your NodeForgeCMS admin password.
Login Request
Successful Response
On success, the API returns a200 response containing your JWT token and basic information about the authenticated user:
Store the
token value securely — you’ll include it in the Authorization header of every authenticated request.
Using the Token
Once you have a token, pass it in theAuthorization header as a Bearer token on every request that requires authentication:
curl Example
YOUR_TOKEN with the full token string returned from the login endpoint. The Bearer prefix (with the trailing space) is required.
Never expose your token in client-side code, public repositories, or logs. Treat it with the same care as a password. If a token is compromised, re-authenticate to obtain a new one.
Token Expiry
Tokens expire after a configured period defined in your NodeForgeCMS server settings. When a token expires, the API will reject it with a401 Unauthorized response:
POST /api/auth/login again with your credentials to obtain a fresh token. There is no refresh-token mechanism — each new session requires a full login.
Error Responses
401 Example — Missing or Invalid Token
403 Example — Insufficient Permissions
403, check that the authenticated user has the appropriate role for the operation. Certain endpoints — such as user administration — may be restricted to users with the admin role only.