Developer docs
Ask Pufy from your own code with a personal API key, or connect it to any app that speaks MCP.
Base URL
export PUFY_API=https://api.pufy.app
The examples on this page read the address from PUFY_API.
API keys
Keys are personal and part of Pufy Plus. A key asks Pufy as you, with your memory, notes, to-dos, web search and connected apps.
- In the Pufy app, open Settings, then API and MCP.
- Tap New key and name it after where you will use it.
- Copy the key. It starts with
pufy_(keys made before the rename start withbear_and keep working) and is shown only once. Pufy keeps only a hash of it.
You can have up to 5 keys. Delete one in the same place to stop it at once. Send the key in the Authorization header:
Authorization: Bearer pufy_...
POST /v1/ask
Asks Pufy one question and returns the whole answer as JSON when Pufy has finished. A full turn can take a while if Pufy searches or reads pages, so allow a long timeout (a minute or two).
Request body
| Field | Type | Meaning |
|---|---|---|
text | string, required | What to ask or ask for. Up to 4,000 characters; longer text is cut. |
conversation | string, optional | The id of one of your agents' chats. Leave it out to use your default agent, Pufy. Group chats are not accepted. |
Example
curl $PUFY_API/v1/ask \
-H "Authorization: Bearer $PUFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "What is on my to-do list today?"}'
Response
{
"text": "You have 3 open to-dos today: ...",
"cards": [],
"conversationId": "..."
}
| Field | Meaning |
|---|---|
text | Pufy's reply. |
cards | Actions waiting for approval in the app, each {id, summary}. Empty when there are none. |
conversationId | The chat the question went to. Pass it back as conversation to keep using it. |
error | Only when the turn failed part way: {code, message}. |
When Pufy wants to act, the reply says so and the card is listed:
{
"text": "I've drafted the event. Approve it in the app.",
"cards": [{ "id": "...", "summary": "Create event: Lunch with Ana, Fri 13:00" }],
"conversationId": "..."
}
The question appears in your chat in the app, marked "(Asked through the API key "name")". Times are read in UTC, so give a time zone when it matters. Files and temporary chats are not available through the API.
GET /v1/cards/{id}
Follow up on a card from an answer: same key, the card's id. You get its summary and what became of it, never what the action returned. Cards from temporary chats and groups are not shown. If you poll, wait a minute or more between checks, or set a webhook instead.
curl $PUFY_API/v1/cards/CARD_ID \
-H "Authorization: Bearer $PUFY_API_KEY"
{ "id": "...", "summary": "Create event: Lunch with Ana, Fri 13:00", "status": "done" }
status is pending (waiting in the app), running, done, failed, declined or expired. An unknown id answers 404 with pufy.api_card_not_found.
Webhooks
Instead of polling, give a key a webhook: in API and MCP, tap Webhook under the key and enter an https:// address on the public internet (no IP addresses, no ports other than 443). Saving shows a signing secret starting with whsec_, only once; Pufy keeps it only encrypted. Saving again makes a new secret. Clear the address to stop.
Pufy then sends a POST with a small JSON event when a question asked with that key (through /v1/ask or MCP) finishes, and when a card it left changes status. Events carry ids and statuses only, never what Pufy said or what an action returned: use GET /v1/cards/{id} for the summary.
{ "id": "evt_...", "type": "ask.finished", "createdAt": 1760900000, "keyId": "...",
"data": { "conversationId": "...", "cardIds": ["..."], "status": "done" } }
{ "id": "evt_...", "type": "card.status", "createdAt": 1760900060, "keyId": "...",
"data": { "cardId": "...", "conversationId": "...", "status": "done" } }
ask.finished:statusisdone, orfailedwith acodewhen the turn ended in an error.card.status: the same statuses asGET /v1/cards/{id}. Statuses are checked about once a minute, so two changes within a minute arrive as the last one. A card is followed until it is done, failed, declined or expired, for up to 7 days.
Checking the signature
Each request has a Pufy-Timestamp header (Unix seconds) and a Pufy-Signature header, v1= followed by the hex HMAC-SHA256 of the timestamp, a dot and the raw body, keyed with your secret. Compare in constant time and refuse timestamps more than 5 minutes old.
import { createHmac, timingSafeEqual } from "node:crypto";
function fromPufy(secret, timestamp, signature, rawBody) {
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const expected = "v1=" + createHmac("sha256", secret).update(`${timestamp}.${rawBody}`).digest("hex");
return expected.length === signature.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
}
Delivery
- Answer with any 2xx status within 5 seconds. Redirects are not followed and count as a failure.
- A failed event is tried again after about 1 minute, 5 minutes and 30 minutes, with the same
id(use it to ignore repeats), then dropped. - After 3 events in a row are dropped, the webhook turns off and the app says so. Save the address again to turn it back on.
- The address must keep resolving to public IP addresses; it is checked again before every try.
Errors and limits
Errors are JSON with a message and a code:
{ "message": "That API key is not valid.", "code": "pufy.api_key_invalid" }
| Status | Code | Meaning |
|---|---|---|
| 401 | pufy.api_key_invalid | The key is missing, wrong or deleted. |
| 400 | pufy.api_body | The body is not JSON with a non-empty text. |
| 404 | pufy.conversation_not_found | conversation is not one of your agents' chats. |
| 403 | pufy.agent_plus_required | The key is valid but its account does not have Pufy Plus. On /mcp it comes back as a JSON-RPC error (-32001). |
| 429 | common.rate_limited | Too many requests. About 10 a minute for each key (a wrong key counts against its network address instead). Connecting an MCP client (initialize, notifications, tools/list) does not count. Wait the seconds in the Retry-After header, also in the body as retryAfter. |
| 429 | pufy.daily_limit | Your daily turns are used up. API questions count like questions in the app; a refused question does not count. The body has resetAt (Unix seconds, the next midnight UTC) and limit. |
MCP server
Pufy is an MCP server, so AI apps can ask it things. The address is the base URL followed by /mcp:
https://api.pufy.app/mcp
- Transport: Streamable HTTP. Every request is one
POSTand gets one JSON reply. There is no event stream and no session. - Protocol versions: 2025-06-18, 2025-03-26 and 2024-11-05.
- Authentication: the same
Authorization: Bearerkey. - One tool,
ask_pufy, with one argument,text. It returns Pufy's reply as text, plus a line for each action waiting for approval in the app.
Clients that take a remote MCP address with headers
Add Pufy to your client's mcpServers settings, with the base URL in place of PUFY_API. The app's Copy the MCP settings button gives you this with the address and your key filled in.
{
"mcpServers": {
"pufy": {
"url": "https://api.pufy.app/mcp",
"headers": { "Authorization": "Bearer YOUR_PUFY_KEY" }
}
}
}
Claude Code
claude mcp add --transport http pufy $PUFY_API/mcp --header "Authorization: Bearer YOUR_PUFY_KEY"
Calling it by hand
curl $PUFY_API/mcp \
-H "Authorization: Bearer $PUFY_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {"name": "ask_pufy", "arguments": {"text": "Summarise my notes tagged #trip"}}}'
Approvals
Through the API and MCP, Pufy reads, searches and answers on its own. Anything that sends, books or changes something becomes an approval card that waits in the Pufy app. Only you can approve it there. A key can never approve, decline or change a card, and it cannot create automations.
More for people using Pufy: Use Pufy from other apps.