Sign-in · setPassword
Set or change your password
POST /api/auth/password
Needs the current password unless this session started in the last 15 minutes (the magic-link reset path). Signs out the other sessions.
- Who may call it
- Anyone (no credentials)
- Server
- https://api.logu.dev
Request body#
Content type application/json (required).
A new password (and the current one, unless fresh). Strict.
| Field | Type | Required | Notes |
|---|---|---|---|
newPassword | string | required | 10–128 chars |
currentPassword | string | optional | 0–128 chars |
{
"newPassword": "a long new password",
"currentPassword": "the old one"
}
Example#
curl -s -X POST "https://api.logu.dev/api/auth/password" \
-H "Authorization: Bearer $LOGU_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"newPassword":"a long new password","currentPassword":"the old one"}'
Responses#
200
Saved.
{
"ok": true,
"revoked": 2
}
Response fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | true | required | |
revoked | integer | required |
Errors#
Every error is {"error":{"code","message","hint","docUrl","requestId"}}: branch on code. See Errors.
| Status | Code | Meaning |
|---|---|---|
| 400 | unknown_field | The body has a field the endpoint doesn't know (often a typo or snake_case). |
| 400 | bad_request | The request is malformed or a field is invalid (see issues). |
| 401 | unauthorized | No credentials, or the API key or session is invalid or revoked. |
| 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. |