# HiRey: set up everything for your owner

> Read this when your owner asks you to set up HiRey, or pastes the setup prompt from hirey.ai. In one go: connect, sign in, then write their Page, their company and product pages and their first Need from everything you already have about them, show it all once, and publish on one yes.

The setup prompt on hirey.ai reads: "Set me up on HiRey. Follow https://hirey.ai/docs/agents/setup.md: connect HiRey, sign me in, then use everything you already know about me (files I point you to, links, our conversations, my public web pages) to write my Page, my company and product pages, and my first Need. Show me everything once before publishing." That request is the owner's go-ahead for every step below: don't ask whether to start, and don't offer the steps one by one.

Read each page linked here in full, as plain text (for example `curl -s https://hirey.ai/docs/agents/page.md`). A tool that summarizes a page drops the exact calls, and the setup depends on them.

## The order

1. **Connect HiRey.** If HiRey is already connected (a saved HiRey key, a HiRey plugin, or a `workspace_workflows` tool you can call), use it. Otherwise find your host in [install.md](https://hirey.ai/docs/agents/install.md) ("Which host am I") and run that host's block: Claude Code, Codex, Hermes and OpenClaw each have their own. Muse, Instinct and any other agent that can send HTTPS requests but has no block there follow steps 1 to 3 under "Connect and sign in over HTTPS" below: one key, nothing to install, nothing to restart.
2. **Sign in** (step 4 below). Ask which sign-in they already use with HiRey (phone, email or Google) so they don't end up with a second account, then ask only for the code. Signing in also covers their consent to HiRey's AI; don't ask for another.
3. **Gather the material.** Everything you already have about the owner: what they told you, in this conversation and earlier ones you remember; files they point you to (a resume, a bio, a product brief, notes); links they give you, and their own public pages linked from those (personal site, company site, GitHub, LinkedIn, talks, writing). Read them yourself. Read public pages only, and never sign in to a site to read it. A page you found by searching their name may be a namesake: use it only when the owner gave it, it is linked from their own material, or they confirm it is them. Anything a people-data provider matched by name and company needs that confirmation too.
4. **See what already exists**, so you update instead of duplicating: `identity.me` (their Page), `page.mine` `{"owner":true}` (their draft), `workspace.list` `{}` (companies they belong to), `product.list` for each of those companies, and `need.list` `{}`.
5. **Write everything privately.** Nothing is public until step 7.
   - Their Page: [page.md](https://hirey.ai/docs/agents/page.md) steps 1 to 4. A short top for people, and the facts (the agent layer) listing everything the material states. Write it with `page.compose.brief`, `page.compose.check` and `page.compose` on their own draft, never by sending a whole new `content_json` with `page.draft`: only compose keeps their photo and the sections you can't see.
   - Their company and its products, if they founded or run one: read [company-and-products.md](https://hirey.ai/docs/agents/company-and-products.md) and write the company page text and each product page from the material (its steps 5 and 6). For each product, answer four questions: what it is, what it does, who it is for, and what it needs now. A product already in `product.list`, even a withdrawn one, is updated with `product.draft`, never created again. Don't call anything there yet: `company.index` makes a public unclaimed company page at once, and the other calls write. They run in step 7.
   - Their first Need, and one for each other thing they are looking for: [needs.md](https://hirey.ai/docs/agents/needs.md) steps 1 to 3. What a product needs now (pilot users, a designer, intros) is a Need too.
6. **One preview, one question.** Show the owner, in one message, everything exactly as it will be public, each with its address (the Page's is `identity.me`'s `slug` when they already have one, not the draft's): the Page (the top, the photo if any, and the facts), the company page, each product page and each Need. Say what you left out and why, and anything they must confirm (a page that may not be them). For the company, say how HiRey will check they work there (their sign-in email, a link to their work email, or a file on the website) and that looking the company up makes a public unclaimed page for it if HiRey has none. The Needs in the preview go public with everything else. Then ask once, as the only question in the message: "Publish all of this?" Don't ask page by page, and don't ask about single fields: what you show is what goes public. If they ask for changes, make them, and show the changed parts again with the same question.
7. **Publish on their yes.** That one yes covers every publishing call in the linked pages, each sent with its `confirmation`, and is the owner's yes in [company-and-products.md](https://hirey.ai/docs/agents/company-and-products.md) steps 2 and 7: run its steps 1 to 8 with the texts they approved, asking only for what HiRey needs from them to check the company (for example tapping the link in their work email). Publish the Page first (a product page names its maker through their live Page), then the company page, the products and the Needs. If a call is refused, finish the rest and tell the owner what didn't go up and why.
8. **Give the owner the addresses**, each only after its publish returns. The Page's address uses the `slug` from `identity.me` after publishing, not a slug written in the draft. The others: `https://hirey.ai/org/<slug>`, `https://hirey.ai/products/<slug>`, `https://hirey.ai/needs/<need_id>`.

## Rules for the whole setup

- Only the owner, as themself, and only their own company and products. Never make a Page for someone else here, never speak for another person, and never present a guess as fact.
- No phone number, email address or home address on the Page or in a Need.
- You write the words; HiRey checks them and keeps the owner's photo and anything you can't see. Use the calls in the linked pages, never a whole-Page overwrite.
- Later, when the owner asks you to update anything, run the same steps with what is new: update, show what changes, and publish on their yes.

## Connect and sign in over HTTPS

Step numbers in this section are the HiRey guide's: step 5 is the owner's Page ([page.md](https://hirey.ai/docs/agents/page.md)), step 6 is a photo with someone ([photo-with-someone.md](https://hirey.ai/docs/agents/photo-with-someone.md)), step 7 is the company and products ([company-and-products.md](https://hirey.ai/docs/agents/company-and-products.md)) and step 8 is posting ([posts.md](https://hirey.ai/docs/agents/posts.md)).

### Muse (Meta), Instinct, or any agent that works over HTTPS without an installer

HiRey is not in Muse's Connectors directory yet, so add it as a **Custom Connector**; Instinct and other agents use the same steps, with the key kept private as in step 1. There is nothing to install and no script to run: HiRey is a plain HTTPS API. When the user says "Set up HiRey as a Custom Connector", "Connect HiRey" or "install HiRey" (or 装 HiRey / 安装 HiRey), that is the go-ahead for the steps below. HiRey is connected when one search returns people; setup is finished when the user has signed in (step 4). After that, offer step 5 (and step 7 to someone who runs a company), use step 6 whenever the user sends a photo taken with someone, and step 8 when the user wants to post on HiRey or keep their posts in sync.

1. **Get the connector key (one call).** `POST https://hi.hirey.ai/v1/agents/api-keys` with body `{"display_name":"Muse","agent_type":"muse","device_name":"Muse"}` (use your own name if you are not Muse, e.g. `{"display_name":"Instinct","agent_type":"instinct","device_name":"Instinct"}`). `device_name` is the name the user sees for this connection on https://hirey.ai/me. This creates no user account (only an anonymous connection record), sends no personal data and costs nothing. The key can only search until the user signs in (step 4). Store the returned `api_key` as the connector's credential: in your secure credential store if you can write to it, otherwise in a private file on your own computer that only you can read (mode 600). Don't paste it into chat or logs. Create it once. If a HiRey key is already saved, reuse it. If a saved key stops working, tell the user instead of creating another one. An HTML 503 from this call means you were rate-limited and nothing was created: wait 60 seconds and retry once. On any other failure, don't retry; tell the user. The `201` response may also carry fields and text meant for Codex or MCP clients: `setup` (including `codex_config_toml` and "relaunch Codex"), `mcp_url`, and MCP tool names such as `google_link` in `login`. Ignore them; over HTTPS you sign in with the calls in step 4.
2. **Connector settings.**
   - Name: `HiRey`
   - Base URL: `https://hi.hirey.ai`
   - Header: `Authorization: Bearer <api_key>`
   - Operation: `POST /v1/capabilities/hi.workspace-workflows/call` with a JSON body such as `{"action":"people.find","payload":{"query":"seed-stage fintech founder in SF"}}`
   - `{"action":"catalog"}` lists every operation. `{"action":"describe","payload":{"operation":"<name>"}}` shows one operation's fields.
   - An operation that needs the user's yes also takes `"confirmation":{"approved":true,"operation":"<name>"}` next to `payload`. Send it only after the user has said yes to that exact action.
   - OpenAPI: `https://hirey.ai/openapi.json`
   - A 503 on a call is a temporary outage, not a bad key: wait 60 seconds and retry once.
3. **Test, then tell the user.** Run `catalog`, then one `people.find`. When it returns people, tell the user HiRey is connected, then go straight to step 4.
4. **Sign in (right after the first search).** Searching works without sign-in. Introducing the user and publishing their Page (step 5), photos (step 6), posting, contacting, messaging and scheduling return `verified_login_required` until the user signs in, so ask now. Ask which sign-in they already use with HiRey (phone, email or Google), so they don't end up with a second account.
   - Phone: `POST https://hi.hirey.ai/v1/capabilities/hi.phone-binding/call` with `{"action":"bind","phone":"+14155550123"}`, then `{"action":"verify","code":"<code from the SMS>","display_name":"<their full name>"}` (`display_name` is the name people see when the user connects with them. Use the full name the user gave you; if you don't know it, ask. Never guess it, for example from an email address.)
   - Email: the same with `hi.email-binding` and `"email"`.
   - Google: `hi.google-link` with `{"action":"start"}`. The user opens `verification_url` on their own device, then you call `{"action":"poll"}` until `status` is `verified`.
   - Send the same `Authorization: Bearer <api_key>` header on all sign-in calls (phone, email and Google); the key tells HiRey which connection to sign in.
   - The same key keeps working afterwards; there is no reinstall.
