Skip to content

Latest commit

 

History

History
1431 lines (1004 loc) · 20.2 KB

File metadata and controls

1431 lines (1004 loc) · 20.2 KB

Reference

Members

client.members.list(...) -> ListMembersResponseContent

📝 Description

This endpoint retrieves a paginated list of all members under the current team. It supports checkpoint-based pagination for efficient retrieval of large datasets

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.members.list(
    take=1,
    from_="from",
)

⚙️ Parameters

take: typing.Optional[int] — Maximum number of items to return per page. Defaults to 50. Maximum 50

from: typing.Optional[str] — Checkpoint cursor for pagination; use the 'next' value from a previous response to fetch the next page

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.members.invite(...) -> InviteMembersResponseContent

📝 Description

This endpoint invites a new member to the team and optionally grants them access to one or more tenants with specified roles

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.members.invite(
    email="jane.smith@company.com",
    role="teams_contributor",
    tenant_ids=[
        "538c9e21-e3d5-4ad6-b3d0-352c62369fb0",
        "b1c9e21e-1234-4ad6-b3d0-352c6236abcd"
    ],
    tenant_roles=[
        "owner",
        "editor-users"
    ],
    client_ids=[
        "client_123",
        "client_456"
    ],
)

⚙️ Parameters

email: str — The email of the team member

role: TeamMemberRoleEnum

tenant_ids: typing.Optional[typing.List[TenantId]] — Specifies an optional list of tenant IDs and their corresponding role assignments.

tenant_roles: typing.Optional[typing.List[TenantMemberRoleEnum]] — The list of roles for each tenant.

client_ids: typing.Optional[typing.List[ClientId]] — The list of apps the user has access to for the 'editor-specific-apps' role. This property is only present for this role.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.members.get(...) -> GetMembersResponseContent

📝 Description

Returns the team member's identity and team-level role. Tenant access is retrieved via /api/members/{id}/tenants/{environment}.

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.members.get(
    id="id",
)

⚙️ Parameters

id: str — The unique ID of the team member to retrieve.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.members.delete(...)

📝 Description

This endpoint deletes a team member from the team.

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.members.delete(
    id="id",
)

⚙️ Parameters

id: str — The unique ID of the team member to delete.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.members.update(...) -> UpdateMembersResponseContent

📝 Description

This endpoint can be used to change the team-level role for the team member

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.members.update(
    id="id",
    role="teams_owner",
)

⚙️ Parameters

id: str — The unique ID of the team member to update

role: TeamMemberRoleEnum — The new role to assign to the team member.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Tenants

client.tenants.list(...) -> ListTenantsResponseContent

📝 Description

This endpoint retrieves a paginated list of tenants for a specified team. It supports cursor-based pagination to ensure efficient data retrieval across large datasets. If the private cloud support beta is enabled for the team, the response includes both public and private tenants; otherwise, only public tenants are returned. To navigate results, the next cursor from the response should be used to fetch subsequent pages.

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.tenants.list(
    take=1,
    from_="from",
    sort="sort",
    environment="US-3",
    environment_tag="development",
    locality="us",
)

⚙️ Parameters

take: typing.Optional[int] — Maximum number of items to return per page. Defaults to 50. Maximum 50

from: typing.Optional[str] — Checkpoint cursor for pagination; use the 'next' value from a previous response to fetch the next page

sort: typing.Optional[str] — Sort order for results using MongoDB-style syntax. Defaults to 'created_at:-1' (newest first, descending). Use 'created_at:1' for oldest first (ascending). Format: field:direction where direction is 1 (ascending) or -1 (descending).

environment: typing.Optional[str] — Filter tenants by environment. For public cloud tenants, use the short name (e.g., 'US-3', 'EU-1'). For private cloud tenants, use the space name (e.g., 'acme-dev').

environment_tag: typing.Optional[EnvironmentTypeEnum] — Filter tenants by environment tag

locality: typing.Optional[str] — Filter tenants by locality. For public cloud tenants, matches locality (e.g., 'us', 'eu'). For private cloud tenants, matches the space's primary locality (e.g., 'virginia', 'frankfurt').

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tenants.create(...) -> CreateTenantsResponseContent

📝 Description

This endpoint creates a new tenant under your team. Upon successful creation, the response includes the tenant's details and management client credentials. The tenant type (public or private) is determined by the attributes in the request payload. Refer to the payload schema for required attributes.

🔌 Usage

from auth0.teams import Teams, PublicCloudPayload
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.tenants.create(
    request=PublicCloudPayload(
        admin_email="admin_email",
        locality="us",
    ),
)

⚙️ Parameters

request: CreateTenantsRequestContent

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tenants.get(...) -> GetTenantsResponseContent

📝 Description

This endpoint retrieves all metadata for a specific tenant, including the tenant's unique ID, name, domain, environment, locality, environment type, and creation date. It is useful for obtaining comprehensive information about a tenant for display in dashboards, auditing, or automated management tasks. The response includes all relevant fields required to identify and manage the tenant programmatically

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.tenants.get(
    tenant_id="tenantId",
)

⚙️ Parameters

tenant_id: TenantId — The unique ID of the tenant to retrieve (UUID format)

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tenants.delete(...)

📝 Description

Delete a tenant from the current team

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.tenants.delete(
    tenant_id="tenantId",
)

⚙️ Parameters

tenant_id: TenantId — The id of the tenant to delete

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Environments

client.environments.list() -> ListEnvironmentsResponseContent

📝 Description

This endpoint provide a list of environments associated with the Team where tenants exist.

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.environments.list()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Activity

client.activity.list(...) -> ListActivityResponseContent

📝 Description

This endpoint returns a paginated list of activity log entries for the team.

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment
import datetime

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.activity.list(
    take=1,
    from_="from",
    since=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"),
    until=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"),
    type="Team Member",
    status="Success",
)

⚙️ Parameters

take: typing.Optional[int] — Maximum number of items to return per page. Defaults to 50. Maximum 50

from: typing.Optional[str] — Checkpoint cursor for pagination; use the 'next' value from a previous response to fetch the next page

since: typing.Optional[DateTimeIso] — Return logs created at or after this ISO 8601 date format

until: typing.Optional[DateTimeIso] — Return logs created before this ISO 8601 timestamp

type: typing.Optional[ActivityLogEventTypeEnum] — Exact match: filter by event type

status: typing.Optional[ActivityLogStatusEnum] — Exact match: filter by status

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Members Tenants

client.members.tenants.create(...) -> typing.Optional[CreateMembersTenantsResponseContent]

📝 Description

This endpoint can be used to add new tenants access

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.members.tenants.create(
    id="id",
    tenants=[
        "538c9e21-e3d5-4ad6-b3d0-352c62369fb0",
        "b1c9e21e-1234-4ad6-b3d0-352c6236abcd"
    ],
    roles=[
        "owner",
        "editor-specific-apps"
    ],
    client_ids=[
        "client_123",
        "client_456"
    ],
)

⚙️ Parameters

id: str — The unique ID of the team member to update

tenants: typing.List[TenantId] — A list of tenant ids

roles: typing.List[TenantMemberRoleEnum] — List of roles to be assigned to the tenant member

client_ids: typing.Optional[typing.List[ClientId]] — List of applications. Only if nested role is editor-specific-app

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.members.tenants.remove(...) -> typing.Optional[DeleteMembersTenantsResponseContent]

📝 Description

This endpoint can be used to remove tenant access

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.members.tenants.remove(
    id="id",
    tenants=[
        "tenants"
    ],
)

⚙️ Parameters

id: str — The unique ID of the team member.

tenants: typing.List[TenantId] — Specifies list of tenant IDs to be removed

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.members.tenants.update(...) -> typing.Optional[UpdateMembersTenantsResponseContent]

📝 Description

This endpoint can be used to update existing tenant roles.

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.members.tenants.update(
    id="id",
    tenants=[
        "538c9e21-e3d5-4ad6-b3d0-352c62369fb0"
    ],
    roles=[
        "owner",
        "editor-specific-apps"
    ],
    client_ids=[
        "client_123",
        "client_456"
    ],
)

⚙️ Parameters

id: str — The unique ID of the team member to update

tenants: typing.List[TenantId] — A list of tenant ids

roles: typing.List[TenantMemberRoleEnum] — List of roles to be assigned to the tenant member

client_ids: typing.Optional[typing.List[ClientId]] — List of applications. Only if nested role is editor-specific-app

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.members.tenants.list(...) -> ListMembersTenantsResponseContent

📝 Description

This endpoint retrieves a list of all tenants within a specific environment that the team member has access to. Environment identifiers required for this request can be obtained using the /api/environments endpoint, which provides details for all environments where tenants associated with your team exists.

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.members.tenants.list(
    id="id",
    environment="environment",
)

⚙️ Parameters

id: str — Unique ID of the team member.

environment: str — The cloud environment identifier (e.g. 'US-3', 'EU-1', 'acme-dev').

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Tenants Members

client.tenants.members.list(...) -> ListTenantsMembersResponseContent

📝 Description

This endpoint retrieves a paginated list of all members for a specific tenant.

🔌 Usage

from auth0.teams import Teams
from auth0.teams.environment import TeamsEnvironment

client = Teams(
    token="<token>",
    environment=TeamsEnvironment.DEFAULT,
)

client.tenants.members.list(
    tenant_id="tenantId",
    take=1,
    from_="from",
)

⚙️ Parameters

tenant_id: TenantId — The unique ID of the tenant.

take: typing.Optional[int] — Maximum number of items to return per page. Defaults to 50. Maximum 50

from: typing.Optional[str] — Checkpoint cursor for pagination; use the 'next' value from a previous response to fetch the next page

request_options: typing.Optional[RequestOptions] — Request-specific configuration.