Organization

The team workspaces of the NoClick app you're in, as its workspace settings show them.

acme = noclick.Organization.create("Acme Ops")
noclick.Organization.invite(acme, "sam@example.com", role="admin")
for member in noclick.Organization.members(acme):
    print(member["email"], member["role"])

A team workspace's members are people, so every call is a signed-in person's own: a client holding a person's session token (never a key, which refuses them all). Not noclick.Workspace, which is one of Work's spaces. Members, invites and single sign-on come back as the API answers them (dicts).

class Organization

A team workspace you're in.

Attributes
idstr
namestr
slugstr
rolestr | None

Your role in it: owner, admin or member.

icon_urlstr | None
rawdict[str, Any]

The response JSON exactly as the API sent it.

liststaticasync

noclick.Organization.list(*, client=None) -> list[Organization]

The team workspaces you're in, each with your role.

Parameters
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
list[Organization]

Each team workspace you're in, as an Organization.

Usage
for workspace in noclick.Organization.list():
    print(workspace.name, workspace.role)

getstaticasync

noclick.Organization.get(organization, *, client=None) -> Organization

One you're in, by id.

Parameters
organizationAnyrequired
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Usage
print(noclick.Organization.get("8c1f…").name)

createstaticasync

noclick.Organization.create(name, *, slug=None, client=None) -> Organization

Make a team workspace with you as its owner (slug made from the name when left out); your session acts in it from then on. How many you may own is your plan's.

Parameters
namestrrequired
slugstr | Nonedefault None
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
Usage
acme = noclick.Organization.create("Acme Ops")

updatestaticasync

noclick.Organization.update(
    organization, *, name=None, settings=None, client=None
) -> dict[str, Any]

Rename it or change its settings (its owner or an admin).

Parameters
organizationAnyrequired
namestr | Nonedefault None
settingsdict[str, Any] | Nonedefault None
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
dict[str, Any]

The team workspace as it now stands.

Usage
noclick.Organization.update(acme, name="Acme Operations")

deletestaticasync

noclick.Organization.delete(organization, *, client=None) -> None

Delete it for good, its members and invites with it (its owner only).

Parameters
organizationAnyrequired
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Usage
noclick.Organization.delete(acme)

slug_availablestaticasync

noclick.Organization.slug_available(slug, *, client=None) -> bool

Whether a new team workspace could take slug.

Parameters
slugstrrequired
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
bool

True when no team workspace has it.

Usage
print(noclick.Organization.slug_available("acme-ops"))

membersstaticasync

noclick.Organization.members(organization, *, client=None) -> list[dict[str, Any]]

Its members, each with their user_id, email and role.

Parameters
organizationAnyrequired
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
list[dict[str, Any]]

Each member, with their user_id, email, full_name and role.

Usage
print([m["email"] for m in noclick.Organization.members(acme)])

invitestaticasync

noclick.Organization.invite(
    organization, email, *, role='member', client=None
) -> dict[str, Any]

Invite someone by email (its owner or an admin): they're emailed a link that joins them as role (admin or member). How many people it holds is its plan's.

Parameters
organizationAnyrequired
emailstrrequired
rolestrdefault 'member'
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
dict[str, Any]

The invite, with email_sent: False when its email couldn't go (email_error says why), and the invite stands all the same, so share its link yourself.

Usage
noclick.Organization.invite(acme, "sam@example.com", role="admin")

set_rolestaticasync

noclick.Organization.set_role(organization, user_id, role, *, client=None) -> None

Change a member's role (its owner or an admin; never the owner's).

Parameters
organizationAnyrequired
user_idstrrequired
rolestrrequired
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Usage
noclick.Organization.set_role(acme, "6a0b…", "admin")

remove_memberstaticasync

noclick.Organization.remove_member(organization, user_id, *, client=None) -> None

Take a member out (its owner or an admin; never the owner).

Parameters
organizationAnyrequired
user_idstrrequired
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Usage
noclick.Organization.remove_member(acme, "6a0b…")

transferstaticasync

noclick.Organization.transfer(organization, user_id, *, client=None) -> None

Hand it to another of its members (its owner only): they become its owner, you an admin.

Parameters
organizationAnyrequired
user_idstrrequired
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Usage
noclick.Organization.transfer(acme, "6a0b…")

invitesstaticasync

noclick.Organization.invites(organization, *, client=None) -> list[dict[str, Any]]

Its invites still waiting to be accepted.

Parameters
organizationAnyrequired
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
list[dict[str, Any]]

Each invite still waiting, with its email, role and when it expires.

Usage
print([i["email"] for i in noclick.Organization.invites(acme)])

revoke_invitestaticasync

noclick.Organization.revoke_invite(organization, invite_id, *, client=None) -> None

Call an invite off: its link stops working.

Parameters
organizationAnyrequired
invite_idstrrequired
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Usage
noclick.Organization.revoke_invite(acme, "c3d4…")

accept_invitestaticasync

noclick.Organization.accept_invite(token, *, client=None) -> dict[str, Any]

Join the team workspace an invite to your email asks you to.

Parameters
tokenstrrequired
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
dict[str, Any]

The organization_id and organization_name of the team workspace you joined.

Usage
noclick.Organization.accept_invite(token)

switch_tostaticasync

noclick.Organization.switch_to(organization, *, client=None) -> None

Make the workspace your session acts in a team one you're in, or your own (None).

Parameters
organizationAnyrequired
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Usage
noclick.Organization.switch_to(None)