1. Auth
api-security
  • Security-Api
    • Roles
      • Index
      • Create
      • Show
      • Update
      • Delete
    • Devices
      • Index
      • Show
      • Create
      • Update
      • Delete
    • Security Event
      • Index
      • Show
      • Create
      • Update
      • Delete
    • Alerts
      • Index
      • Show
      • Create
      • Update
      • Delete
    • Incidents
      • Index
      • Show
      • Create
      • Update
      • Delete
    • Incident Comments
      • Index
      • Show
      • Create
      • Update
      • Delete
    • Auth
      • Login
        POST
      • Logout
        POST
      • Me
        GET
    • Dashboard
      • Index
    • Notifications
      • Index
      • Unread
      • Mark As Read
  1. Auth

Login

Developing
POST
http://127.0.0.1:8000/api/login
Authenticate a user and generate a Sanctum access token.

Request

Header Params

Body Params application/jsonRequired

Examples

Responses

🟢200Success
application/json
Bodyapplication/json

🟠401Invalid credentials
🔴501Not Implemented
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'http://127.0.0.1:8000/api/login' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "admin@securityapi.com",
    "password": "password123"
   
}'
Response Response Example
200 - Éxito
{
    "message": "Login successfull.",
    "user": {
        "id": 1,
        "name": "admin",
        "role_id": 1,
        "email": "admin@securityapi.com",
        "email_verified_at": null,
        "created_at": "2026-06-05T13:46:36.000000Z",
        "updated_at": "2026-06-05T13:46:36.000000Z"
    },
    "token": "9|70ZJYhz4MSjedp7QJvOCXMSgLIcVf0AtQUxVPWBTcb7856f3"
}
Modified at 2026-06-16 14:02:37
Previous
Delete
Next
Logout
Built with