Table: workos_user - Query WorkOS Users using SQL
WorkOS is a platform that provides a set of APIs to help developers quickly add enterprise-ready features to their applications. It includes capabilities for Single Sign-On, Directory Sync, and Audit Trail, among others. A WorkOS User is an individual with access to WorkOS, with details including user ID, email, first and last names, and related organization data.
Table Usage Guide
The workos_user
table provides insights into user details within WorkOS. As a developer or security analyst, explore user-specific details through this table, including user ID, email, first and last names, and related organization data. Utilize it to uncover information about users, such as their associated organizations and roles, aiding in user management and security analysis.
Examples
Basic info
Explore the user profiles within your organization to gain insights into their status and creation date. This can help in assessing the user activity and managing the user database effectively.
select id, user_name, state, directory_id, organization_id, created_at, first_name, last_namefrom workos_user;
select id, user_name, state, directory_id, organization_id, created_at, first_name, last_namefrom workos_user;
List suspended users
Identify users whose accounts are currently suspended. This is useful for account management and to ensure that any unexpected or unauthorized suspensions are immediately addressed.
select id, user_name, state, directory_id, organization_id, created_at, first_name, last_namefrom workos_userwhere state = 'suspended';
select id, user_name, state, directory_id, organization_id, created_at, first_name, last_namefrom workos_userwhere state = 'suspended';
List users of a particular group
Explore which users belong to a specific group, allowing for efficient management and organization of user access and permissions. This is particularly beneficial in large organizations where grouping users can simplify administrative tasks.
select workos_user.id, user_name, state, directory_id, organization_id, created_at, first_name, last_namefrom workos_user, jsonb_array_elements(groups) as gwhere g ->> 'Name' = 'test';
select workos_user.id, user_name, state, directory_id, organization_id, created_at, first_name, last_namefrom workos_user, json_each(groups) as gwhere json_extract(g.value, '$.Name') = 'test';
List users of a particular organization
Explore which users belong to a specific organization, gaining insights into their user ID, username, and other relevant details. This can be useful for managing user access and understanding user distribution across different organizations.
select u.id as user_id, u.user_name, u.state, u.directory_id, u.organization_id, u.created_at, u.first_name, u.last_namefrom workos_user as u, workos_organization as owhere u.organization_id = o.id and o.name = 'test';
select u.id as user_id, u.user_name, u.state, u.directory_id, u.organization_id, u.created_at, u.first_name, u.last_namefrom workos_user as u, workos_organization as owhere u.organization_id = o.id and o.name = 'test';
List users of a particular directory
Explore which users are associated with a specific directory to manage access and permissions efficiently. This is particularly useful for administrators seeking to maintain security and organization within their system.
select u.id as user_id, u.user_name, u.state, u.directory_id, u.organization_id, u.created_at, u.first_name, u.last_namefrom workos_user as u, workos_directory as dwhere u.directory_id = d.id and d.name = 'test';
select u.id as user_id, u.user_name, u.state, u.directory_id, u.organization_id, u.created_at, u.first_name, u.last_namefrom workos_user as u, workos_directory as dwhere u.directory_id = d.id and d.name = 'test';
Schema for workos_user
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
created_at | timestamp with time zone | The user's created at date. | |
custom_attributes | jsonb | The user's custom attributes in raw encoded JSON. | |
directory_id | text | = | The identifier of the directory the directory user belongs to. |
emails | jsonb | The user's e-mails. | |
first_name | text | The user's first name. | |
groups | jsonb | The user's groups. | |
id | text | = | The User's unique identifier. |
idp_id | text | The user's unique identifier assigned by the directory provider. | |
job_title | text | The user's job title. | |
last_name | text | The user's last name. | |
organization_id | text | The identifier for the organization in which the directory resides. | |
raw_attributes | jsonb | The user's raw attributes in raw encoded JSON. | |
state | text | The user's state. | |
title | text | Title of the resource. | |
updated_at | timestamp with time zone | The user's updated at date. | |
user_name | text | The user's username. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- workos
You can pass the configuration to the command with the --config
argument:
steampipe_export_workos --config '<your_config>' workos_user