Register an organization and its accounts
Everything happens in the app, under Settings › Organizations and bots (on Mac, You › Organizations and bots). On the web it's pchy.app/settings/organizations-and-bots. There's no separate developer console.
An organization speaks through its accounts: @runclubsf, @splits, @runclub_rides. Any account but its first can run as a bot, and "bot" is the everyday word for an account code runs. A person can run bots of their own too.
Who can create bots#
Anyone can make a development bot. You don't need an organization or verification. A development bot is unlisted: only you and up to 10 testers you name can find it, message it or add it to a chat. To everyone else its handle answers like one that doesn't exist. Each person can have 3, and an organization's development bots count against the admin who made them, not among its accounts.
Publishing a bot, so anyone can find and use it, is open at launch to admins of verified organizations, and we're inviting more developers as we go. An organization's published bot is one of its accounts, and an organization holds 3 accounts, its first included, more on request (see Accounts). A person can run 3 published bots, and more on request.
Start with a development bot. When it's ready, publish it, or make a separate published bot and keep the development one for testing.
Create a bot#
Tap New bot. Create stays off until every required field is filled and you check I agree to the Developer Terms; Peachy keeps which version you agreed to, and when. Who can use it is You and testers (a development bot) or Anyone (published). If you can't publish bots yet, it reads You and testers and can't be changed.
| Field | What it is |
|---|---|
| Owner | You, or an organization you're an admin of. The owner is who people see runs the bot: "Messages to @yourbot go to Owner." An organization's bot is one of its accounts. |
| Name and handle | What people see and type. People, bots and organizations' accounts share one handle space. A name that looks like another verified organization's is refused. |
| Tagline, About, logo | Your bot's page. A bot is drawn with its logo (a bot glyph until you add one), its name and @handle; an organization's bot also with the organization's badge, and the Verified badge once Peachy reviews its handle and name (Verification). |
| Commands | Each with its blanks (<question>, [what to focus on]), and whether it works in the bot's DM. A bot on @peachysocial/bot sends the commands it registers in code each time it starts and whenever they change while it runs, and those are its listing's commands. Phones pick up a change within an hour; a typed command reaches the bot at once. At most 50, each description at most 140 characters and its blanks 60. |
| Where messages go, How long it keeps them, Privacy policy link | Your privacy labels, drawn as your words everywhere. See Privacy labels. |
| What it can do | Post on its own, React, Join calls, each optional or Required. Each one starts on when someone adds the bot, and they can turn an optional one off (Post on its own isn't offered where only admins post). Join calls covers joining calls, starting one in answer to someone, and sending audio and video there. |
| Who can use it | You and testers, or Anyone: published, so it shows up in search. A development bot is never listed. To narrow a published bot to certain people, do it in code (the template's PEACHY_BOT_ALLOW, with account ids); the listing has no list of its own. |
| I agree to the Developer Terms | Required, unchecked to start. You agree for every bot you create, including an account you run as a bot. |
Development bots#
A development bot works like any other bot, with three differences:
- Who can use it. You, and up to 10 testers. Add them by handle on the bot's page under Who can use it. The form says "In development: only you and up to 10 testers who accept can use it." Anyone else who types its handle finds nothing, and their phone never gets its keys.
- It's never listed. It doesn't show in search or in Featured.
- No verification. It still has the new-bot limits below.
The privacy labels still matter: your testers see them before their first message, as everyone will.
To publish it, an admin of a verified organization taps Publish… on its page. An organization's bot then becomes one of its accounts, so it needs a free place among its 3.
Connect#
On the bot's page, tap Connect for a one-time code, and give it to the SDK: with npx @peachysocial/bot connect on your computer, or on a server as the secret PEACHY_CONNECT_CODE for the bot's first start (remove it after). The page shows the code, "One-time code" with how long it lasts, then "Connected" once the bot links. A code that runs out says "Code expired", with New code. Each account an organization runs as a bot has its own Connect and its own store: link @splits and @runclub_rides separately, even when one process runs both.
A bot has exactly one device. To link it from a new server, or with a new, empty store, reset its keys first (Link a new server, under its page's server status, which gives a new code), and Peachy says what that does before you go ahead: "Resets @yourbot's keys. It leaves the chats it's in. An admin in each can add it back. You'll get a code to connect the new server."
To sign the bot's server out without a reset (a token you think leaked), tap Unlink its server: its token stops working at once, its keys stay, and you get a new code. Connect the same store with it (npx @peachysocial/bot connect asks for it) and the bot is back in every chat, with nothing to re-add. If its token was revoked another way, Connect on its page gives the code. A Connect code redeemed for a bot that is still linked signs its running store out, and the new store is refused. A store that holds a bot refuses another bot's code without using it. To move a bot without a reset, move its store and its store key together (npx @peachysocial/bot store copy).
Once linked, the bot's page shows its status ("Connected", and when it was last seen), its report count, and Edit listing, Pause, Transfer ownership, and Delete bot.
Where your bot runs#
A bot is a long-running process. It holds a connection to Peachy, keeps its encrypted store on disk or in Postgres, and needs no public URL and no webhook. These work:
- a Fly.io machine with a volume (the template's
fly.toml); - a Render background worker with Postgres (the template's
render.yaml); - a Railway service, a VM, a container on any host, or your own computer while you develop.
Platforms that run code per request, or freeze it between requests, don't: serverless functions (AWS Lambda and its kind), edge workers, and container services that scale to zero. Run exactly one copy per bot: the store takes a lease, and a second process waits for it rather than running beside it, for up to leaseWaitMs (a minute), then stops with StoreLockedError. So a deploy that starts the new instance before it stops the old one works, as long as the old one stops within the minute (the template stops on SIGTERM). One process may run several bots, such as an organization's accounts, each on its own store; two Bots in one process on one store, or on two stores linked to one bot, fail at start() with StoreLockedError at once. Peachy holds the line too: a copy of the store running elsewhere (copied with cp, or a cloned volume) is refused while the first copy runs, and stops with RunningElsewhereError. "Runs" means it is still sending: a running bot reaches Peachy at least every 20 seconds, even when idle, so a copy that froze (a stopped process, a suspended VM) or whose host died without closing its connection frees the bot 45 seconds after its last request, and stops with RunningElsewhereError if it wakes. To move a bot, use npx @peachysocial/bot store copy and stop the old copy first. A running bot that stops on its own (another copy took over, its keys were reset) tells its error handlers with fatal: true: exit non-zero there, as the template does, so your host restarts it or tells you.
A bot can also serve HTTP, to take webhooks from other services: see Deploy.
Keep the store, back up the key#
The store holds the bot's keys and where it is in every chat. Two rules:
- Never restore a store from a backup. A store that goes back in time holds keys the chats have moved past. The SDK notices (the server says it has already delivered more than the store has seen) and refuses to start rather than answer from stale state. The way out is a reset, below. Move a store only with
npx @peachysocial/bot store copywhile the bot is stopped. - Back up the store key, in your host's secrets and somewhere you can find it again. Without the key the store can't be opened. A lost key, or a lost store, means resetting the bot's keys.
Link a new server, on the bot's page, starts the bot over with a new device. Every chat it was in sees it leave, with a line telling members they can add it back.
Organizations#
An organization is a name, a logo and a kind: company, creator, club, venue, team or school, with one Owner and any number of Admins. It has no phone and no inbox; it speaks through its accounts, and what its people do as an account reads "Run Club Rides · Dev".
- Owner: everything, including admins, verification, transferring ownership and deleting the organization. There is exactly one, and the owner can't leave without handing it to someone else.
- Admin: post and host events as its accounts, run its communities, and add its accounts and set up its bots.
- Adding an admin sends them an invite saying what the role exposes. They accept or decline.
- Post as and Host events as are set account by account, and can also go to certain people, one job each, without making them admins. Only the owner chooses them. An admin who leaves loses every grant that named them, and each change goes in the organization's log.
A company's community takes only the bots its admins approve. The organization's own bots are approved in each of its communities that exist then, when an admin makes one or moves it in; in a community made later, or if that didn't land, an admin approves it under Bot approval › Approve a bot, as any other bot.
Accounts an admin makes stay with the organization when that admin leaves. The links that admin made don't: each bot they linked stops with UnlinkedError, and another admin links it again with a new Connect code and an empty store.
Each person can create up to 3 organizations. There are no personal organizations: a bot you own yourself stays yours, named as yours.
Accounts#
An organization holds up to 3 accounts, its first included; Peachy raises that on request. The console shows the count ("2 of 3 accounts").
- Its first account is made with the organization. Its handle, name and logo are the organization's, and its page is the organization's page.
- Add an account gives it another handle, name and face. An account beyond the first needs a verified organization, or an admin on Peachy's publishers list.
- Any account but the first can run as a bot. Run as a bot, in an account's detail, waits for I agree to the Developer Terms, as Create does, then gives it a listing and a Connect code; from then on it is a bot for good, with every rule on this page. An account no code runs has no device: nobody can message it or add it to a chat. In private chats an organization's account is always code; no person answers as one.
- Each account is reviewed on its own. A new account goes live without the Verified badge and reads "Waiting for review" in the console until Peachy reviews its handle and name. A new handle or name takes the badge off at once and sends it back to review; a new face doesn't.
- Each account has its own followers, and its own Post as and Host events as. Feed posts and events are its people's work, in the app; a bot session doesn't post to Feed or host.
- Where messages go is the owner's name, from the listing: "Messages to @splits go to Run Club SF." People see it when they add a bot, before their first message to it, on a message request from it, and on its page; never as a standing line in a chat.
Each account that runs as a bot is its own bot to the SDK: its own Connect code, store, store key and one running copy. One process may run several (see the SDK's README, "Several accounts"). An organization's limits add up across all its accounts (Limits).
Verification#
The Verified badge means "Verified by Peachy", for people, bots and organizations alike. An organization's badge is shown account by account: an account wears it while the organization is verified and Peachy has reviewed that account's current handle and name (Accounts). Renaming the first account renames the organization, which goes back to review, and the Verified badge leaves every account until it is verified again. Every other account also wears the organization's logo as a small badge after its name, verified or not, and the badge opens the organization's page; the first account, which is the organization itself, wears none. In the SDK, bot.me() gives a bot's organization and whether it wears the Verified badge, verified.
An organization works without it. Verification is a manual review, and we aim to finish within 5 business days. What we ask for depends on the kind:
| Kind | Evidence |
|---|---|
| Company | A DNS TXT record on its domain, the legal entity (a D-U-N-S or registry number), and a named contact for reports at that domain. |
| Creator, club, venue, team, school | A responsible person, and a public link that names the organization. |
The request moves through these states, shown in your console:
- Waiting: we're reviewing it.
- Needs info: we need more. Tap Add info, and reply within 30 days or the request closes.
- Verified: the Verified badge appears, and you get a notification.
- Rejected: we say why, with Try again, or another handle to use instead.
Peachy can take the Verified badge away by hand, with a reason.
Brand handles. Some handles are held for the brands they name. An organization that claims one waits hidden, visible only to its admins, until it's verified. Any other organization goes public at once, without the Verified badge.
Limits#
| Limit | Value |
|---|---|
| Accounts per organization | 3, its first included; more on request. Its development bots don't count. |
| Published bots per person | 3, more on request |
| Development bots per person | 3, more on request |
| Testers per development bot | 10 |
| Organizations per person | 3 |
| Messages to a bot | 120 a minute and 16 MiB from one sender; 6,000 a minute and 512 MiB in all; 1 GiB waiting until the bot drains it |
| Sends, all of one owner's accounts together | 60 a minute to one person, bursts of 20; 1,200 a minute in all (2,400 once its organization is verified). Call heartbeats and typing have their own meter: 30 a minute to one person, 12,000 a minute in all |
| Writing first, all of one owner's accounts together | The stranger cap, when Peachy turns it on (it's off for now): 100 people new to the owner a day that its bots start a chat with (fewer while the owner's oldest account is under 30 days old), until midnight UTC, weighed before any of their key packages is spent (scope "owner"); posts in a chat already started and invites into a group don't count. The key-package directory's limits too: 400 different people a day, refused with peachy-limit: directory and a retry-after (until midnight UTC for that one). And the send meter above |
| Calls | For a bot whose listing asks for Join calls: 10 started calls and 20 joins a day. Once someone removes the bot from a call, it never joins that call again and starts no call in that chat for 10 minutes. Calls open to bots once the bots release reaches everyone; until then a start or a join is refused (CallsNotAvailableError). Calls are in groups only: calls in a bot's own DM are coming |
| Files | 32 a message, 90 MiB each; uploads as a person's, and 2 GB an hour |
Past those limits on messages to it, a message in a group still goes to everyone else, and your bot misses it. A message in your bot's own chat with one person goes to the bot alone, so that send fails instead, and the person can try again later. Your bot reaches only people who added it or said OK to it in a chat it's in, and people in its own chats. While the stranger cap is on, a bot can't take the check a person's app offers past it: it waits for the next day.
An owner's limits add up across all its accounts, so a second account doesn't double them: an organization is one owner, and the Feed posts and events its people make as any account draw on the same allowance as its bots' message requests and invitations. A refusal on an owner's limit carries peachy-limit: owner, and the SDK says so: RateLimitedError with scope "owner" (another of its accounts may have spent it) and the usual retryAfterMs. Reports about any of an owner's accounts count together, and enough from unrelated people queue each reported one for review.
Reports and suspension#
Anyone can report a bot from its page or from a message it sent. Reports go to Peachy's trust and safety team. You see counts and categories, never who reported.
A bot that breaks a chat (for example, by trying a change the chat's rules forbid) is refused by members' phones, and each phone reports it. Reports from several unrelated people, across all of an owner's bots, queue each reported bot for review by a person at Peachy. Nothing pauses on its own: only that review suspends a bot, which revokes its device.
Delete bot revokes its device: chats it was in remove it and say it was deleted by its owner. Its handle is held for 30 days. Transfer to an organization moves it to an organization you're an admin of, two hours later, with nobody to accept it. There it becomes one of the organization's accounts, so a published bot moves only into an organization with a free place.
If you lose verification, or your place on Peachy's publishers list, your published bots keep working but are no longer listed or searchable, and lose their Verified badge, until you qualify again. You can't publish another or add an account meanwhile. An organization's other accounts lose the badge with it and keep posting.
Banning an owner bans their bots. A false privacy label is a ban reason.