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
idstring
namestring
slugstring
rolestring | null

Your role in it: owner, admin or member.

iconUrlstring | null
rawJsonObject

The response JSON exactly as the API sent it.

Types
type JsonObject = { [key: string]: unknown };

liststatic

static list(options?: Options): Promise<Organization[]>

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

Parameters
options.clientNoClick

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

Returns

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

getstatic

static get(organization: Ref, options?: Options): Promise<Organization>

One you're in, by id.

Parameters
organizationRefrequired
options.clientNoClick

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

Returns

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.

Parameters
namestringrequired
options.slugstring
options.clientNoClick

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

Returns

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).

Parameters
organizationRefrequired
changes{ name?: string; settings?: JsonObject }required
options.clientNoClick

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

Returns

The team workspace as it now stands.

Types
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).

Parameters
organizationRefrequired
options.clientNoClick

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.

Parameters
slugstringrequired
options.clientNoClick

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

Returns

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.

Parameters
organizationRefrequired
options.clientNoClick

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

Returns

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

Types
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.

Parameters
organizationRefrequired
emailstringrequired
options.role"admin" | "member"default "member"
options.clientNoClick

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

Returns

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.

Types
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).

Parameters
organizationRefrequired
userIdstringrequired
role"admin" | "member"required
options.clientNoClick

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).

Parameters
organizationRefrequired
userIdstringrequired
options.clientNoClick

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.

Parameters
organizationRefrequired
userIdstringrequired
options.clientNoClick

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.

Parameters
organizationRefrequired
options.clientNoClick

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

Returns

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

Types
type JsonObject = { [key: string]: unknown };

revokeInvitestatic

static revokeInvite(
  organization: Ref,
  inviteId: string,
  options?: Options,
): Promise<void>

Call an invite off: its link stops working.

Parameters
organizationRefrequired
inviteIdstringrequired
options.clientNoClick

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.

Parameters
tokenstringrequired
options.clientNoClick

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

Returns

The organization_id and organization_name of the team workspace you joined.

Types
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).

Parameters
organizationRef | nullrequired
options.clientNoClick

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