Skip to main content
POST
/
auth
/
login
Log In
curl --request POST \
  --url https://api.example.com/auth/login \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "password": "<string>"
}
'
{
  "token": "<string>",
  "error": "<string>"
}

Request

email
string
required
The email address of the user account
password
string
required
The password for the user account

Response

token
string
Authentication token for the authenticated user

Success Response

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Error Responses

error
string
Error message describing what went wrong

500 Internal Server Error

Returned when an unexpected error occurs during authentication, including invalid credentials.
{
  "error": "An unexpected error occurred. Please try again later."
}

Examples

curl -X POST https://api.planttogether.com/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "securePassword123"
  }'

Build docs developers (and LLMs) love