Skip to main content

PUT /api/v1/users

Modifies an existing users resource.

This endpoint documentation is generated from the current Fastify route implementation and should be treated as the implementation-level contract for this version of the API.

Source route file: src/api/routes/external/public/users/put.ts

Request Method

PUT

Base URL

https://api.userdocks.local:5000

Endpoint

/api/v1/users

Path Variables

No path variables.

Query Parameters

VariableTypeRequiredDescription
languagestringtrueQuery parameter parsed by route handler.

HTTP Headers

VariableTypeRequiredDescription
OriginstringfalseUsed for custom-domain lookup in public app resolution.
Content-TypestringtrueUse application/json for JSON request bodies.

Request Body

Schema reference: forgotOrResetUserPasswordSchema

Forgot-password flow body:

{
"appUuid": "11111111-1111-1111-1111-111111111111",
"email": "user@example.com",
"acceptPrivacyPolicy": false
}

Reset-password flow body:

{
"appUuid": "11111111-1111-1111-1111-111111111111",
"email": "user@example.com",
"confirmHash": "confirm-hash-from-email",
"password": "VeryStrongPass123!",
"passwordConfirmation": "VeryStrongPass123!",
"acceptedTermsAndConditions": true,
"acceptedDataPrivacy": true,
"acceptPrivacyPolicy": false
}

Successful Response

Success status code(s): 200.

{
"kind": "users",
"totalItems": 0,
"itemsLength": 0,
"items": []
}

Error Responses

HTTP StatusExample Error
400{"errors":[{"validation":"error","code":"[E4000]","message":"Bad Request / validation error"}]}
500{"errors":[{"validation":"error","code":"[E0000]","message":"Internal Server Error"}]}

Example

const query = new URLSearchParams({
language: 'en',
});
const url = `https://api.userdocks.local:5000/api/v1/users?${query.toString()}`;

const response = await fetch(url, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: '{"appUuid":"11111111-1111-1111-1111-111111111111","email":"user@example.com","confirmHash":"confirm-hash-from-email","password":"VeryStrongPass123!","passwordConfirmation":"VeryStrongPass123!","acceptedTermsAndConditions":true,"acceptedDataPrivacy":true,"acceptPrivacyPolicy":false}',
});
const data = await response.json();
console.log(response.status, data);