Skip to main content

Endpoint

curl -X POST http://localhost:8000/api/v1/auth/login \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "username=admin&password=admin123"
POST /api/v1/auth/login Authenticate using local credentials (username and password) to receive a JWT access token.

Authentication

No authentication required for this endpoint.

Request Parameters

This endpoint accepts form data (application/x-www-form-urlencoded):
username
string
required
The username for authentication
password
string
required
The password for authentication

Response

access_token
string
JWT access token for authenticated requests
token_type
string
Token type (always “bearer”)

Success Response Example

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "bearer"
}

Error Responses

401 Unauthorized

Returned when credentials are incorrect.
{
  "detail": "Incorrect username or password"
}
Headers:
WWW-Authenticate: Bearer

Build docs developers (and LLMs) love