Skip to main content
POST
/
api
/
v1
/
auth
/
login
curl -X POST https://api.example.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "johndoe",
    "password": "securePassword123"
  }'
{
  "username": "johndoe",
  "message": "Login successful",
  "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqb2huZG9lIiwiaWF0IjoxNzA5NzI0OTMwLCJleHAiOjE3MDk4MTEzMzB9.1x2y3z4a5b6c7d8e9f0g1h2i3j4k5l6m7n8o9p0q1r2",
  "status": true
}
This endpoint authenticates a user with their username and password, returning a JWT (JSON Web Token) for subsequent authenticated requests.

Request Body

username
string
required
The username of the user. Cannot be blank.
password
string
required
The password of the user. Cannot be blank.

Response

username
string
The username of the authenticated user.
message
string
A confirmation message about the login status.
jwt
string
The JWT (JSON Web Token) access token for subsequent authenticated requests. This token should be included in the Authorization header as a Bearer token for protected endpoints.Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
status
boolean
A boolean indicating the success of the login operation.
curl -X POST https://api.example.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "johndoe",
    "password": "securePassword123"
  }'
{
  "username": "johndoe",
  "message": "Login successful",
  "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqb2huZG9lIiwiaWF0IjoxNzA5NzI0OTMwLCJleHAiOjE3MDk4MTEzMzB9.1x2y3z4a5b6c7d8e9f0g1h2i3j4k5l6m7n8o9p0q1r2",
  "status": true
}

Build docs developers (and LLMs) love