Skip to main content

AuthN | Python SDK | User Endpoints

User Endpoints

Get User (client token)

authn.client.userinfo(code)

Retrieve the logged in user's token and information.

str

Login code returned by the login callback

A PangeaResponse with credentials for a login session in the response.result field. Available response fields can be found in our API Documentation.

response = authn.client.userinfo(
    code="pmc_d6chl6qulpn3it34oerwm3cqwsjd6dxw",
)

Change a user's password

authn.client.password.change(token, old_password, new_password)

Change a user's password given the current password.

str

A user token value

str
str

A PangeaResponse with an empty object in the response.result field.

authn.client.password.change(
    token="ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
    old_password="hunter2",
    new_password="My2n+Password",
)

Create User

authn.user.create(email, profile, username)

Create a user.

str

An email address.

m.Profile

A user profile as a collection of string properties.

str | None

A username.

A PangeaResponse with a user and its information in the response.result field. Available response fields can be found in our API Documentation.

response = authn.user.create(
    email="joe.user@email.com",
    profile={
        "first_name": "Joe",
        "last_name": "User",
    }
)

Delete User

authn.user.delete(email, id, username)

Delete a user.

str | None

An email address.

str | None

The id of a user or a service.

str | None

A username.

A PangeaResponse with an empty object in the response.result field.

authn.user.delete(email="example@example.com")

List Users

authn.user.list(filter, last, order, order_by, size)

Look up users by scopes.

dict
str

Reflected value from a previous response to obtain the next page of results.

m.ItemOrder

Order results asc(ending) or desc(ending).

m.UserListOrderBy

Which field to order results by.

int

Maximum results to include in the response. Minimum: 1.

A PangeaResponse with a list of users in the response.result field. Available response fields can be found in our API Documentation.

response = authn.user.list()

Update user's settings

authn.user.update(disabled, unlock, id, email, username)

Update user's settings.

bool | None

New disabled value. Disabling a user account will prevent them from logging in.

bool | None

Unlock a user account if it has been locked out due to failed authentication attempts.

str | None

The identity of a user or a service.

str | None

An email address.

str | None

A username.

A PangeaResponse with a user and its information in the response.result field. Available response fields can be found in our API Documentation.

response = authn.user.update(
    email="joe.user@email.com",
    disabled=True,
)

Get user

authn.user.profile.get(id, email, username)

Get user's information by identity or email.

str | None

The identity of a user or a service.

str | None

An email address.

str | None

A username.

A PangeaResponse with a user and its information in the response.result field. Available response fields can be found in our API Documentation.

response = authn.user.profile.get(
    email="joe.user@email.com",
)

Update user

authn.user.profile.update(profile, id, email, username)

Update user's information by identity or email.

m.Profile

Updates to a user profile.

str | None

The identity of a user or a service.

str | None

An email address.

str | None

A username.

A PangeaResponse with a user and its information in the response.result field. Available response fields can be found in our API Documentation.

response = authn.user.profile.update(
    profile={
        "phone": "18085550173",
    },
    email: "joe.user@email.com",
)

Delete user authenticator

authn.user.authenticators.delete(authenticator_id, id, email, username)

Delete a user's authenticator.

str

An ID for an authenticator.

str | None

The identity of a user or a service.

str | None

An email address.

str | None

A username.

A PangeaResponse with an empty object in the response.result field.

authn.user.authenticators.delete(
    authenticator_id="pau_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
    id="pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5",
)

Get user authenticators

authn.user.authenticators.list(email, id, username)

Get user's authenticators by identity or email.

str | None

An email address.

str | None

The identity of a user or a service.

str | None

A username.

A PangeaResponse with a list of authenticators in the response.result field. Available response fields can be found in our API Documentation.

response = authn.user.authenticators.list(
    id="pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5",
)