# Share a website with someone (and their AI agent)

Site sharing lets another person, and the AI agent they use, run one domain's
website for you without getting your account. Typical case: you manage a
partner's or client's WordPress site through your own agent, and sometimes
you want them to make their own changes with theirs.

It works for Cloud for WordPress, Secure Static Hosting and Link in Bio.

## What the other person can and can't do

They get a new key with the `site` permission, limited to that one domain.

- **Can:** edit the WordPress site's pages, posts and images
  (`/hosting/wpRequest` and `/hosting/wpUploadMedia`, MCP `wordpress_request`
  and `wordpress_upload_media`, no WordPress password needed), upload and delete static files, edit the Link in
  Bio page, take and restore backups, use a staging copy, change PHP and
  WordPress versions, SSL and search visibility.
- **Can't:** buy anything, cancel the hosting or change auto-renew, change DNS,
  turn on a Link in Bio page, reach any other domain, or see anything
  account-wide (balance, invoices, the domain list). Those calls return
  `INSUFFICIENT_SCOPE` or `DOMAIN_NOT_ALLOWED` and change nothing.

## 1. Ask (your agent)

```
POST /api/json/v3/apikey/share
{"apikey": "...", "secretapikey": "...",
 "domain": "example.com", "sharedWith": "Sarah"}
```

MCP: `share_site_access`. Optional `claimHours` (1 to 168, default 24) is how
long the link works once approved. Optional `accessHours` (1 to 8760) is how
long the access itself lasts, counted from when they connect: `48` shares the
site for two days. Leave it out and the access lasts until it is revoked.

**Nothing is shared yet.** The response has an `approveUrl`. An agent can ask
to share, but only the account holder can approve it, so give them the link.

## 2. Approve (you, on porkbun.com)

The approval page shows the domain, who it is for, and exactly what they will
be able to do. Approving (after the usual re-verify) shows the **share link**
and a **QR code** of it. That's all you send: the link opens a page for them
with a **handoff prompt** to paste into their AI assistant, which explains what
was shared and how to connect, step by step, including the **share code**. On a
phone, **Share** sends the link straight to Messages or email. "See what they'll
see" opens that page without using the link up.

Your agent can fetch the link afterwards with `GET /apikey/shares` (`shareUrl`; it also returns `handoffPrompt` and `shareCode` in case the agent sends the message itself)
(MCP: `list_site_shares`).

If API access is off for the domain, the page offers to turn it on; their
agent needs it.

## 3. Connect (them)

The link works **once**. Opening it shows what was shared and how to connect;
opening it doesn't claim anything.

- **Claude app or ChatGPT:** add the Porkbun connector
  (`https://mcp.porkbun.com/mcp`), choose Connect, then "I have a share code"
  on the Porkbun page and enter the code. No Porkbun account needed.
- **Any other agent:** paste the handoff prompt. The agent claims a key:

```
POST /api/json/v3/apikey/claim
{"shareToken": "<the token from the link>"}
```

No API key is needed for this call. It returns `apikey` and `secretapikey`
once; the secret is never shown again. The agent then starts with
`GET /hosting/get/example.com`.

## 4. Stay in control

- All your shares are listed under **Site Shares** in
  [API Access](https://porkbun.com/account/api#siteShares): approve a waiting
  one, show an unused one's link and QR code again, or end any of them.
- You get an email when the share is claimed, with where it came from.
- The access shows as the key **"Share: Sarah"** in
  [API Access](https://porkbun.com/account/api). Its permissions can't be
  edited; delete it to end their access.
- They can give it back themselves: their agent calls `POST /apikey/revoke`
  with `{"confirm": "revoke"}` (MCP: `revoke_api_key`), and you get an email.
- Or revoke from your agent: `POST /apikey/revokeShare` with the share `id`
  (MCP: `revoke_site_share`). Unclaimed links stop working; a claimed key stops
  within seconds.

## Errors

- `SHARE_NOT_FOUND`: the link or code was already used, revoked, expired or
  mistyped. Ask for a new one.
- `HOSTING_NOT_FOUND`: the domain has no hosting or Link in Bio page to share.
- `INSUFFICIENT_SCOPE`: on `/apikey/share`, the key needs full access or the
  `account` permission, and a key that was itself shared can't share onward.
  For the person it was shared with, the call is outside what `site` allows.
- `DOMAIN_NOT_ALLOWED`: the call named a domain other than the shared one.
- `SHARE_ACCESS_ENDED`: the share's `accessHours` ran out and the key no longer
  works. Share again if more time is needed.

Sandbox keys can't share: hosting doesn't exist in the sandbox.


---

## More

- Short overview (start here): https://porkbun.com/llms.txt
- Guides (how-tos): https://porkbun.com/llms/guides
- Help articles (knowledge base) as Markdown: https://porkbun.com/llms/kb
- Topic index: https://porkbun.com/llms
- Full reference (one file): https://porkbun.com/llms-full.txt
- OpenAPI spec (full schemas): https://porkbun.com/api/json/v3/spec
- Official MCP server: https://porkbun.com/mcp (`npx -y @porkbunllc/mcp-server`)
- Porkbun for AI agents (overview): https://porkbun.com/ai-agents
- Agent Name Service (verifiable agent identity): https://porkbun.com/ans
- Agent content provenance (signed manifests): https://porkbun.com/agent-provenance
- Terraform / DNS as code: https://porkbun.com/terraform
- Create API keys: https://porkbun.com/account/api
