Sign-in · signUpWithPassword
Create an account with a password
POST /api/auth/sign-up/email
Better Auth's sign-up. The email isn't verified yet: Logu emails a confirmation link (needed to accept invitations). Errors are Better Auth's { code, message }. The session token is in set-auth-token. Needs the Turnstile-Token header when the server uses Cloudflare Turnstile (403 forbidden otherwise), and a new account counts against a global daily cap (429 rate_limited when it is reached; accounts that exist are unaffected).
- Who may call it
- Anyone (no credentials)
- Server
- https://api.logu.dev
Request body#
Content type application/json (required).
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | required | 1–64 chars |
email | string | required | |
password | string | required | 10–128 chars |
{
"name": "Ana",
"email": "ana@example.com",
"password": "correct horse battery"
}
Example#
curl -s -X POST "https://api.logu.dev/api/auth/sign-up/email" \
-H "Content-Type: application/json" \
-d '{"name":"Ana","email":"ana@example.com","password":"correct horse battery"}'
Responses#
200
Signed up and 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. |