Skip to main content

POST /auth/login

Authenticate with your API credentials and receive an access_token and refresh_token.
This endpoint does not require authentication.

Request body

ParameterTypeRequiredDescription
emailstringYesYour account email address
passwordstringYesYour account password

Request

curl -X POST https://api.dokstamp.eu/auth/login \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "admin@myschool.edu",
    "password": "your_password"
  }'

Response 200

{
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...",
  "refresh_token": "def50200a9c4b...",
  "token_type": "Bearer",
  "expires_in": 31536000
}
FieldTypeDescription
access_tokenstringJWT token to include in Authorization: Bearer {token}
refresh_tokenstringToken used to obtain a new pair via POST /auth/refresh
token_typestringAlways "Bearer"
expires_inintegerValidity in seconds (31 536 000 ≈ 1 year)

Error 401

{ "message": "These credentials do not match our records." }

Error 422

{
  "message": "The given data was invalid.",
  "errors": {
    "email": ["The email field is required."],
    "password": ["The password field is required."]
  }
}