-beta.*
suffix, for example, 3.2.0-beta.1
. For more information on how to use the beta versions, refer to the README in the GitHub repository.Full Changelog: https://github.com/workos/workos-python/compare/v5.4.3...v5.4.4
Full Changelog: https://github.com/workos/workos-python/compare/v5.4.2...v5.4.3
Full Changelog: https://github.com/workos/workos-python/compare/v5.4.1...v5.4.2
Full Changelog: https://github.com/workos/workos-python/compare/v5.4.0...v5.4.1
domain_verification
intent (https://github.com/workos/workos-python/pull/358)authentication.sso_failed
and authentication.oauth_failed
events (#355)Directory.metadata
field providing user and group counts information https://github.com/workos/workos-python/pull/352Full Changelog: https://github.com/workos/workos-python/compare/v5.1.0...v5.2.0
certificate_renewal
intent for Admin Portal by @alisherry https://github.com/workos/workos-python/pull/340Full Changelog: https://github.com/workos/workos-python/compare/v5.0.1...v5.0.2
base_url
parsing for build_url_with_query_params
, which fixes get_authorization_url
(#342)Full Changelog: https://github.com/workos/workos-python/compare/v5.0.0...v5.0.1
The v5 release is a major rewrite to add typing and improve consistency across the SDK. There are several breaking changes, which we recommend carefully testing before upgrading the SDK in production.
asyncio
support added to several feature modules including Directory Sync, Events, Organizations, SSO, and User Management# Previous client setup
import workos
workos.api_key = "sk_1234"
workos.client_id="client_1234"
# New client instantiation
from workos import WorkOSClient
workos_client = WorkOSClient(
api_key="sk_1234", client_id="client_1234"
)
# Previous usage
workos.client.directory_sync.list_users(
"directory_123", "group_456", 10
)
# New usage
workos_client.directory_sync.list_users(
directory_id="directory_123",
group_id="group_456",
limit=10
)
.dict()
method. See the example below:# Previous implementation
user = workos.client.user_management.get_user(user_id="user_123")
email = user["email"]
# New implementation
user = workos_client.user_management.get_user(user_id="user_123")
email = user.email
# Alternatively, the user object can be converted to a dictionary
user = workos_client.user_management.get_user(user_id="user_123")
user_dictionary = user.dict()
email = user["email"]
all_connections = []
for connection in workos_client.sso.list_connections():
all_connections.append(connection)
All unique ID parameters have to be suffixed with _id
for clarity, this introduced a number of breaking changes listed in the feature sections below
Order
for list methods has been removed in favor of the PaginationOrder
string literal. Instead of specifying Order.desc
or Order.asc
, use the literal strings desc
and asc
, respectively.
organization
argument renamed to organization_id
AuditLogEvent
TypedDict
from workos.types.audit_logs
actors
argument has been removed. Use actor_names
and actor_ids
instead.organization
argument renamed to organization_id
directory_sync.delete_directory() → directory
argument renamed to directory_id
directory_sync.get_directory() → directory
argument renamed to directory_id
directory_sync.get_group() → group
argument renamed to group_id
directory_sync.get_user() → user
argument renamed to user_id
directory_sync.list_groups()
directory_sync.list_groups()
has been removed. directory_sync.list_groups_v2()
has been renamed to directory_sync.list_groups()
.directory
argument renamed to directory_id
user
argument renamed to user_id
directory_sync.list_users()
directory_sync.list_users()
has been removed. directory_sync.list_users_v2()
has been renamed to directory_sync.list_users()
.directory
argument renamed to directory_id
group
argument renamed to group_id
mfa.verify_factor()
has been removed. Use mfa.verify_challenge()
instead.organizations.list_organizations()
has been removed. organizations.list_organizations_v2()
is now organizations.list_organizations()
.organizations.create_organization()
now takes payload contents as separate arguments:# Previous implementation
organization = workos_client.organizations.create_organization(
{
"name": "Foo Corp",
"domain_data": [
{
"domain": "foo-corp.com",
"state": "pending",
}
],
}
)
# New implementation
create_organization_payload = {
"name": "Foo Corp",
"domain_data": [
{
"domain": "foo-corp.com",
"state": "pending",
}
],
}
organization = workos_client.organizations.create_organization(
**create_organization_payload
)
organization
argument renamed to organization_id
organization
argument renamed to organization_id
organization
argument renamed to organization_id
passwordless.create_session()
now takes payload contents as separate arguments:# Previous implementation
passwordless_session = workos_client.passwordless.create_session({
"email": "marcelina@example.com",
"type": "MagicLink",
})
# New implementation
passwordless_session = workos_client.passwordless.create_session(
email="marcelina@example.com",
type="MagicLink",
)
id
argument renamed to session_id
organization
argument renamed to organization_id
sso.list_connections()
has been removed. sso.list_connections_v2()
has been renamed to sso.list_connections()
.organization
argument renamed to organization_id
connection
argument renamed to connection_id
domains
argument has been removed. Use the organization
argument instead.connection
argument renamed to connection_id
organization
argument renamed to organization_id
connection
argument renamed to connection_id
accessToken
argument renamed to access_token
provider
argument of type UserManagementProviderType
is now a string literal instead of an enumsession
argument renamed to session_id
# Previous implementation
user = workos_client.user_management.create_user(
{
"email": "marcelina@example.com",
"password": "i8uv6g34kd490s",
"first_name": "Marcelina",
"last_name": "Davis",
}
)
# New implementation
create_user_payload = {
"email": "marcelina@example.com",
"password": "i8uv6g34kd490s",
"first_name": "Marcelina",
"last_name": "Davis",
}
user = workos_client.user_management.create_user(**create_user_payload)
user_management.update_user()
now takes payload contents as separate arguments:# Previous implementation
user = workos_client.user_management.update_user(
user_id="user_01EHQ7ZGZ2CZVQJGZ5ZJZ1ZJGZ",
payload={"first_name": "Marcelina", "last_name": "Davis", "email_verified": True},
)
# New implementation
update_user_payload = {
"first_name": "Marcelina",
"last_name": "Davis",
"email_verified": True,
}
user = workos_client.user_management.update_user(
user_id="user_01EHQ7ZGZ2CZVQJGZ5ZJZ1ZJGZ",
**update_user_payload,
)
user_management.send_password_reset_email()
has been removed. Use user_management.create_password_reset()
instead.user_management.send_magic_auth_code()
has been removed. Use user_management.create_magic_auth()
instead.name
optional when updating an organization (#311)This is beta release of the next major version of the WorkOS Python SDK, which adds typing and asyncio support, among other smaller improvements. Full release notes and a migration guide are TBD.
This release contains breaking changes. Exercise caution when utilizing the beta release as it may contain bugs. Changes are not guaranteed to be non-breaking between beta releases.
Full Changelog: https://github.com/workos/workos-python/compare/v4.13.0...v5.0.0-beta1
organization_id
parameter to authenticate_with_refresh_token
(#296)lookup_key
. Contact support@workos.com for more information (#278)allow_profiles_outside_organization
Organization option as deprecated (#279)totp_secret
on user_management. enroll_auth_factor
(#273)user_management.find_invitation_by_token
method (#274)role
to Directory User (https://github.com/workos/workos-python/pull/267)inviter_user_id
to invitation object returned by API (#268)get_email_verification
, get_password_reset
, and create_password_reset
(#268)send_password_reset_email
method in favor of create_password_reset
(#268)Full Changelog: https://github.com/workos/workos-python/compare/v4.6.0...v4.7.0
domain_data
to Organizations Create and Update methods to replace the now deprecated domains
parameter (#257)organization_id
into the Events API as a parameter https://github.com/workos/workos-python/pull/259Full Changelog: https://github.com/workos/workos-python/compare/v4.3.0...v4.3.1
impersonator
data to User Management authentication responses (#237)