Login
Authenticate and receive a JWT token for accessing the API.
Endpoint
POST /login
Headers
Header | Value |
---|---|
Content-Type | application/json |
Request Body
Field | Type | Required | Description |
---|---|---|---|
username | string | ✅ | The username of your account |
password | string | ✅ | The password for your account |
Example Request
curl -X POST -H "Content-Type: application/json" \
-d '{"username": "admin", "password": "password"}' \
http://localhost:9000/login
Response
Success Response (200 OK)
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjY3NDQ4NDMsInVzZXJuYW1lIjoiYWRtaW4ifQ.eYkCNem24-6rpw8aXo6NIcN6xtU9rqq2_2YYz1nS82Q"
}
Response Fields
Field | Type | Description |
---|---|---|
token | string | JWT token for authenticating subsequent API requests |
Notes
- The JWT token should be included in the
Authorization
header asBearer <token>
- Tokens have an expiration time - you may need to re-authenticate periodically
- Store the token securely and do not share it with unauthorized parties
- Use this token for all authenticated API endpoints
- If authentication fails, check your username and password credentials