Skip to main content
This API is available on self-hosted deployments only. See Self-Hosting for setup instructions and User Management: OIDC Integration for authentication configuration.

How This Helps

The User Management API provides programmatic control over user accounts on self-hosted deployments. Create users, assign roles, reset passwords, manage sessions, and control workspace membership — all through REST endpoints backed by Keycloak.

Prerequisites

  • A self-hosted Visual Layer deployment with authentication enabled (DISABLE_AUTH: false).
  • An authenticated session with a user that has the Keycloak manage-users realm role (for write operations) or view-users role (for read operations).
  • User management enabled (automatic when RUN_MODE=ONPREM and auth is not disabled).

List Users

Retrieve all users registered in the system.

Query Parameters

Example

Response

User Object Fields


Get User

Retrieve details for a specific user.

Path Parameters

Example

Response

Returns a single User object.

Create User

Create a new user account. This is an atomic operation — the user is created in both Keycloak and the Visual Layer database. If either step fails, the operation is rolled back.

Request Body

Example

Response (201 Created)

Returns the created User object.
Promoting a user to the admin role in single-workspace mode demotes all existing admins to editor. Only one admin is allowed per workspace. The demoted admins are logged out and must re-authenticate.

Update User

Update the username or enabled status of an existing user.

Path Parameters

Request Body

Include at least one field.

Example

Response

Returns the updated User object.

Delete User

Permanently remove a user account. This is an atomic operation that cleans up all associated data.

Path Parameters

Example

Response

The deletion process:
  1. Transfers ownership of all datasets owned by the deleted user to the admin performing the deletion.
  2. Removes all workspace membership records.
  3. Deletes the user from Keycloak.
  4. Deletes the shadow user record from the Visual Layer database.
You cannot delete your own account. Attempting to do so returns a 400 error. In single-workspace mode, you also cannot delete the last remaining admin — promote another user first.

Reset Password

Reset a user’s password. The new password is set as temporary — the user must change it on next login.

Path Parameters

Request Body

Example

Response

The user is automatically logged out from all active sessions and must re-authenticate with the new temporary password.

Logout User

Terminate all active sessions for a user, forcing them to re-authenticate.

Path Parameters

Example

Response


Get User Sessions

List all active sessions for a user.

Path Parameters

Example

Response


Update User Roles

Replace all realm roles assigned to a user.

Path Parameters

Request Body

Example

Response

Returns the updated User object with the new roles.
This endpoint replaces all existing roles. Include every role the user should have, not just the ones you want to add. Invalid role names are silently ignored.

Roles Reference

Workspace Roles

Workspace roles control what a user can do within Visual Layer. Assign these via the workspace_role field when creating users, or through the Workspace Members API.

Keycloak Realm Roles

These roles control access to the User Management API itself. They are managed through Keycloak and determine which API endpoints a user can call.

Python Example


Response Codes

See Error Handling for the error response format.

OIDC Integration

Configure your Identity Provider for Single Sign-On with Visual Layer.

Workspaces & Organizations

Manage workspace membership and roles programmatically.

Admin Settings

View and update runtime configuration on self-hosted deployments.

Self-Hosting Setup

Install and configure a self-hosted Visual Layer deployment.