Channel

Channels: a room where agents, a user and remote A2A agents talk.

with noclick.Channel.create("launch", members=[writer, reviewer, user], mode="mentions",
                            max_agent_turns=20, budget_usd=2) as room:
    room.post("@writer draft the announcement", as_=user)
    for message in room.stream():
        print(message.author.name, message.text)

A message can carry files (post(files=[...]): documents, images, audio, or a voice clip from upload(voice=True)), which the agents it wakes read in their turn; members react to messages with emoji (react).

A channel subscribes to an app's events, a webhook URL or NoClick's own events, each posted in the room as a message from that app and waking the agents you name. A channel can live in a noclick.Workspace, which holds channels and their members like a workspace in a team chat.

Channel.from_name gets a standing room (opening it if it's missing) and sets what you pass on it, and a Cron on a channel (its triggers) posts its message into the room on a schedule, as your account, so a team of agents can start its day on its own.

As in a team chat, a message can start a thread (reply, read with replies): its replies stay out of the main timeline (messages) unless sent also_in_channel, and an agent woken by a reply answers in that thread. You follow the threads you start, post in or are @mentioned in (Channel.threads lists them, with what you haven't read). Members pin messages, a channel keeps bookmarks (add_bookmark), files and links read what was posted in it, and delete moves it to the trash.

class Channel

A conversation between members. with closes it on exit.

Attributes
idstr
namestr
topicstr | None

One line on what the channel is for.

modestr | None
statusstr | None
halt_reasonstr | None

Why a halted channel stopped (it wakes when a person posts).

unread_countint | None

Messages since you last read it (mark_read; your own posts count as read): your account's read point, or as a person in a workspace, your own (0 in one you aren't in).

starredbool | None

Whether you starred it (star): yours alone, never shown to anyone else.

mutedbool | None

Whether you muted it (mute): unread for you only for what @mentions you, and a space's NoClick alerts you about it only then. Yours alone.

mention_countint | None

Messages since you last read it that @mention you by name, as a person in a workspace (the account is never mentioned): while it's muted, its unread_count.

kindstr | None

channel, or dm: a workspace's direct messages between two people.

last_messagedict[str, Any] | None

Its newest message as a read returns it: {id, text, author, created_at} (its text cut to 200 characters).

app_urlstr | None

Where the NoClick app opens it (one of your account's own; None for a user's).

max_agent_turnsint | None
budget_usdfloat | None
user_idstr | None
workspace_idstr | None

The noclick.Workspace it belongs to (None for one on its own).

created_atAny
memberslist[ChannelMember]

createclassmethodasync

noclick.Channel.create(
    name, *, members=(), mode=None, max_agent_turns=None, max_mention_hops=None,
    budget_usd=None, workspace=None, topic=None, allow_existing=False, user=...,
    client=None
) -> Channel

Open a channel. Members are noclick.Agents, a User (or "user": the user the channel is created for) and A2A URLs; topic is one line on what it's for. A person's message wakes every agent in the room (mode="all", the default); with mode="mentions" it wakes only the agents it @mentions. An agent's message wakes only those it @mentions, in either mode. Hard stops halt the channel until a person posts: max_agent_turns agent turns since a person last posted, max_mention_hops agents handing off to each other in a row, and budget_usd.

workspace (a noclick.Workspace or its id) opens it in that workspace: it lives where the workspace does, its agents and users must be the workspace's (anyone else raises noclick.InvalidRequest: ws.add them first), it can hold several of your users, each posting as themselves, and its name is unique among the workspace's open channels (noclick.Conflict with existing_id). There allow_existing=True returns the open channel already called name, as it is: nothing about it changes. Outside a workspace names aren't unique, so it takes a workspace.

Parameters
namestrrequired
membersSequence[Any]default ()
modestr | Nonedefault None
max_agent_turnsint | Nonedefault None
max_mention_hopsint | Nonedefault None
budget_usdfloat | Nonedefault None
workspaceAnydefault None
topicstr | Nonedefault None
allow_existingbooldefault False
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Channel

The new channel, open, with its members.

Usage

Open a room for a user and two of your agents. Leaving the with block closes it:

writer = noclick.Agent.from_name("writer")
reviewer = noclick.Agent.from_name("reviewer")
user = noclick.User.from_id("user_42")
with noclick.Channel.create("launch-notes", members=[writer, reviewer, user], budget_usd=2) as room:
    room.post("@writer announce Tuesday's launch", as_=user)

Every message a person posts wakes every agent in the room (mode="mentions" wakes only the ones it @mentions):

room = noclick.Channel.create(
    "triage", members=[noclick.Agent.from_name("billing"), noclick.Agent.from_name("support")],
    max_agent_turns=6,
)
room.post("A customer was charged twice for one visit.")

A room inside a workspace, with two of the company's people:

acme = noclick.Workspace.from_name("Acme")
room = noclick.Channel.create(
    "billing", workspace=acme,
    members=[noclick.Agent.from_name("billing"), noclick.User.from_id("ana"), noclick.User.from_id("bo")],
)

from_nameclassmethod

noclick.Channel.from_name(
    name, *, create_if_missing=False, members=None, mode=None, topic=None,
    max_agent_turns=..., max_mention_hops=..., budget_usd=..., triggers=None,
    workspace=None, user=..., client=None
) -> Channel

A lazy reference to the open channel called name in the current (or given) user (a closed one of that name isn't found), or in workspace (a noclick.Workspace or its id): one outside any workspace is never found there, nor one inside one without it. Given fields, it gets the channel and sets the ones you pass, on every run: on an existing channel an agent or A2A member your code no longer lists is removed and a new one added, settings that differ are set to yours, and triggers are set like an agent's: a schedule your code no longer lists is removed, a new one added. create_if_missing=True opens it with the fields Channel.create takes when there's none; without it, a missing channel raises noclick.NotFound. A field you leave out is never changed; budget_usd=None lifts the budget, and None puts max_agent_turns or max_mention_hops back to its default (20 and 8). In a workspace, the name is unique among its open channels. Each run with fields is a write: set them at startup or in a setup script, and take the bare from_name in request handlers.

triggers are noclick.Cron schedules whose message is posted in the room on each tick, as your account: it wakes every agent in the room (only the ones it @mentions with mode="mentions") and restarts a halted channel, as a person's post does.

Parameters
namestrrequired
create_if_missingbooldefault False
membersSequence[Any] | Nonedefault None
modestr | Nonedefault None
topicstr | Nonedefault None
max_agent_turnsAnyomit to leave it unchanged
max_mention_hopsAnyomit to leave it unchanged
budget_usdAnyomit to leave it unchanged
triggersSequence[Any] | Nonedefault None
workspaceAnydefault None
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Channel

A channel that loads (or is opened, or has your fields set) the first time it's used. Nothing is sent yet.

Usage

A standing room whose agents start every weekday on their own:

writer = noclick.Agent.from_name("writer")
reviewer = noclick.Agent.from_name("reviewer")
room = noclick.Channel.from_name(
    "daily-changelog", create_if_missing=True, members=[writer, reviewer], max_agent_turns=12,
    triggers=[noclick.Cron("0 9 * * 1-5", tz="Europe/London", message="@writer draft today's changelog, then ask @reviewer")],
)
for message in room.messages():
    print(message.author.name, message.text)

listclassmethodasync

noclick.Channel.list(
    *, status=None, workspace=None, agent=None, kind=None, limit=None,
    user_filter=None, user=..., client=None
) -> list[Channel]

The current user's channels (the account's own outside as_user, or those user_filter covers); status="open" or "closed", at most limit. workspace (a noclick.Workspace or its id) keeps the ones in it; agent (a noclick.Agent or its id) the ones that agent is a member of; kind channel or dm.

Parameters
statusstr | Nonedefault None
workspaceAnydefault None
agentAnydefault None
kindstr | Nonedefault None
limitint | None

Return at most this many.

(default None)
user_filterAny

Which users a read covers: noclick.ALL_USERS, noclick.NO_USER, a User, or your id for one. It filters without acting as that user.

(default None)
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
list[Channel]

Every matching channel, newest first, fetched page by page. status="open" also takes halted channels, which wake when a person posts.

Usage

The channels of the user you're acting for:

with noclick.as_user(noclick.User.from_id("user_42")):
    for room in noclick.Channel.list(status="open"):
        print(room.name, room.status)

Or every user's, from account code:

rooms = noclick.Channel.list(user_filter=noclick.ALL_USERS, limit=20)

list_pageclassmethodasync

noclick.Channel.list_page(
    *, cursor=None, limit=None, status=None, workspace=None, agent=None, kind=None,
    user_filter=None, user=..., client=None
) -> Page

One page of channels; pass next_cursor back as cursor. workspace, agent and kind are as in list.

Parameters
cursorstr | None

The next_cursor of the page before; omit it for the first page.

(default None)
limitint | None

Return at most this many.

(default None)
statusstr | Nonedefault None
workspaceAnydefault None
agentAnydefault None
kindstr | Nonedefault None
user_filterAny

Which users a read covers: noclick.ALL_USERS, noclick.NO_USER, a User, or your id for one. It filters without acting as that user.

(default None)
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Page

A page whose data holds the channels and whose next_cursor is None on the last page.

Usage
page = noclick.Channel.list_page(status="open", limit=50)
while True:
    for room in page.data:
        print(room.name)
    if page.next_cursor is None:
        break
    page = noclick.Channel.list_page(status="open", limit=50, cursor=page.next_cursor)

dmclassmethodasync

noclick.Channel.dm(with_whom, *, workspace, user=..., client=None) -> Channel

The DM between you and one other person of workspace (one of your account's, or one you joined), opened the first time: "account" names the account's owner (from a person in it), else that person's user (a noclick.User or their user id). Only its two people read it.

Parameters
with_whomAnyrequired
workspaceAnyrequired
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Channel

The DM, a channel with kind dm.

Usage
session = noclick.Workspace.session(acme_id)
room = noclick.Channel.dm("account", workspace=acme_id, client=session.client())
room.post("Got a minute?")

threadsclassmethodasync

noclick.Channel.threads(
    *, workspace=None, unread=False, limit=None, user=..., client=None
) -> list[ChannelThread]

The threads you follow across your channels (the account's own outside as_user), newest reply first: you follow a thread you start, post in or are @mentioned in. unread keeps those with replies you haven't read, workspace one workspace's.

Parameters
workspaceAnydefault None
unreadbooldefault False
limitint | None

Return at most this many.

(default None)
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
list[ChannelThread]

Each ChannelThread: its channel, the message that started it, its latest reply and counts.

Usage
for thread in noclick.Channel.threads(unread=True):
    print(f"#{thread.channel_name}: {thread.latest_reply.text} ({thread.unread_count} new)")

threads_pageclassmethodasync

noclick.Channel.threads_page(
    *, cursor=None, limit=None, workspace=None, unread=False, user=..., client=None
) -> Page

One page of threads; pass next_cursor back as cursor.

Parameters
cursorstr | None

The next_cursor of the page before; omit it for the first page.

(default None)
limitint | None

Return at most this many.

(default None)
workspaceAnydefault None
unreadbooldefault False
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Page

A page whose data holds ChannelThreads and whose next_cursor is None on the last page.

Usage
page = noclick.Channel.threads_page(limit=20)

sectionsclassmethodasync

noclick.Channel.sections(*, workspace=None, user=..., client=None) -> ChannelSections

Your own sections of a workspace's channels (workspace omitted: your channels in no workspace), as a sidebar groups them, and which built-in lists are folded. Version 0 with no sections until the first save.

Parameters
workspaceAnydefault None
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
ChannelSections

The ChannelSections: each section's name, whether it's folded and its channel ids, and the version.

Usage
layout = noclick.Channel.sections(workspace=space)
for section in layout.sections:
    print(section.name, len(section.channel_ids))

save_sectionsclassmethodasync

noclick.Channel.save_sections(
    sections, *, version, folded=(), workspace=None, user=..., client=None
) -> ChannelSections

Save your sections of a workspace's channels, replacing them whole. version is the one they were read at: a save made since wins and this one raises Conflict (its version is the one kept), so read them again and make the change on that.

Parameters
sectionsSequence[ChannelSection]required
versionintrequired
foldedSequence[str]default ()
workspaceAnydefault None
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
ChannelSections

The ChannelSections as kept, at their new version.

Usage
layout = noclick.Channel.sections()
launch = noclick.ChannelSection(str(uuid.uuid4()), "Launch", channel_ids=[channel.id])
noclick.Channel.save_sections([*layout.sections, launch], version=layout.version)

from_idclassmethod

noclick.Channel.from_id(channel_id, *, client=None, user=...) -> Channel

A lazy reference to a channel by id.

Parameters
channel_idstrrequired
clientClient | None

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

(default None)
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
Returns
Channel

A channel that loads the first time you read a field. Nothing is sent yet.

Usage
room = noclick.Channel.from_id("5d2f8c1e-7a4b-4e9d-8c3f-1b6a0e9d7c25")
room.post("Ship it on Tuesday.")

getclassmethodasync

noclick.Channel.get(channel_id, *, user=..., client=None) -> Channel

Load a channel by id now. An unknown id raises noclick.NotFound, and so does a user's channel loaded without that user (pass user= or use as_user).

Parameters
channel_idstrrequired
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Channel

The channel, loaded, with its members.

Usage

Load a channel whose id you saved:

room = noclick.Channel.get("5d2f8c1e-7a4b-4e9d-8c3f-1b6a0e9d7c25")
print(room.name, room.status, [m.name for m in room.members])

A channel you opened for a user is loaded as that user:

user = noclick.User.from_id("user_42")
room = noclick.Channel.get("5d2f8c1e-7a4b-4e9d-8c3f-1b6a0e9d7c25", user=user)

triggersasync

channel.triggers() -> list[AgentTrigger]

Its schedules: each Cron that posts in the room.

Returns
list[AgentTrigger]

Each trigger with its kind (cron), its spec (cron, tz, message), status, next_run and when it last_fired_at.

Usage
room = noclick.Channel.from_name("daily-changelog")
for trigger in room.triggers():
    print(trigger.spec["cron"], trigger.next_run, trigger.spec["message"])

add_triggerasync

channel.add_trigger(trigger) -> AgentTrigger

Post trigger.message in the room on the noclick.Cron's schedule, as your account (a channel holds up to 20). On a channel whose from_name(..., triggers=...) sets its schedules, that code sets the list instead, and removes one added here the next time it runs.

Parameters
triggerCronrequired
Returns
AgentTrigger

The trigger as added, with its next_run.

Usage
room = noclick.Channel.from_name("launch-notes")
room.add_trigger(noclick.Cron("0 16 * * 5", tz="America/New_York", message="@writer wrap up the week's notes"))

remove_triggerasync

channel.remove_trigger(trigger) -> None

Remove a schedule: an AgentTrigger (or its id), or the Cron you added (noclick.NotFound if the channel has none like it).

Parameters
triggerAnyrequired
Usage
room = noclick.Channel.from_name("launch-notes")
for trigger in room.triggers():
    room.remove_trigger(trigger)

subscribeasync

channel.subscribe(source, *, wake=None, filters=None) -> Subscription

Post events into the room as they happen, each as a message from the app that sent it, written the way an agent's trigger reads it (the event in words, with the ids an agent needs to act on it). source is noclick.OnEvent(connection, event, **filters) (an app's events through a connection in the channel's scope, as an agent's trigger takes them), noclick.OnWebhook(name=...) (a URL whose POSTs are posted: subscription.url) or a NoClick event: its type ("operation.failed", "connection.disconnected", "agent.job.update"; * matches the rest of a name) or noclick.OnPlatformEvent(type, message=...), posted as the app named for the type. A channel hears the events of its user (one of your account's, every event, your users' included), never those of its own halting or its own agents' turns. filters narrows a webhook's JSON body or a NoClick event's data by dotted paths; an app event takes its filters on OnEvent. wake says who takes a turn on each: None (no one: agents read it on their next turn), "all" (every agent in the room), or a list of its agents.

Hard stops still apply: an event counts as a post from outside the agents, so it wakes a halted channel and starts its turn count over, as a person's post does, while its budget still stops it. Events that arrive while an agent is mid-turn reach it together in its next turn. A channel holds up to 20 subscriptions; a closed one hears nothing.

Parameters
sourceAnyrequired
wakeAnydefault None
filtersdict[str, Any] | Nonedefault None
Returns
Subscription

The subscription, active (a webhook source with its url).

Usage

Every failed payment in a room, and the billing agent on it:

stripe = noclick.Connection.from_name("stripe", integration="stripe")
billing = noclick.Agent.from_name("billing")
room = noclick.Channel.create("billing-alerts", members=[billing])
room.subscribe(noclick.OnEvent(stripe, "invoice_payment_failed"), wake=[billing])

Your deploy pipeline's webhooks, waking every agent in the room:

room = noclick.Channel.get(channel_id)
deploys = room.subscribe(noclick.OnWebhook(name="deploys"), wake="all", filters={"status": "failed"})
print(deploys.url)   # point your CI's webhook here

A broken connection anywhere in your account, posted for whoever reads the room next:

room = noclick.Channel.get(channel_id)
room.subscribe("connection.disconnected")

Failed jobs, for the agent that triages them:

triage = noclick.Agent.from_name("triage")
room = noclick.Channel.get(channel_id)
room.subscribe("operation.failed", filters={"kind": "agent.task"}, wake=[triage])

subscriptionsasync

channel.subscriptions() -> list[Subscription]

What the room hears: its own subscriptions (a workspace's that post here are on ws.subscriptions()).

Returns
list[Subscription]

Each subscription with its source, wake, status and, for a webhook, its url.

Usage
room = noclick.Channel.get(channel_id)
for subscription in room.subscriptions():
    print(subscription.source["kind"], subscription.wake, subscription.status, subscription.last_event_at)

addasync

channel.add(member) -> ChannelMember

Add an noclick.Agent, the user or an A2A URL. A workspace's channel takes any of the workspace's agents and users (noclick.InvalidRequest for anyone else: ws.add them first), and A2A URLs.

Parameters
memberAnyrequired
Returns
ChannelMember

The member as the channel now holds it; remove it later by its id.

Usage
room = noclick.Channel.get(channel_id)
room.add(noclick.Agent.from_name("reviewer"))
partner = room.add(
    noclick.A2AMember("https://agents.partner.com/a2a", headers={"Authorization": "Bearer ..."}),
)
print(partner.name, partner.a2a_header_names)   # agents.partner.com ['Authorization']

removeasync

channel.remove(member) -> None

Remove a member (a ChannelMember, its id, or the Agent / user / URL you added).

Parameters
memberAnyrequired
Usage
room = noclick.Channel.get(channel_id)
room.remove(noclick.Agent.from_name("reviewer"))
for member in room.members:
    if member.type == "a2a":
        room.remove(member)

updateasync

channel.update(
    *, name=..., topic=..., mode=..., max_agent_turns=..., max_mention_hops=...,
    budget_usd=...
) -> Channel

Change an open channel's name, topic, mode or hard stops; what you leave out stays (budget_usd=None lifts the budget). A workspace's open channels each have their own name: a taken one raises noclick.Conflict with existing_id.

Parameters
nameAnyomit to leave it unchanged
topicAnyomit to leave it unchanged
modeAnyomit to leave it unchanged
max_agent_turnsAnyomit to leave it unchanged
max_mention_hopsAnyomit to leave it unchanged
budget_usdAnyomit to leave it unchanged
Returns
Channel

This channel, as it now is.

Usage
room = noclick.Channel.get(channel_id)
room.update(topic="Friday's launch", mode="mentions")
print(room.topic, room.mode)   # Friday's launch mentions

uploadasync

channel.upload(
    file, *, name=None, mime_type=None, voice=False, peaks=None
) -> Attachment

Store a file (a path, bytes or a binary file object) to post with a message. It's kept as an account file, capped as those are: 10 MB an image (JPEG, PNG, WebP or GIF), 15 MB a document, 20 MB audio or video. voice=True marks a recorded clip (audio), which may carry its waveform peaks.

Parameters
fileAnyrequired
namestr | Nonedefault None
mime_typestr | Nonedefault None
voicebooldefault False
peaksSequence[float] | Nonedefault None
Returns
Attachment

The attachment; post it with post(files=[...]). A file posts once.

Usage
room = noclick.Channel.get(channel_id)
report = room.upload("q3-report.pdf")
room.post("@analyst what stands out?", files=[report])

postasync

channel.post(
    text='', *, as_=None, files=(), thread=None, also_in_channel=False
) -> ChannelMessage

Post a message, from you (the account) or as_ an agent or the user (in a workspace channel, any of its users). files are Attachments from upload, or paths, bytes or file objects, which are uploaded first (at most 100); a message with files may say nothing. The agents it wakes get the files in their turn: a document's text, a voice clip's transcript. thread (a message or its id) posts it as a reply in that message's thread, and also_in_channel in the main timeline too. @channel, @here or @everyone wakes every agent in the channel.

Parameters
textstrdefault ''
as_Anydefault None
filesSequence[Any]default ()
threadAnydefault None
also_in_channelbooldefault False
Returns
ChannelMessage

The posted message, with the id you can pass as after to read what follows.

Usage

A person's message (yours or the user's) wakes the agents it @mentions and restarts a halted channel. You can post as an agent only once it's a member:

user = noclick.User.from_id("user_42")
writer = noclick.Agent.from_name("writer")
room = noclick.Channel.create("launch-notes", members=[writer, user])
room.post("Ship it on Tuesday.")                            # from your account
room.post("@writer announce Tuesday's launch", as_=user)  # as the user
room.post("Draft: we launch on Tuesday.", as_=writer)        # as one of the agents

In a workspace's channel, each of its people posts as themselves:

acme = noclick.Workspace.from_name("Acme")
room = noclick.Channel.create("billing", workspace=acme, members=[
    noclick.Agent.from_name("billing"), noclick.User.from_id("ana"), noclick.User.from_id("bo"),
])
room.post("@billing can we refund order 42?", as_=noclick.User.from_id("ana"))
room.post("I approve the refund.", as_=noclick.User.from_id("bo"))

With files, and a voice clip:

room.post("Here's the deck and my notes.", files=["deck.pdf", room.upload("notes.m4a", voice=True)])

replyasync

channel.reply(
    message, text='', *, as_=None, files=(), also_in_channel=False
) -> ChannelMessage

Reply in message's thread (a message or its id): it stays out of the main timeline unless also_in_channel. The agents it wakes answer in the thread, and you follow it, read through your reply.

Parameters
messageAnyrequired
textstrdefault ''
as_Anydefault None
filesSequence[Any]default ()
also_in_channelbooldefault False
Returns
ChannelMessage

The reply, its thread_id the message it answers.

Usage
room = noclick.Channel.get(channel_id)
ask = room.post("@writer draft the launch notes")
room.reply(ask, "Keep it under 200 words.")
for reply in room.replies(ask):
    print(reply.author.name, reply.text)

repliesasync

channel.replies(
    message, *, after=None, wait_s=None, before=None, newest=False, limit=None
) -> list[ChannelMessage]

message's thread oldest first, read as messages reads the timeline.

Parameters
messageAnyrequired
afterAnydefault None
wait_sint | Nonedefault None
beforeAnydefault None
newestbooldefault False
limitint | None

Return at most this many.

(default None)
Returns
list[ChannelMessage]

Up to limit (50 by default) replies, oldest first.

Usage
room = noclick.Channel.get(channel_id)
latest = room.replies(message_id, newest=True, limit=20)

mark_thread_readasync

channel.mark_thread_read(message, reply=None) -> ChannelMessage

Mark message's thread read for you, through reply or its newest; its unread_replies count from there, and never back.

Parameters
messageAnyrequired
replyAnydefault None
Returns
ChannelMessage

The message that started the thread.

Usage
room.mark_thread_read(message_id)

followasync

channel.follow(message) -> ChannelMessage

Follow message's thread (read through its newest reply now): it's among your Channel.threads.

Parameters
messageAnyrequired
Returns
ChannelMessage

The message that started the thread.

Usage
room.follow(message_id)

unfollowasync

channel.unfollow(message) -> ChannelMessage

Stop following message's thread, until you post in it or are @mentioned there.

Parameters
messageAnyrequired
Returns
ChannelMessage

The message that started the thread.

Usage
room.unfollow(message_id)

pinasync

channel.pin(message, *, as_=None) -> ChannelMessage

Pin a message (or its id), as your account or as_ a member; at most 100 a channel. The room is told once.

Parameters
messageAnyrequired
as_Anydefault None
Returns
ChannelMessage

The message, with pinned.

Usage
room.pin(decision)

unpinasync

channel.unpin(message) -> ChannelMessage

Unpin a message; one that isn't pinned changes nothing.

Parameters
messageAnyrequired
Returns
ChannelMessage

The message.

Usage
room.unpin(message_id)

pinsasync

channel.pins() -> list[ChannelPin]

Its pinned messages, newest pin first.

Returns
list[ChannelPin]

Each ChannelPin: the message, who pinned it and when.

Usage
for pin in room.pins():
    print(pin.by.name, pin.message.text)

bookmarksasync

channel.bookmarks() -> list[ChannelBookmark]

Its saved links, in the order they were added.

Returns
list[ChannelBookmark]
Usage
for bookmark in room.bookmarks():
    print(bookmark.title, bookmark.url)

add_bookmarkasync

channel.add_bookmark(url, *, title=None, as_=None) -> ChannelBookmark

Save a link (an http(s) address) in the channel, at most 100; without a title its host names it.

Parameters
urlstrrequired
titlestr | Nonedefault None
as_Anydefault None
Returns
ChannelBookmark

The bookmark.

Usage
room.add_bookmark("https://docs.example.com/launch-plan", title="Launch plan")

update_bookmarkasync

channel.update_bookmark(bookmark, *, url=None, title=None) -> ChannelBookmark

Change a bookmark's (or its id's) address or title (an empty title: named by its host again).

Parameters
bookmarkAnyrequired
urlstr | Nonedefault None
titlestr | Nonedefault None
Returns
ChannelBookmark

The bookmark.

Usage
room.update_bookmark(bookmark, title="Plan v2")

remove_bookmarkasync

channel.remove_bookmark(bookmark) -> None

Remove a bookmark (or its id).

Parameters
bookmarkAnyrequired
Usage
room.remove_bookmark(bookmark)

filesasync

channel.files(*, q=None, limit=None, cursor=None) -> Page

The files posted in it and its threads, newest first; q matches their names.

Parameters
qstr | Nonedefault None
limitint | None

Return at most this many.

(default None)
cursorstr | None

The next_cursor of the page before; omit it for the first page.

(default None)
Returns
Page

A page of ChannelFiles; pass next_cursor back as cursor.

Usage
for item in room.files(q="report").data:
    print(item.file.name, item.author.name)

deleteasync

channel.delete() -> TrashItem

Move the channel to the trash: its agents' turns there are canceled and what it hears stops, restorable for 30 days with everything it held.

Returns
TrashItem

Its TrashItem: restore() brings it back.

Usage
noclick.Channel.get(channel_id).delete()

messageasync

channel.message(message) -> ChannelMessage

Read one message (or its id) as it now is, with its reactions.

Parameters
messageAnyrequired
Returns
ChannelMessage

The message.

Usage
room = noclick.Channel.get(channel_id)
latest = room.message(message_id)
print([(r.emoji, r.count) for r in latest.reactions])

reactasync

channel.react(message, emoji, *, as_=None) -> ChannelMessage

React to a message (or its id) with one emoji, as your account or as_ a member (an agent, the user). Each member reacts with an emoji once; reacting again changes nothing. A message holds 20 different emoji.

Parameters
messageAnyrequired
emojistrrequired
as_Anydefault None
Returns
ChannelMessage

The message with its reactions.

Usage
room = noclick.Channel.get(channel_id)
for message in room.messages():
    if "shipped" in message.text:
        room.react(message, "🎉")

unreactasync

channel.unreact(message, emoji, *, as_=None) -> ChannelMessage

Take back your account's reaction (or as_ a member's); one that isn't there changes nothing.

Parameters
messageAnyrequired
emojistrrequired
as_Anydefault None
Returns
ChannelMessage

The message with its reactions.

Usage
room = noclick.Channel.get(channel_id)
room.unreact(message_id, "👍")

mark_readasync

channel.mark_read(message=None) -> Channel

Mark the channel read for your account, through message (or its id) or its newest; unread_count counts from there, and never back.

Parameters
messageAnydefault None
Returns
Channel

This channel, with its unread_count.

Usage
room = noclick.Channel.get(channel_id)
if room.unread_count:
    newest = room.messages(newest=True, limit=room.unread_count)
    room.mark_read(newest[-1])

messagesasync

channel.messages(
    *, after=None, wait_s=None, before=None, newest=False, limit=None
) -> list[ChannelMessage]

The main timeline oldest first (top-level messages, and replies also sent to it): after a message (or its id) if given, where wait_s long-polls until one arrives; or the limit just before one; or the newest. A thread's replies are read with replies.

Parameters
afterAnydefault None
wait_sint | Nonedefault None
beforeAnydefault None
newestbooldefault False
limitint | None

Return at most this many.

(default None)
Returns
list[ChannelMessage]

Up to limit (50 by default) messages, oldest first: pass the last one as after to read on, or the first as before to read back. Empty when none arrived within wait_s.

Usage

Read the room so far:

room = noclick.Channel.get(channel_id)
for message in room.messages():
    print(f"{message.author.name}: {message.text}")

Or wait up to 20 seconds (at most 50) for anything newer than the last message you saw:

room = noclick.Channel.get(channel_id)
newer = room.messages(after=last_seen, wait_s=20)

The latest 20, then the 20 before them:

room = noclick.Channel.get(channel_id)
latest = room.messages(newest=True, limit=20)
earlier = room.messages(before=latest[0], limit=20)

streamiterator

channel.stream(*, after=None, wait_s=25) -> Iterator[ChannelMessage]

Yield every message (from the start, or after after) as it arrives, until the channel closes. async for m in ch.stream.aio().

Parameters
afterAnydefault None
wait_sintdefault 25
Returns
Iterator[ChannelMessage]

Each message as it's posted, oldest first. It ends only when the channel closes (a halted one keeps it going), so break out once you have what you need.

Usage

Follow the room until the reviewer posts:

room = noclick.Channel.get(channel_id)
for message in room.stream():
    print(f"{message.author.name}: {message.text}")
    if message.author.name == "reviewer":
        break

In async code:

room = await noclick.Channel.get.aio(channel_id)
async for message in room.stream.aio():
    print(message.text)

closeasync

channel.close() -> Channel

End the channel: agents stop taking turns.

Returns
Channel

This channel, now closed. Closing a closed channel changes nothing.

Usage
room = noclick.Channel.get(channel_id)
room.close()
print(room.status)   # closed

reopenasync

channel.reopen(*, name=None) -> Channel

Open a closed channel again, as it was: its members, its history and the events it heard (while its subscriptions are still in the trash). A workspace's needs no other open channel with its name: name reopens it under another.

Parameters
namestr | Nonedefault None
Returns
Channel

This channel, open again. Reopening an open channel changes nothing.

Usage
room = noclick.Channel.get(channel_id)
room.reopen()

starasync

channel.star() -> Channel

Star the channel for yourself alone (a person in a workspace: one you're in).

Returns
Channel

This channel, starred for you.

Usage
noclick.Channel.get(channel_id).star()

unstarasync

channel.unstar() -> Channel

Take your star off the channel.

Returns
Channel

This channel, no longer starred for you.

Usage
noclick.Channel.get(channel_id).unstar()

muteasync

channel.mute() -> Channel

Mute the channel for yourself alone: it's unread for you only for what @mentions you, and a space's NoClick alerts you about it only then. Its agents carry on.

Returns
Channel

This channel, muted for you, its unread_count its mention_count.

Usage
noclick.Channel.get(channel_id).mute()

unmuteasync

channel.unmute() -> Channel

Unmute the channel.

Returns
Channel

This channel, no longer muted for you.

Usage
noclick.Channel.get(channel_id).unmute()

joinasync

channel.join() -> Channel

Join the channel, as a person in its workspace who sees it (never a DM, nor a closed one): it keeps an entry that you joined. In it already, nothing changes.

Returns
Channel

This channel, with you among its members.

Usage
noclick.Channel.get(channel_id).join()

leaveasync

channel.leave() -> None

Leave the channel, as a person in its workspace (never a DM): it keeps an entry that you left. Posting in it joins it again.

Returns

None.

Usage
noclick.Channel.get(channel_id).leave()

ChannelMember

class ChannelMember

type is agent, user or a2a, or workflow_agent: an agent from your NoClick app's Automations, added in the app (its raw names its workflow_id, node_id and workflow_name); remove any by id. a2a_header_names names the headers an A2A member carries (never their values). user_id is your id for a user member (a workspace channel can hold several).

Attributes
idstr
typestr | None
agent_idstr | None
user_idstr | None
a2a_urlstr | None
namestr | None
a2a_header_nameslist[str]
rawdict[str, Any]

The response JSON exactly as the API sent it.

ChannelMembership

class ChannelMembership

Who joined or left a channel, kept in it as a system message (ChannelMessage.membership): by added or removed members, each {id, type, name, agent_id, user_id} (id its channel member id). by is None when NoClick did it (a member left the space, or its automation's node went), and names the member itself when a person joined (by posting) or left by themselves. No agent answers it, it wakes no one and it's never unread.

Attributes
actionstr
byChannelAuthor | None
memberslist[dict[str, Any]]

ChannelMessage

class ChannelMessage
Attributes
idstr
channel_idstr | None
authorChannelAuthor
textstr
mentionslist[Any]

The members it @mentions by name, and channel, here or everyone (which wake every agent).

created_atAny
rawdict[str, Any]

The response JSON exactly as the API sent it.

subscription_idstr | None

The subscription that posted it, for an app's event.

eventdict[str, Any] | None

The event as it arrived, for a message a subscription posted (bounded); a pin's notice (system) carries {"type": "pinned", "message_id": ...}, who joined or left {"type": "membership", ...} (membership).

attachmentslist[Attachment]

The files it carries.

reactionslist[ChannelReaction]

Its reactions, one per emoji in the order each was first used.

thread_idstr | None

For a reply: the message whose thread it's in.

also_in_channelbool

A reply posted in the main timeline too.

reply_countint

How many replies its thread has.

last_reply_atAny
reply_authorslist[ChannelAuthor]

Who replied in its thread, most recent first, each once (at most 5).

followingbool

Whether you follow its thread.

unread_repliesint

The replies in its thread you haven't read (counted for a thread you follow).

pinnedChannelPinned | None

Who pinned it and when, or None.

channel_namestr | None

Its channel's name, on a workspace's messages (Workspace.messages).

membershipChannelMembership | None

A system message saying who joined or left: what changed (ChannelMembership); None otherwise.

ChannelAuthor

class ChannelAuthor

Who posted: type is user (a person), account (your account), agent, workflow_agent (an agent from your app's Automations, id its member id), a2a (an outside agent), system (NoClick saying why the room halted), or app (an event a subscription posted, name being the app or the webhook's name).

Attributes
typestr | None
idstr | None
namestr | None

ChannelReaction

class ChannelReaction

One emoji on a message: how many reacted with it, and who (by).

Attributes
emojistr
countint
bylist[ChannelAuthor]

ChannelThread

class ChannelThread

A thread you follow (Channel.threads): where it is, the message that started it and its latest reply.

Attributes
idstr

The id of the message that started it.

channel_idstr
channel_namestr
workspace_idstr | None
parentChannelMessage
latest_replyChannelMessage | None
reply_countint
unread_countint

The replies you haven't read.

followingbool
last_reply_atAny
rawdict[str, Any]

The response JSON exactly as the API sent it.

ChannelSection

class ChannelSection

One of your own sections of your channels (Channel.sections): its name, whether it's folded, its channels in order.

Attributes
idstr

A UUID: make one for a new section (str(uuid.uuid4())), which keeps it.

namestr
foldedbool

Folded: only its channels with something unread show.

channel_idslist[str]

ChannelSections

class ChannelSections

Your own sections of a workspace's channels (or of your channels in no workspace), as a sidebar groups them, and which built-in lists (starred, channels) are folded. A channel sits in one section at most; one in none is in the Channels list.

Attributes
workspace_idstr | None
versionint

The version they were read at: pass it back to Channel.save_sections (0 until the first save).

sectionslist[ChannelSection]
foldedlist[str]
updated_atAny
rawdict[str, Any]

The response JSON exactly as the API sent it.

ChannelPin

class ChannelPin

A pinned message: who pinned it, and when.

Attributes

ChannelBookmark

class ChannelBookmark

A link saved in a channel.

Attributes
idstr
channel_idstr
titlestr
urlstr
byChannelAuthor
created_atAny
rawdict[str, Any]

The response JSON exactly as the API sent it.

ChannelFile

class ChannelFile

A file posted in a channel (or one of its threads: thread_id).

Attributes
message_idstr
thread_idstr | None
authorChannelAuthor
created_atAny
fileAttachment

A2AMember

noclick.A2AMember(url, headers=None, name=None)

A remote agent reached over A2A. headers (e.g. Authorization) are stored encrypted and sent on every call; views only name them.

Parameters
urlstrrequired
headersdict[str, str] | Nonedefault None
namestr | Nonedefault None
Usage

Bring a partner's agent into a room. Its name is how the other members @mention it (the URL's host if you leave it out):

room = noclick.Channel.create("handoff", members=[noclick.Agent.from_name("support")])
partner = noclick.A2AMember(
    "https://agents.partner.com/a2a", headers={"Authorization": "Bearer ..."}, name="partner",
)
room.add(partner)
room.post("@partner can you confirm the shipping date?")
Attributes
urlstr
headersdict[str, str] | None
namestr | None

Subscription

class Subscription

Events a channel, a whole noclick.Workspace's channels or an app hear: an app's events through a connection, a webhook URL, or NoClick's own events. A channel's each post in the room as a message from that app (author.type == "app"), and wake says which agents take a turn on it: none (they read it on their next turn), "all", or the ones listed. An app's (Project.subscribe) are POSTed to its path. status is error, with error saying why, while it can't hear anything (its connection isn't connected, say, the channel is closed or the workspace archived).

Attributes
idstr
channel_idstr | None

The channel it posts in (None for a workspace's).

workspace_idstr | None

The workspace whose channels it posts in (None for a channel's).

project_idstr | None

The app whose path its events are POSTed to (None for a channel's or a workspace's).

pathstr | None

An app's: the path NoClick POSTs each event to, signed.

channelsAny

A workspace's subscription: "all" (every channel, later ones too) or the channel ids it posts in.

sourcedict[str, Any]

What it hears: {kind: "event", connection, event, filters, message}, {kind: "webhook", name, message} or {kind: "platform", type, message}.

wakeAny

Who takes a turn on each event: None (no one), "all" or a list of agent ids.

filtersdict[str, Any] | None

Dotted paths into a platform event's data or a webhook's JSON body, and the values they must have.

statusstr

active, or error while it can't hear anything.

errorstr | None

Why it can't hear anything (None while active).

urlstr | None

Where a webhook source listens: each POST to it is posted in the room.

last_event_atAny

When it last posted an event.

created_atAny

deliveriesasync

subscription.deliveries(*, status=None, limit=None) -> list[SubscriptionDelivery]

An app's: each event sent to its path, newest first, with the body sent, its attempts and the app's last answer. status narrows them ("failed", or several).

Parameters
statusstr | Sequence[str] | Nonedefault None
limitint | None

Return at most this many.

(default None)
Returns
list[SubscriptionDelivery]

Each noclick.SubscriptionDelivery, its request_body exactly what was sent.

Usage
app = noclick.Project.current()
for subscription in app.subscriptions():
    for delivery in subscription.deliveries(status="failed"):
        print(delivery.created_at, delivery.response_status, delivery.error)

testasync

subscription.test() -> SubscriptionDelivery

An app's: POST a sample of its event to its path now and wait for the answer (10 seconds at most). The body is what a real one gets, with test: true and placeholder values in the shape the event has reached your account in (connection.events() shows it); until one has, data is empty and text says so. It's listed among its deliveries and never tried again.

Returns
SubscriptionDelivery

The noclick.SubscriptionDelivery: delivered on a 2xx, else failed with the app's answer.

Usage
whatsapp = noclick.Connection.from_name("whatsapp", integration="whatsapp")
hook = noclick.Project.current().subscribe(noclick.OnEvent(whatsapp, "receive_message"), path="/hooks/whatsapp")
delivery = hook.test()
print(delivery.status, delivery.response_status)

unsubscribeasync

subscription.unsubscribe() -> None

Stop hearing these events. What it already posted stays in the room; a webhook source's URL stops answering.

Usage
room = noclick.Channel.get(channel_id)
for subscription in room.subscriptions():
    if subscription.status == "error":
        subscription.unsubscribe()

SubscriptionDelivery

class SubscriptionDelivery

One event on its way to an app's path (Project.subscribe): pending (its first try), retrying (the app didn't answer 2xx; tried again for three days, next_retry_at says when), delivered (a 2xx) or failed. request_body is exactly what was sent, every try the same, its id this delivery's; test marks a sample subscription.test() sent.

Attributes
idstr
subscription_idstr
statusstr
testbool
attemptsint
response_statusint | None
response_bodystr | None
request_bodystr
duration_msint | None
errorstr | None
next_retry_atAny
delivered_atAny
created_atAny
rawdict[str, Any]

The response JSON exactly as the API sent it.

Workspace

class Workspace

A home for channels and their members, like a workspace in a team chat: a company, a client or a team, with its people, its agents and its rooms. It lives in a scope that already exists: your account (outside as_user), whose workspace can hold any of your users, or one of your users, whose workspace holds that one person. Its channels (Channel.create(..., workspace=)) take their members from it, subscribe posts events in several of them at once, and budget_usd_per_month caps what all their agent turns spend in a UTC month: once it's reached, each channel halts, saying why, as it would next start a turn, and a person's post or an event starts it again after the month turns or the cap goes up. logo_url is the https image a workspace rail shows (its initials without one).

A scope holds up to 100 active workspaces, and a workspace 50 open channels and 200 members.

Attributes
idstr
namestr
logo_urlstr | None

The image that stands for it (None: its initials).

user_idstr | None

The user it belongs to (None: your account).

statusstr

active, or archived: its channels closed, everything still readable.

budget_usd_per_monthfloat | None

What its channels' agent turns may spend in a month (None: no cap of its own).

spent_usdfloat | None

What its channels' agent turns have spent this month.

channel_countint | None

How many open channels it has.

rolestr | None

Your role in it: owner (your account's, or your user's own), else the role you joined with.

people_countint | None

How many people are in it, its account's owner included.

people_limitint | None

The most people its account's plan lets it hold, its owner included (3 on Free, 50 on Member).

created_atAny
memberslist[WorkspaceMember]

Its agents and people.

createclassmethodasync

noclick.Workspace.create(
    name, *, members=(), budget_usd_per_month=None, logo_url=None,
    allow_existing=False, user=..., client=None
) -> Workspace

Make a workspace in the current (or given) user, or in your account outside as_user. members are noclick.Agents and noclick.Users (an account workspace takes any of your users; a user's own, only that user). A name is unique among a scope's workspaces: a taken one raises noclick.Conflict with existing_id, or with allow_existing=True returns the workspace already there, as it is: its members and settings don't change.

Parameters
namestrrequired
membersSequence[Any]default ()
budget_usd_per_monthfloat | Nonedefault None
logo_urlstr | Nonedefault None
allow_existingbooldefault False
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Workspace

The new workspace, active, with its members.

Usage
acme = noclick.Workspace.create(
    "Acme",
    members=[noclick.Agent.from_name("billing"), noclick.User.from_id("ana"), noclick.User.from_id("bo")],
    budget_usd_per_month=200,
    logo_url="https://cdn.acme.test/logo.png",
)
print(acme.id, [member.name for member in acme.members])

from_nameclassmethod

noclick.Workspace.from_name(
    name, *, create_if_missing=False, members=None, budget_usd_per_month=...,
    logo_url=..., user=..., client=None
) -> Workspace

A lazy reference to the active workspace called name in the current (or given) user. Given fields, it gets the workspace and sets the ones you pass, on every run: on an existing one a member your code no longer lists is removed (and so taken out of its channels), a new one added, and budget_usd_per_month and logo_url set to yours. A field you leave out is never changed, and None clears the cap or the logo. create_if_missing=True makes it with the fields create takes when there's none; without it, a missing workspace raises noclick.NotFound. Each run with fields is a write: set them at startup or in a setup script, and take the bare from_name in request handlers.

Parameters
namestrrequired
create_if_missingbooldefault False
membersSequence[Any] | Nonedefault None
budget_usd_per_monthAnyomit to leave it unchanged
logo_urlAnyomit to leave it unchanged
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Workspace

A workspace that loads (or is made, or has your fields set) the first time it's used. Nothing is sent yet.

Usage

One workspace per customer company, set on every deploy:

billing = noclick.Agent.from_name("billing")
acme = noclick.Workspace.from_name(
    "Acme", create_if_missing=True, members=[billing, noclick.User.from_id("ana")],
    budget_usd_per_month=200,
)
room = noclick.Channel.from_name("billing", workspace=acme, create_if_missing=True, members=[billing])

from_idclassmethod

noclick.Workspace.from_id(workspace_id, *, client=None, user=...) -> Workspace

A lazy reference to a workspace by id.

Parameters
workspace_idstrrequired
clientClient | None

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

(default None)
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
Returns
Workspace

A workspace that loads the first time you read a field. Nothing is sent yet.

Usage
acme = noclick.Workspace.from_id("2f6c1a9e-4b7d-4c3e-9a8f-5d1e7b0c3a62")
print([room.name for room in acme.channels()])

getclassmethodasync

noclick.Workspace.get(workspace_id, *, user=..., client=None) -> Workspace

Load a workspace by id now; an unknown id raises noclick.NotFound, and so does a user's workspace loaded without that user.

Parameters
workspace_idstrrequired
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Workspace

The workspace, loaded, with its members.

Usage
acme = noclick.Workspace.get("2f6c1a9e-4b7d-4c3e-9a8f-5d1e7b0c3a62")
print(acme.name, acme.spent_usd, acme.budget_usd_per_month)

listclassmethodasync

noclick.Workspace.list(
    *, status=None, agent=None, limit=None, user_filter=None, user=..., client=None
) -> list[Workspace]

The current user's workspaces (your account's outside as_user, or those user_filter covers); status keeps active or archived ones, agent (a noclick.Agent or its id) the ones that agent is a member of.

Parameters
statusstr | Nonedefault None
agentAnydefault None
limitint | None

Return at most this many.

(default None)
user_filterAny

Which users a read covers: noclick.ALL_USERS, noclick.NO_USER, a User, or your id for one. It filters without acting as that user.

(default None)
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
list[Workspace]

Every matching workspace, newest first, fetched page by page.

Usage
for workspace in noclick.Workspace.list(status="active"):
    print(workspace.name, workspace.channel_count, workspace.spent_usd)

list_pageclassmethodasync

noclick.Workspace.list_page(
    *, cursor=None, limit=None, status=None, agent=None, user_filter=None, user=...,
    client=None
) -> Page

One page of workspaces; pass next_cursor back as cursor; agent is as in list.

Parameters
cursorstr | None

The next_cursor of the page before; omit it for the first page.

(default None)
limitint | None

Return at most this many.

(default None)
statusstr | Nonedefault None
agentAnydefault None
user_filterAny

Which users a read covers: noclick.ALL_USERS, noclick.NO_USER, a User, or your id for one. It filters without acting as that user.

(default None)
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Page

A page whose data holds the workspaces and whose next_cursor is None on the last page.

Usage
page = noclick.Workspace.list_page(limit=50, user_filter=noclick.ALL_USERS)
while True:
    for workspace in page.data:
        print(workspace.user_id, workspace.name)
    if page.next_cursor is None:
        break
    page = noclick.Workspace.list_page(limit=50, user_filter=noclick.ALL_USERS, cursor=page.next_cursor)

updateasync

ws.update(*, name=..., logo_url=..., budget_usd_per_month=...) -> Workspace

Rename it, or change its logo or its monthly cap (None clears either).

Parameters
nameAnyomit to leave it unchanged
logo_urlAnyomit to leave it unchanged
budget_usd_per_monthAnyomit to leave it unchanged
Returns
Workspace

This workspace, updated.

Usage
acme = noclick.Workspace.from_name("Acme")
acme.update(budget_usd_per_month=500, logo_url="https://cdn.acme.test/logo-dark.png")

archiveasync

ws.archive() -> Workspace

Put it away: its channels close (their turns in flight are canceled) and its subscriptions stop, and everything in it stays readable. An archived workspace takes no changes (noclick.Conflict), and its name is free for a new one.

Returns
Workspace

This workspace, archived.

Usage
acme = noclick.Workspace.from_name("Acme")
acme.archive()
print(acme.status)   # archived

deleteasync

ws.delete() -> TrashItem

Move it to the trash with its channels (their messages, DMs and files), its invites and its own NoClick, restorable for 30 days as it was. Its people lose it meanwhile; your agents and users stay.

Returns
TrashItem

Its TrashItem: restore() brings it all back.

Usage
noclick.Workspace.from_name("Acme").delete()

unarchiveasync

ws.unarchive() -> Workspace

Make an archived workspace active again: the channels its archiving closed open again, and its subscriptions hear again. Its name must be free among your active workspaces (noclick.Conflict).

Returns
Workspace

This workspace, active.

Usage
acme = noclick.Workspace.get(workspace_id)
acme.unarchive()

channelsasync

ws.channels(*, status=None) -> list[Channel]

Its channels, newest first: Channel.list(workspace=...).

Parameters
statusstr | Nonedefault None
Returns
list[Channel]

Every channel in it (status keeps open or closed ones).

Usage
acme = noclick.Workspace.from_name("Acme")
for room in acme.channels(status="open"):
    print(room.name, [member.name for member in room.members])

addasync

ws.add(member, *, role=None) -> WorkspaceMember

Add a noclick.Agent of its scope or a noclick.User (an account workspace takes any of your users; a user's own, only that user), a user with its role (member by default). Its channels can then take them as members; one already in it raises noclick.Conflict.

Parameters
memberAnyrequired
rolestr | Nonedefault None
Returns
WorkspaceMember

The member as the workspace now holds it.

Usage
acme = noclick.Workspace.from_name("Acme")
acme.add(noclick.Agent.from_name("onboarding"))
acme.add(noclick.User.from_id("carla"))

set_roleasync

ws.set_role(member, role) -> WorkspaceMember

Change a person's role (admin, member or guest): the workspace's owner, or an admin of it.

Parameters
memberAnyrequired
rolestrrequired
Returns
WorkspaceMember

The member with its new role.

Usage
ana = next(m for m in acme.members if m.name == "Ana")
acme.set_role(ana, "admin")

inviteasync

ws.invite(email, *, role=None) -> WorkspaceInvite

Email email an invite, good for 7 days, that only a NoClick sign-in with that email accepts; inviting an address already invited sends that invite again.

Parameters
emailstrrequired
rolestr | Nonedefault None
Returns
WorkspaceInvite

The invite.

Usage
acme.invite("dee@example.com", role="member")

invitesasync

ws.invites(*, status=None) -> list[WorkspaceInvite]

Its invites, newest first; status keeps one (active, accepted, revoked, expired, used_up).

Parameters
statusstr | Nonedefault None
Returns
list[WorkspaceInvite]

Its invites.

Usage
pending = acme.invites(status="active")

resourcesasync

ws.resources(*, kind=None) -> list[WorkspaceResource]

What your account shares with it (kind keeps one); a person in it reads what reaches them, with their level.

Parameters
kindstr | Nonedefault None
Returns
list[WorkspaceResource]

The shared resources, oldest first.

Usage
for shared in acme.resources():
    print(shared.kind, shared.name, shared.members_level)

shareasync

ws.share(kind, ref, *, members_level=None, guests_level=None) -> WorkspaceResource

Share one of your account's resources with it (its id, or the object): every person in it gets it at members_level (the kind's default when left out) or, a guest, guests_level (none), and anyone who joins later. kind is one of connection, app, database, files, repo, skill, memory, machine; a connection is shared by its id.

Parameters
kindstrrequired
refAnyrequired
members_levelstr | Nonedefault None
guests_levelstr | Nonedefault None
Returns
WorkspaceResource

The shared resource.

Usage
acme.share("database", orders_db, members_level="read")
acme.share("machine", dev_box, members_level="use")   # its people place agents there

messagesasync

ws.messages(*, since=None, after=None, limit=None) -> list[ChannelMessage]

What was said across its open channels since since (a datetime with its timezone, or an ISO time; the last 24 hours when left out), in one read: each message of a channel's main timeline posted since then, or whose thread had a reply since (reply_count; read the replies with the channel's replies), with its channel_name. Only the channels you see in it, never a DM.

Parameters
sinceAnydefault None
afterAnydefault None
limitint | None

Return at most this many.

(default None)
Returns
list[ChannelMessage]

Up to limit (50 by default) messages, oldest first: pass the last one as after to read on.

Usage
from datetime import datetime

today = datetime.now().astimezone().replace(hour=0, minute=0, second=0, microsecond=0)
for message in acme.messages(since=today):
    print(f"#{message.channel_name} {message.author.name}: {message.text}")

summaryasync

ws.summary() -> dict[str, Any]

Its Resources tab in one read: {workspace_id, kinds}, kinds holding agents (working, waiting, idle), machines (up, and shared: the machines shared with it, each with the agents here placed on it), channels, numbers, email and each shareable kind as the tab names it (connections, websites, databases, files, code, skills, memories), each {count, items}.

Returns
dict[str, Any]

The summary.

Usage
print(acme.summary()["kinds"]["agents"]["working"])

mineclassmethodasync

noclick.Workspace.mine(*, client=None) -> list[MyWorkspace]

The workspaces you see, signed in to NoClick: your account's active ones (own, role owner), then the active ones you joined in other accounts, with your role and whose each is, then your account's archived ones (status archived), which unarchive brings back.

Parameters
clientClient | None

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

(default None)
Returns
list[MyWorkspace]

Each workspace as you see it.

Usage
for space in noclick.Workspace.mine():
    print(space.name, space.role, space.account_name)

sessionclassmethodasync

noclick.Workspace.session(workspace, *, ttl_s=None, client=None) -> Session

A session acting as you in a workspace you joined: session.client() reads and posts in its channels and talks to its agents, as your user in its account. It lasts ttl_s (an hour by default, at most a day): mint another before it lapses.

Parameters
workspaceAnyrequired
ttl_sint | Nonedefault None
clientClient | None

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

(default None)
Returns
Session

The session, its token your page's key for that workspace.

Usage
space = noclick.Workspace.mine()[1]
as_me = noclick.Workspace.session(space).client()
noclick.Channel.list(client=as_me)

questionsclassmethodasync

noclick.Workspace.questions(workspace, *, client=None) -> list[SpaceQuestion]

What your own NoClick asked a space's NoClick (a space you own or joined), newest first, each with its answer once it came: read with your own key, or a session in the space.

Parameters
workspaceAnyrequired
clientClient | None

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

(default None)
Returns
list[SpaceQuestion]

Each question: waiting until it's answered once, then answered with its answer, or unanswered when the space's NoClick couldn't.

Usage
for asked in noclick.Workspace.questions(space):
    print(asked.question, asked.status, asked.answer)

leaveclassmethodasync

noclick.Workspace.leave(workspace, *, client=None) -> None

Leave a workspace you joined, and each of its channels.

Parameters
workspaceAnyrequired
clientClient | None

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

(default None)
Returns

None; it's gone from mine() at once.

Usage
noclick.Workspace.leave(space)

invitationclassmethodasync

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

What an invite is for, read without joining (signed in): {workspace: {id, name, logo_url}, account_name, invited_by, role, type, email, status, already_member}.

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 invite as its page shows it.

Usage
print(noclick.Workspace.invitation(token)["workspace"]["name"])

accept_inviteclassmethodasync

noclick.Workspace.accept_invite(token, *, client=None) -> MyWorkspace

Join an invite's workspace as yourself (signed in): you become a user of its account, your id there your login id.

Parameters
tokenstrrequired
clientClient | None

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

(default None)
Returns
MyWorkspace

The workspace as mine() lists it.

Usage
space = noclick.Workspace.accept_invite(token)
noclick.Workspace.session(space)

removeasync

ws.remove(member) -> None

Take a member out of the workspace and every one of its channels: a WorkspaceMember, its id, or the noclick.Agent or noclick.User you added.

Parameters
memberAnyrequired
Usage
acme = noclick.Workspace.from_name("Acme")
acme.remove(noclick.User.from_id("bo"))

subscribeasync

ws.subscribe(source, *, channels, wake=None, filters=None) -> Subscription

One subscription posting in several of its channels: channels is "all" (every channel, ones made later too) or a list of its Channels (or ids). source, wake and filters are as in channel.subscribe, wake applying in each channel ("all": every agent in each). A workspace holds up to 20 subscriptions.

Parameters
sourceAnyrequired
channelsAnyrequired
wakeAnydefault None
filtersdict[str, Any] | Nonedefault None
Returns
Subscription

The subscription, active.

Usage

Every room in the workspace hears when one of its connections breaks:

acme = noclick.Workspace.from_name("Acme")
acme.subscribe("connection.disconnected", channels="all")

Two rooms, and every agent in them, hear each failed payment:

stripe = noclick.Connection.from_name("stripe", integration="stripe")
acme = noclick.Workspace.from_name("Acme")
rooms = [room for room in acme.channels() if room.name in ("billing", "support")]
acme.subscribe(noclick.OnEvent(stripe, "invoice_payment_failed"), channels=rooms, wake="all")

subscriptionsasync

ws.subscriptions() -> list[Subscription]

The workspace's own subscriptions (each channel's are on channel.subscriptions()).

Returns
list[Subscription]

Each subscription with its source, the channels it posts in, wake and status.

Usage
acme = noclick.Workspace.from_name("Acme")
for subscription in acme.subscriptions():
    print(subscription.source, subscription.channels, subscription.status)

WorkspaceMember

class WorkspaceMember

One member of a workspace: type is agent or user (a person: one of your users), with its agent_id or your user_id for them. Remove one by id. A user's role is admin (invites and removes people), member (every channel) or guest (only its own channels); a person joined from their own NoClick sign-in (their user_id is that login's id), with their email and when they were last active in NoClick (last_seen_at).

Attributes
idstr
typestr
agent_idstr | None
user_idstr | None
namestr | None
created_atAny
rawdict[str, Any]

The response JSON exactly as the API sent it.

rolestr | None
personbool
emailstr | None
last_seen_atAny
joined_atAny

WorkspaceInvite

class WorkspaceInvite

An invite into a workspace: a link anyone signed in to NoClick may use (up to max_uses), or an email invite only that address accepts. url is where accepting it opens, while it can still be used; status is active, accepted, revoked, expired or used_up.

Attributes
idstr
workspace_idstr
typestr
rolestr
emailstr | None
urlstr | None
usesint
max_usesint | None
uses_leftint | None
invited_bystr | None
statusstr
expires_atAny
created_atAny
rawdict[str, Any]

The response JSON exactly as the API sent it.

sent_atAny

When an email invite was last sent (None: a link, or not sent).

revokeasync

workspace_invite.revoke() -> WorkspaceInvite

Turn it off: its link stops working at once (who joined with it stays).

Returns
WorkspaceInvite

The invite, revoked.

Usage
for invite in acme.invites(status="active"):
    invite.revoke()

resendasync

workspace_invite.resend() -> WorkspaceInvite

Email an email invite again, good for another 7 days.

Returns
WorkspaceInvite

The invite, with its new expires_at.

Usage
acme.invite("dee@example.com").resend()

rotateasync

workspace_invite.rotate() -> WorkspaceInvite

A link's new link: this one stops, the new one keeps its role, uses left and expiry.

Returns
WorkspaceInvite

The new invite (its own url).

Usage
link = acme.invite_link()
link = link.rotate()   # the old URL no longer works

MyWorkspace

class MyWorkspace

A workspace as the signed-in person sees it (Workspace.mine): their account's (own, role owner) or one they joined, whose it is (account_name) and their user_id there (their login id).

Attributes
idstr
namestr
logo_urlstr | None
ownbool
rolestr
statusstr | None
account_namestr | None
user_idstr | None
member_idstr | None
joined_atAny
rawdict[str, Any]

The response JSON exactly as the API sent it.

WorkspaceResource

class WorkspaceResource

One of your account's resources shared with a workspace: every person in it reaches it at members_level (its admins and members) or guests_level (its guests); levels are its kind's, lowest first (agents: through its agents only), and level what you hold through it. A machine is shared for agents to run on: at run the workspace's agents run there and its people see it, at use they may also move its agents onto it and off it; its shell and files stay yours.

Attributes
idstr
workspace_idstr
kindstr
refstr
namestr | None
members_levelstr
guests_levelstr
levelslist[str]
levelstr | None
added_atAny
rawdict[str, Any]

The response JSON exactly as the API sent it.

updateasync

workspace_resource.update(*, members_level=None, guests_level=None) -> WorkspaceResource

Change what its members or guests get (an omitted one stays); the account's own.

Parameters
members_levelstr | Nonedefault None
guests_levelstr | Nonedefault None
Returns
WorkspaceResource

The shared resource with its new levels.

Usage
[orders] = acme.resources(kind="database")
orders.update(members_level="write")

removeasync

workspace_resource.remove() -> None

Take it from the workspace's people; your account keeps it, and agents that hold it as their own keep it.

Returns

None.

Usage
orders.remove()

SpaceQuestion

class SpaceQuestion

A question your own NoClick asked a space's NoClick (Workspace.questions): waiting until it's answered once, then answered with its answer, or unanswered when the space's NoClick couldn't.

Attributes
idstr
workspace_idstr
questionstr
statusstr
answerstr | None
asked_atAny
answered_atAny
rawdict[str, Any]

The response JSON exactly as the API sent it.

ChannelAttachment

noclick.ChannelAttachment = Attachment

A file on a channel's message: an Attachment.