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.

required parameters

str

Login code returned by the login callback

Response Object

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.

required parameters

str

A user token value

str
str

Response Object

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.

required parameters

str

An email address.

m.Profile

A user profile as a collection of string properties.

optional parameters

str | None

A username.

Response Object

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.

optional parameters

str | None

An email address.

str | None

The id of a user or a service.

str | None

A username.

Response Object

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.

optional parameters

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.

Response Object

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.

optional parameters

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.

Response Object

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.

optional parameters

str | None

The identity of a user or a service.

str | None

An email address.

str | None

A username.

Response Object

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.

required parameters

m.Profile

Updates to a user profile.

optional parameters

str | None

The identity of a user or a service.

str | None

An email address.

str | None

A username.

Response Object

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.

required parameters

str

An ID for an authenticator.

optional parameters

str | None

The identity of a user or a service.

str | None

An email address.

str | None

A username.

Response Object

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.

optional parameters

str | None

An email address.

str | None

The identity of a user or a service.

str | None

A username.

Response Object

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",
)