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 OrganizationA team workspace you're in.
| id | string | |
| name | string | |
| slug | string | |
| role | string | null | Your role in it: |
| iconUrl | string | null | |
| raw | JsonObject | The response JSON exactly as the API sent it. |
type JsonObject = { [key: string]: unknown };liststatic
static list(options?: Options): Promise<Organization[]>The team workspaces you're in, each with your role.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
Each team workspace you're in, as an Organization.
getstatic
static get(organization: Ref, options?: Options): Promise<Organization>One you're in, by id.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
The Organization.
createstatic
static create(
name: string,
options?: Options & { slug?: string },
): Promise<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.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
The new Organization.
updatestatic
static update(
organization: Ref,
changes: { name?: string; settings?: JsonObject },
options?: Options,
): Promise<JsonObject>Rename it or change its settings (its owner or an admin).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
The team workspace as it now stands.
type JsonObject = { [key: string]: unknown };deletestatic
static delete(organization: Ref, options?: Options): Promise<void>Delete it for good, its members and invites with it (its owner only).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
slugAvailablestatic
static slugAvailable(slug: string, options?: Options): Promise<boolean>Whether a new team workspace could take slug.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
True when no team workspace has it.
membersstatic
static members(organization: Ref, options?: Options): Promise<JsonObject[]>Its members, each with their user_id, email and role.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
Each member, with their user_id, email, full_name and role.
type JsonObject = { [key: string]: unknown };invitestatic
static invite(
organization: Ref,
email: string,
options?: Options & { role?: "admin" | "member" },
): Promise<JsonObject>Invite someone by email (its owner or an admin): they're emailed a link that joins them as role. How many people
it holds is its plan's. Answers 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.
"member"The client to send with; defaults to the module client built from NOCLICK_API_KEY.
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.
type JsonObject = { [key: string]: unknown };setRolestatic
static setRole(
organization: Ref,
userId: string,
role: "admin" | "member",
options?: Options,
): Promise<void>Change a member's role (its owner or an admin; never the owner's).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
removeMemberstatic
static removeMember(
organization: Ref,
userId: string,
options?: Options,
): Promise<void>Take a member out (its owner or an admin; never the owner).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
transferstatic
static transfer(
organization: Ref,
userId: string,
options?: Options,
): Promise<void>Hand it to another of its members (its owner only): they become its owner, you an admin.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
invitesstatic
static invites(organization: Ref, options?: Options): Promise<JsonObject[]>Its invites still waiting to be accepted.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
Each invite still waiting, with its email, role and when it expires.
type JsonObject = { [key: string]: unknown };revokeInvitestatic
static revokeInvite(
organization: Ref,
inviteId: string,
options?: Options,
): Promise<void>Call an invite off: its link stops working.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
acceptInvitestatic
static acceptInvite(token: string, options?: Options): Promise<JsonObject>Join the team workspace an invite to your email asks you to.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
The organization_id and organization_name of the team workspace you joined.
type JsonObject = { [key: string]: unknown };switchTostatic
static switchTo(organization: Ref | null, options?: Options): Promise<void>Make the workspace your session acts in a team one you're in, or your own (null).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.