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 ChannelA conversation between members. with closes it on exit.
- Like every live object, it also has hydrate(), refresh() and raw.
- Works as a context manager:
withorasync with.
| id | str | |
| name | str | |
| topic | str | None | One line on what the channel is for. |
| mode | str | None | |
| status | str | None | |
| halt_reason | str | None | Why a halted channel stopped (it wakes when a person posts). |
| unread_count | int | None | Messages since you last read it ( |
| starred | bool | None | Whether you starred it ( |
| muted | bool | None | Whether you muted it ( |
| mention_count | int | 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 |
| kind | str | None |
|
| last_message | dict[str, Any] | None | Its newest message as a read returns it: |
| app_url | str | None | Where the NoClick app opens it (one of your account's own; |
| max_agent_turns | int | None | |
| budget_usd | float | None | |
| user_id | str | None | |
| workspace_id | str | None | The |
| created_at | Any | |
| members | list[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
) -> ChannelOpen 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.
()NoneNoneNoneNoneNoneNoneFalseWho the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The new channel, open, with its members.
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
) -> ChannelA 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.
FalseNoneNoneNoneNoneNoneWho the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)A channel that loads (or is opened, or has your fields set) the first time it's used. Nothing is sent yet.
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.
NoneNoneNoneNoneReturn at most this many.
None)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.
None)Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)Every matching channel, newest first, fetched page by page.
status="open" also takes halted channels, which wake when a person posts.
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
) -> PageOne page of channels; pass next_cursor back as cursor. workspace,
agent and kind are as in list.
The next_cursor of the page before; omit it for the first page.
None)Return at most this many.
None)NoneNoneNoneNoneWhich users a read covers: noclick.ALL_USERS, noclick.NO_USER, a User, or your id for one. It filters without acting as that user.
None)Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)A page whose data holds the channels and whose next_cursor is None on the last page.
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) -> ChannelThe 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.
Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The DM, a channel with kind dm.
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.
NoneFalseReturn at most this many.
None)Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)Each ChannelThread: its channel, the message that started it, its latest reply and counts.
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
) -> PageOne page of threads; pass next_cursor back as cursor.
The next_cursor of the page before; omit it for the first page.
None)Return at most this many.
None)NoneFalseWho the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)A page whose data holds ChannelThreads and whose next_cursor is None on the last page.
page = noclick.Channel.threads_page(limit=20)sectionsclassmethodasync
noclick.Channel.sections(*, workspace=None, user=..., client=None) -> ChannelSectionsYour 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.
NoneWho the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The ChannelSections: each section's name, whether it's folded and its channel ids, and the version.
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
) -> ChannelSectionsSave 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.
()NoneWho the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The ChannelSections as kept, at their new version.
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=...) -> ChannelA lazy reference to a channel by id.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
A channel that loads the first time you read a field. Nothing is sent yet.
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) -> ChannelLoad 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).
Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The channel, loaded, with its members.
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.
Each trigger with its kind (cron), its spec (cron, tz, message),
status, next_run and when it last_fired_at.
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) -> AgentTriggerPost 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.
The trigger as added, with its next_run.
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) -> NoneRemove a schedule: an AgentTrigger (or its id), or the Cron you added
(noclick.NotFound if the channel has none like it).
room = noclick.Channel.from_name("launch-notes")
for trigger in room.triggers():
room.remove_trigger(trigger)subscribeasync
channel.subscribe(source, *, wake=None, filters=None) -> SubscriptionPost 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.
NoneNoneThe subscription, active (a webhook source with its url).
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 hereA 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()).
Each subscription with its source, wake, status and, for a webhook, its url.
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) -> ChannelMemberAdd 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.
The member as the channel now holds it; remove it later by its id.
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) -> NoneRemove a member (a ChannelMember, its id, or the Agent / user / URL you added).
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=...
) -> ChannelChange 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.
This channel, as it now is.
room = noclick.Channel.get(channel_id)
room.update(topic="Friday's launch", mode="mentions")
print(room.topic, room.mode) # Friday's launch mentionsuploadasync
channel.upload(
file, *, name=None, mime_type=None, voice=False, peaks=None
) -> AttachmentStore 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.
NoneNoneFalseNoneThe attachment; post it with post(files=[...]). A file posts once.
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
) -> ChannelMessagePost 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.
''None()NoneFalseThe posted message, with the id you can pass as after to read what follows.
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 agentsIn 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
) -> ChannelMessageReply 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.
''None()FalseThe reply, its thread_id the message it answers.
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.
NoneNoneNoneFalseReturn at most this many.
None)Up to limit (50 by default) replies, oldest first.
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) -> ChannelMessageMark message's thread read for you, through reply or its newest; its unread_replies count
from there, and never back.
NoneThe message that started the thread.
room.mark_thread_read(message_id)followasync
channel.follow(message) -> ChannelMessageFollow message's thread (read through its newest reply now): it's among your Channel.threads.
The message that started the thread.
room.follow(message_id)unfollowasync
channel.unfollow(message) -> ChannelMessageStop following message's thread, until you post in it or are @mentioned there.
The message that started the thread.
room.unfollow(message_id)pinasync
channel.pin(message, *, as_=None) -> ChannelMessagePin a message (or its id), as your account or as_ a member; at most 100 a channel. The room is told
once.
NoneThe message, with pinned.
room.pin(decision)unpinasync
channel.unpin(message) -> ChannelMessageUnpin a message; one that isn't pinned changes nothing.
The message.
room.unpin(message_id)pinsasync
channel.pins() -> list[ChannelPin]Its pinned messages, newest pin first.
Each ChannelPin: the message, who pinned it and when.
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.
Each ChannelBookmark.
for bookmark in room.bookmarks():
print(bookmark.title, bookmark.url)add_bookmarkasync
channel.add_bookmark(url, *, title=None, as_=None) -> ChannelBookmarkSave a link (an http(s) address) in the channel, at most 100; without a title its host names it.
NoneNoneThe bookmark.
room.add_bookmark("https://docs.example.com/launch-plan", title="Launch plan")update_bookmarkasync
channel.update_bookmark(bookmark, *, url=None, title=None) -> ChannelBookmarkChange a bookmark's (or its id's) address or title (an empty title: named by its host again).
NoneNoneThe bookmark.
room.update_bookmark(bookmark, title="Plan v2")remove_bookmarkasync
channel.remove_bookmark(bookmark) -> NoneRemove a bookmark (or its id).
room.remove_bookmark(bookmark)filesasync
channel.files(*, q=None, limit=None, cursor=None) -> PageThe files posted in it and its threads, newest first; q matches their names.
NoneReturn at most this many.
None)The next_cursor of the page before; omit it for the first page.
None)A page of ChannelFiles; pass next_cursor back as cursor.
for item in room.files(q="report").data:
print(item.file.name, item.author.name)linksasync
channel.links(*, q=None, limit=None, cursor=None) -> PageThe web addresses posted in it and its threads, newest first (a markdown link with its text); q
matches the address or its text.
NoneReturn at most this many.
None)The next_cursor of the page before; omit it for the first page.
None)A page of ChannelLinks; pass next_cursor back as cursor.
for link in room.links().data:
print(link.domain, link.url)deleteasync
channel.delete() -> TrashItemMove the channel to the trash: its agents' turns there are canceled and what it hears stops, restorable for 30 days with everything it held.
noclick.Channel.get(channel_id).delete()messageasync
channel.message(message) -> ChannelMessageRead one message (or its id) as it now is, with its reactions.
The message.
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) -> ChannelMessageReact 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.
NoneThe message with its reactions.
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) -> ChannelMessageTake back your account's reaction (or as_ a member's); one that
isn't there changes nothing.
NoneThe message with its reactions.
room = noclick.Channel.get(channel_id)
room.unreact(message_id, "👍")mark_readasync
channel.mark_read(message=None) -> ChannelMark the channel read for your account, through message (or its
id) or its newest; unread_count counts from there, and never back.
NoneThis channel, with its unread_count.
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.
NoneNoneNoneFalseReturn at most this many.
None)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.
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().
None25Each 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.
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":
breakIn async code:
room = await noclick.Channel.get.aio(channel_id)
async for message in room.stream.aio():
print(message.text)closeasync
channel.close() -> ChannelEnd the channel: agents stop taking turns.
This channel, now closed. Closing a closed channel changes nothing.
room = noclick.Channel.get(channel_id)
room.close()
print(room.status) # closedreopenasync
channel.reopen(*, name=None) -> ChannelOpen 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.
NoneThis channel, open again. Reopening an open channel changes nothing.
room = noclick.Channel.get(channel_id)
room.reopen()starasync
channel.star() -> ChannelStar the channel for yourself alone (a person in a workspace: one you're in).
This channel, starred for you.
noclick.Channel.get(channel_id).star()unstarasync
channel.unstar() -> ChannelTake your star off the channel.
This channel, no longer starred for you.
noclick.Channel.get(channel_id).unstar()muteasync
channel.mute() -> ChannelMute 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.
This channel, muted for you, its unread_count its mention_count.
noclick.Channel.get(channel_id).mute()unmuteasync
channel.unmute() -> ChannelUnmute the channel.
This channel, no longer muted for you.
noclick.Channel.get(channel_id).unmute()joinasync
channel.join() -> ChannelJoin 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.
This channel, with you among its members.
noclick.Channel.get(channel_id).join()leaveasync
channel.leave() -> NoneLeave the channel, as a person in its workspace (never a DM): it keeps an entry that you left. Posting in it joins it again.
None.
noclick.Channel.get(channel_id).leave()ChannelMember
class ChannelMembertype 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).
| id | str | |
| type | str | None | |
| agent_id | str | None | |
| user_id | str | None | |
| a2a_url | str | None | |
| name | str | None | |
| a2a_header_names | list[str] | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
ChannelMembership
class ChannelMembershipWho 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.
| action | str | |
| by | ChannelAuthor | None | |
| members | list[dict[str, Any]] |
ChannelMessage
class ChannelMessage| id | str | |
| channel_id | str | None | |
| author | ChannelAuthor | |
| text | str | |
| mentions | list[Any] | The members it @mentions by name, and |
| created_at | Any | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
| subscription_id | str | None | The subscription that posted it, for an app's event. |
| event | dict[str, Any] | None | The event as it arrived, for a message a subscription posted (bounded); a pin's notice ( |
| attachments | list[Attachment] | The files it carries. |
| reactions | list[ChannelReaction] | Its reactions, one per emoji in the order each was first used. |
| thread_id | str | None | For a reply: the message whose thread it's in. |
| also_in_channel | bool | A reply posted in the main timeline too. |
| reply_count | int | How many replies its thread has. |
| last_reply_at | Any | |
| reply_authors | list[ChannelAuthor] | Who replied in its thread, most recent first, each once (at most 5). |
| following | bool | Whether you follow its thread. |
| unread_replies | int | The replies in its thread you haven't read (counted for a thread you follow). |
| pinned | ChannelPinned | None | Who pinned it and when, or |
| channel_name | str | None | Its channel's name, on a workspace's messages ( |
| membership | ChannelMembership | None | A |
ChannelAuthor
class ChannelAuthorWho 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).
| type | str | None | |
| id | str | None | |
| name | str | None |
ChannelReaction
class ChannelReactionOne emoji on a message: how many reacted with it, and who (by).
| emoji | str | |
| count | int | |
| by | list[ChannelAuthor] |
ChannelThread
class ChannelThreadA thread you follow (Channel.threads): where it is, the message that started it and its latest reply.
| id | str | The id of the message that started it. |
| channel_id | str | |
| channel_name | str | |
| workspace_id | str | None | |
| parent | ChannelMessage | |
| latest_reply | ChannelMessage | None | |
| reply_count | int | |
| unread_count | int | The replies you haven't read. |
| following | bool | |
| last_reply_at | Any | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
ChannelSection
class ChannelSectionOne of your own sections of your channels (Channel.sections): its name, whether it's folded, its channels
in order.
| id | str | A UUID: make one for a new section ( |
| name | str | |
| folded | bool | Folded: only its channels with something unread show. |
| channel_ids | list[str] |
ChannelSections
class ChannelSectionsYour 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.
| workspace_id | str | None | |
| version | int | The version they were read at: pass it back to |
| sections | list[ChannelSection] | |
| folded | list[str] | |
| updated_at | Any | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
ChannelPin
class ChannelPinA pinned message: who pinned it, and when.
| message | ChannelMessage | |
| by | ChannelAuthor | |
| at | Any |
ChannelBookmark
class ChannelBookmarkA link saved in a channel.
| id | str | |
| channel_id | str | |
| title | str | |
| url | str | |
| by | ChannelAuthor | |
| created_at | Any | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
ChannelFile
class ChannelFileA file posted in a channel (or one of its threads: thread_id).
| message_id | str | |
| thread_id | str | None | |
| author | ChannelAuthor | |
| created_at | Any | |
| file | Attachment |
ChannelLink
class ChannelLinkA web address posted in a channel (or one of its threads); title is a markdown link's text.
| message_id | str | |
| thread_id | str | None | |
| author | ChannelAuthor | |
| created_at | Any | |
| url | str | |
| title | str | None | |
| domain | str |
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.
NoneNoneBring 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?")| url | str | |
| headers | dict[str, str] | None | |
| name | str | None |
Subscription
class SubscriptionEvents 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).
- Like every live object, it also has hydrate(), refresh() and raw.
| id | str | |
| channel_id | str | None | The channel it posts in ( |
| workspace_id | str | None | The workspace whose channels it posts in ( |
| project_id | str | None | The app whose path its events are POSTed to ( |
| path | str | None | An app's: the path NoClick POSTs each event to, signed. |
| channels | Any | A workspace's subscription: |
| source | dict[str, Any] | What it hears: |
| wake | Any | Who takes a turn on each event: |
| filters | dict[str, Any] | None | Dotted paths into a platform event's |
| status | str |
|
| error | str | None | Why it can't hear anything ( |
| url | str | None | Where a webhook source listens: each POST to it is posted in the room. |
| last_event_at | Any | When it last posted an event. |
| created_at | Any |
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).
NoneReturn at most this many.
None)Each noclick.SubscriptionDelivery, its request_body exactly what was sent.
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() -> SubscriptionDeliveryAn 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.
The noclick.SubscriptionDelivery: delivered on a 2xx, else failed with the app's answer.
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() -> NoneStop hearing these events. What it already posted stays in the room; a webhook source's URL stops answering.
room = noclick.Channel.get(channel_id)
for subscription in room.subscriptions():
if subscription.status == "error":
subscription.unsubscribe()SubscriptionDelivery
class SubscriptionDeliveryOne 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.
| id | str | |
| subscription_id | str | |
| status | str | |
| test | bool | |
| attempts | int | |
| response_status | int | None | |
| response_body | str | None | |
| request_body | str | |
| duration_ms | int | None | |
| error | str | None | |
| next_retry_at | Any | |
| delivered_at | Any | |
| created_at | Any | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
Workspace
class WorkspaceA 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.
- Like every live object, it also has hydrate(), refresh() and raw.
| id | str | |
| name | str | |
| logo_url | str | None | The image that stands for it ( |
| user_id | str | None | The user it belongs to ( |
| status | str |
|
| budget_usd_per_month | float | None | What its channels' agent turns may spend in a month ( |
| spent_usd | float | None | What its channels' agent turns have spent this month. |
| channel_count | int | None | How many open channels it has. |
| role | str | None | Your role in it: |
| people_count | int | None | How many people are in it, its account's owner included. |
| people_limit | int | None | The most people its account's plan lets it hold, its owner included (3 on Free, 50 on Member). |
| created_at | Any | |
| members | list[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
) -> WorkspaceMake 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.
()NoneNoneFalseWho the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The new workspace, active, with its members.
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
) -> WorkspaceA 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.
FalseNoneWho the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)A workspace that loads (or is made, or has your fields set) the first time it's used. Nothing is sent yet.
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=...) -> WorkspaceA lazy reference to a workspace by id.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
A workspace that loads the first time you read a field. Nothing is sent yet.
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) -> WorkspaceLoad a workspace by id now; an unknown id raises noclick.NotFound, and so
does a user's workspace loaded without that user.
Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The workspace, loaded, with its members.
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.
NoneNoneReturn at most this many.
None)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.
None)Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)Every matching workspace, newest first, fetched page by page.
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
) -> PageOne page of workspaces; pass next_cursor back as cursor; agent is as in list.
The next_cursor of the page before; omit it for the first page.
None)Return at most this many.
None)NoneNoneWhich users a read covers: noclick.ALL_USERS, noclick.NO_USER, a User, or your id for one. It filters without acting as that user.
None)Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)A page whose data holds the workspaces and whose next_cursor is None on the last page.
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=...) -> WorkspaceRename it, or change its logo or its monthly cap (None clears either).
This workspace, updated.
acme = noclick.Workspace.from_name("Acme")
acme.update(budget_usd_per_month=500, logo_url="https://cdn.acme.test/logo-dark.png")set_logoasync
ws.set_logo(image, *, mime_type=None) -> WorkspaceUpload its logo (a path, bytes or a binary file object): a JPEG, PNG,
WebP or GIF of at most 2 MB, kept as an account file that logo_url
then points at. Bytes or a file object without a name need mime_type.
NoneThis workspace, with its new logo_url.
acme = noclick.Workspace.from_name("Acme")
acme.set_logo("acme-logo.png")
print(acme.logo_url)archiveasync
ws.archive() -> WorkspacePut 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.
This workspace, archived.
acme = noclick.Workspace.from_name("Acme")
acme.archive()
print(acme.status) # archiveddeleteasync
ws.delete() -> TrashItemMove 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.
noclick.Workspace.from_name("Acme").delete()unarchiveasync
ws.unarchive() -> WorkspaceMake 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).
This workspace, active.
acme = noclick.Workspace.get(workspace_id)
acme.unarchive()channelsasync
ws.channels(*, status=None) -> list[Channel]Its channels, newest first: Channel.list(workspace=...).
NoneEvery channel in it (status keeps open or closed ones).
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) -> WorkspaceMemberAdd 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.
NoneThe member as the workspace now holds it.
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) -> WorkspaceMemberChange a person's role (admin, member or guest): the workspace's owner,
or an admin of it.
The member with its new role.
ana = next(m for m in acme.members if m.name == "Ana")
acme.set_role(ana, "admin")invite_linkasync
ws.invite_link(*, role=None, expires_in_days=None, max_uses=None) -> WorkspaceInviteA link anyone signed in to NoClick may use to join (its url), as role
(member by default), at most max_uses times, for expires_in_days (30 by
default, at most 90). People who join become users of your account, and what they do
in the workspace bills it. Its owner or an admin; 50 invites a day.
NoneNoneNoneThe invite, with its url to share.
link = acme.invite_link(role="guest", max_uses=5)
print(link.url)inviteasync
ws.invite(email, *, role=None) -> WorkspaceInviteEmail 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.
NoneThe invite.
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).
NoneIts invites.
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.
NoneThe shared resources, oldest first.
for shared in acme.resources():
print(shared.kind, shared.name, shared.members_level)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.
NoneNoneReturn at most this many.
None)Up to limit (50 by default) messages, oldest first: pass the last one as
after to read on.
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}.
The summary.
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.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)Each workspace as you see it.
for space in noclick.Workspace.mine():
print(space.name, space.role, space.account_name)sessionclassmethodasync
noclick.Workspace.session(workspace, *, ttl_s=None, client=None) -> SessionA 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.
NoneThe client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The session, its token your page's key for that workspace.
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.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)Each question: waiting until it's answered once, then answered with its
answer, or unanswered when the space's NoClick couldn't.
for asked in noclick.Workspace.questions(space):
print(asked.question, asked.status, asked.answer)leaveclassmethodasync
noclick.Workspace.leave(workspace, *, client=None) -> NoneLeave a workspace you joined, and each of its channels.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)None; it's gone from mine() at once.
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}.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The invite as its page shows it.
print(noclick.Workspace.invitation(token)["workspace"]["name"])accept_inviteclassmethodasync
noclick.Workspace.accept_invite(token, *, client=None) -> MyWorkspaceJoin an invite's workspace as yourself (signed in): you become a user of its account, your id there your login id.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The workspace as mine() lists it.
space = noclick.Workspace.accept_invite(token)
noclick.Workspace.session(space)removeasync
ws.remove(member) -> NoneTake 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.
acme = noclick.Workspace.from_name("Acme")
acme.remove(noclick.User.from_id("bo"))subscribeasync
ws.subscribe(source, *, channels, wake=None, filters=None) -> SubscriptionOne 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.
NoneNoneThe subscription, active.
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()).
Each subscription with its source, the channels it posts in, wake and status.
acme = noclick.Workspace.from_name("Acme")
for subscription in acme.subscriptions():
print(subscription.source, subscription.channels, subscription.status)WorkspaceMember
class WorkspaceMemberOne 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).
| id | str | |
| type | str | |
| agent_id | str | None | |
| user_id | str | None | |
| name | str | None | |
| created_at | Any | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
| role | str | None | |
| person | bool | |
| str | None | ||
| last_seen_at | Any | |
| joined_at | Any |
WorkspaceInvite
class WorkspaceInviteAn 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.
| id | str | |
| workspace_id | str | |
| type | str | |
| role | str | |
| str | None | ||
| url | str | None | |
| uses | int | |
| max_uses | int | None | |
| uses_left | int | None | |
| invited_by | str | None | |
| status | str | |
| expires_at | Any | |
| created_at | Any | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
| sent_at | Any | When an email invite was last sent ( |
revokeasync
workspace_invite.revoke() -> WorkspaceInviteTurn it off: its link stops working at once (who joined with it stays).
The invite, revoked.
for invite in acme.invites(status="active"):
invite.revoke()resendasync
workspace_invite.resend() -> WorkspaceInviteEmail an email invite again, good for another 7 days.
The invite, with its new expires_at.
acme.invite("dee@example.com").resend()rotateasync
workspace_invite.rotate() -> WorkspaceInviteA link's new link: this one stops, the new one keeps its role, uses left and expiry.
The new invite (its own url).
link = acme.invite_link()
link = link.rotate() # the old URL no longer worksMyWorkspace
class MyWorkspaceA 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).
| id | str | |
| name | str | |
| logo_url | str | None | |
| own | bool | |
| role | str | |
| status | str | None | |
| account_name | str | None | |
| user_id | str | None | |
| member_id | str | None | |
| joined_at | Any | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
WorkspaceResource
class WorkspaceResourceOne 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.
| id | str | |
| workspace_id | str | |
| kind | str | |
| ref | str | |
| name | str | None | |
| members_level | str | |
| guests_level | str | |
| levels | list[str] | |
| level | str | None | |
| added_at | Any | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
updateasync
workspace_resource.update(*, members_level=None, guests_level=None) -> WorkspaceResourceChange what its members or guests get (an omitted one stays); the account's own.
NoneNoneThe shared resource with its new levels.
[orders] = acme.resources(kind="database")
orders.update(members_level="write")removeasync
workspace_resource.remove() -> NoneTake it from the workspace's people; your account keeps it, and agents that hold it as their own keep it.
None.
orders.remove()SpaceQuestion
class SpaceQuestionA 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.
| id | str | |
| workspace_id | str | |
| question | str | |
| status | str | |
| answer | str | None | |
| asked_at | Any | |
| answered_at | Any | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
ChannelAttachment
noclick.ChannelAttachment = AttachmentA file on a channel's message: an Attachment.