Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

Log in and issue an access token

Public. Exchanges an email and a password for a bearer token. Repeated failures from one address are throttled, and an inactive account is refused once the password checks out.

POST/api/v1/auth/login
Request body
requiredapplication/json
emailstringrequired
min length 1
passwordstringrequired
min length 1
Responses
200

Signed in

access_tokenstringrequired
token_typestringrequired
user_idstringrequired
rolestringrequired
branch_idstringrequired
branch_namestringrequired
full_namestringrequired
400

Invalid request body: an email and a password are required

detailstringrequired
401

Invalid email or password

detailstringrequired
403

Account is inactive

detailstringrequired
429

Too many login attempts, try again later

detailstringrequired
Try it
Server
Bodyapplication/json
Request
curl -X POST 'http://localhost:8000/api/v1/auth/login' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "string",
  "password": "string"
}'
Response
{
  "access_token": "string",
  "token_type": "string",
  "user_id": "string",
  "role": "string",
  "branch_id": "string",
  "branch_name": "string",
  "full_name": "string"
}