The logout endpoint revokes the current bearer token and clears theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/GaelCeballos/Smart_Enviro_Backend/llms.txt
Use this file to discover all available pages before exploring further.
current_token field on the user record, releasing the single-session lock enforced by Smart Enviro Backend. After calling this endpoint, the same credentials can be used to log in from any device.
Endpoint
| Field | Value |
|---|---|
| Method | DELETE |
| Path | /api/logout |
| Auth required | Yes — Authorization: Bearer {token} |
Request Example
Authorization header.
What Happens on Logout
Calling this endpoint performs two operations atomically:- Clears
users.current_token— Sets thecurrent_tokencolumn on the authenticated user’s record tonull, releasing the single-session lock so the account can log in again from any device. - Deletes the Sanctum token record — Removes the corresponding row from the
personal_access_tokenstable viacurrentAccessToken()->delete(), immediately invalidating the token for all future requests.
401 Unauthorized.
Responses
200 OK — Logout successful
The token was revoked and the session lock was cleared.Always
"success" on a 200 response.Human-readable confirmation message (
"Cierre de sesión exitoso").401 Unauthorized — No valid token provided
Returned when theAuthorization header is missing, malformed, or contains a token that has already been revoked.
This endpoint uses the HTTP
DELETE method, not POST. Ensure your HTTP client or mobile app explicitly sets the request method to DELETE — some clients default to GET or POST when a body is not provided.