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)

Create a user.

required parameters

str

An email address

m.Profile

A user profile as a collection of string properties

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)

Delete a user.

optional parameters

str

An email address

str

The id of a user or a service

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)

Update user's settings.

required parameters

bool

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

bool

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

optional parameters

str

The identity of a user or a service

str

An email address

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)

Get user's information by identity or email.

optional parameters

str

The identity of a user or a service

str

An email address

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)

Update user's information by identity or email.

required parameters

m.Profile

Updates to a user profile

optional parameters

str

The identity of a user or a service

str

An email address

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)

Delete a user's authenticator.

required parameters

str

An ID for an authenticator

optional parameters

str

The identity of a user or a service

str

An email address

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)

Get user's authenticators by identity or email.

optional parameters

str

An email address

str

The identity of a user or a service

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