Set Password
POST
/api/auth/set-password
const url = 'https://example.com/api/auth/set-password';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"new_password":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/auth/set-password \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "new_password": "example" }'Set an initial password for users who don’t have one (OAuth-only accounts).
Unlike change-password, this does NOT require a current password. It will reject requests from users who already have a password identity.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
SetPasswordBody
Body for setting an initial password (users without password identity).
object
new_password
required
New Password
string
Example generated
{ "new_password": "example"}Responses
Section titled “ Responses ”Successful Response
Media type application/json
SetPasswordResponse
{"set": True} after a successful initial-password set.
object
set
required
Set
boolean
Example generated
{ "set": true}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}