Update a user
const url = 'https://work.optidata.cloud/api/drives/1/users/1';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","email":"hello@example.com","role":"example","status":"active","password":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://work.optidata.cloud/api/drives/1/users/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "email": "hello@example.com", "role": "example", "status": "active", "password": "example" }'Replaces the user’s name, e-mail, role and status. The same rules as creation apply — in particular the e-mail must be unique across the tenant.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Numeric id of the drive. Read it from GET /drives/config.json.
Numeric id of the user.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Responses
Section titled “ Responses ”The updated user.
object
A user of the tenant.
object
Identifier of the company (tenant) the user belongs to.
Role of the user inside the tenant.
Profile extras (avatar, job title). Loaded only where noted.
Groups the user belongs to. Loaded only where noted.
A group of users inside the tenant.
object
Tenant-wide identifier of the group; used in paths.
Members of the group, each with its embedded user.
object
Presence status of the user. Loaded only where noted.
Rendered presence details (type, icon, message). Present on dashboard listings.
Example
{ "user": { "id": 15, "uuid": "9c1f0e2a-4d31-4d8a-8c1a-1f0b6b1f9a10", "cuid": "a1b2c3d4-2226-46c1-91b2-a9e9ba4c2d5b", "username": "jane.doe@acme.example", "email": "jane.doe@acme.example", "name": "Jane Doe", "full_name": "Jane Doe", "company_name": "Acme", "role": "super-admin", "status": "active", "groups": [ { "id": 560, "guid": "a19d5670-335d-4285-8ee4-fcb54cb70faf", "name": "Finance" } ] }}Missing, malformed or expired authentication key.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The caller lacks the permission level the operation requires.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "This action is unauthorized."}The resource does not exist, or does not belong to the given drive.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "No query results for model [App\\Models\\Node] 99999999"}The request body or query string failed validation.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The name field is required.", "errors": { "name": [ "The name field is required." ] }}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}