The NWMS API uses Bearer Token Authentication based on Laravel Sanctum. You must include a valid token with each request to protected endpoints.
Send a POST
request to /api/login
:
POST /api/login
Content-Type: application/json
{
"email": "your@email.com",
"password": "your_password"
}
Successful response:
{
"access_token": "1|your_generated_token",
"token_type": "Bearer"
}
For all authenticated requests, add the following HTTP header:
Authorization: Bearer 1|your_generated_token
In Swagger UI, click the Authorize button and paste the token like this:
Bearer 1|your_generated_token
To revoke the current token:
POST /api/logout
Authorization: Bearer 1|your_generated_token