Sign-in · signInWithPassword
Sign in with a password
POST /api/auth/sign-in/email
Better Auth's sign-in. Errors are Better Auth's { code, message } (401 INVALID_EMAIL_OR_PASSWORD). Rate limited per IP. Needs the Turnstile-Token header when the server uses Cloudflare Turnstile (403 forbidden otherwise); never subject to the global daily caps.
- Who may call it
- Anyone (no credentials)
- Server
- https://api.logu.dev
Request body#
Content type application/json (required).
| Field | Type | Required | Notes |
|---|---|---|---|
email | string | required | |
password | string | required |
{
"email": "ana@example.com",
"password": "correct horse battery"
}
Example#
curl -s -X POST "https://api.logu.dev/api/auth/sign-in/email" \
-H "Content-Type: application/json" \
-d '{"email":"ana@example.com","password":"correct horse battery"}'
Responses#
200
Signed in.
{
"token": "Ln3Vq7",
"user": {
"id": "Xq3bY7tLmN2pR8sV",
"email": "ana@example.com",
"name": "Ana"
}
}
Response fields
| Field | Type | Required | Notes |
|---|---|---|---|
token | string | required | |
user | object | required | |
user.id | string | required | |
user.email | string | required | |
user.name | string | required |
Errors#
Every error is {"error":{"code","message","hint","docUrl","requestId"}}: branch on code. See Errors.
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request | The request is malformed or a field is invalid (see issues). |
| 403 | forbidden | The caller is authenticated but may not do this (wrong role, or an API key on a human-only endpoint). |
| 429 | rate_limited | This API key sent too many requests, or a human did too much too fast: sign-in attempts, workspaces created in a day, or a global daily cap on new accounts was reached. |
| 500 | internal_error | Something went wrong on Logu's side. |