Read this first
This guide is written for autonomous AI agents operating Puffle on behalf of a human customer. Use only the public endpoints documented under API Reference. Dashboard-only, admin-only, inbound webhook, and private UI routes are intentionally outside this contract. If something appears missing from the docs, it is either intentionally out of scope (admin-only tools, inbound webhook receivers) or a gap to report back to the human — do not guess endpoints.Authentication
Every public API call must include a Puffle API key as a Bearer token:- Keys are created by the human customer in the Puffle dashboard. The
/api/user/api-keyendpoints are session-authenticated dashboard endpoints, not Bearer-token backend integration endpoints. - Keys are scoped to a single workspace.
- Never log or echo the key back to the customer.
- On
401 unauthorized, stop and ask the human for a valid key — do not retry blindly.
Boot sequence — the first thing to do
Before issuing any workflow call, read the workspace profile. Skipping it leads to agents operating on incomplete assumptions (wrong ICP, empty context, insufficient credits).What does the workspace know?
- So you can explain the user’s business back to them when asked (“You’re targeting Series A startups in fintech…”)
- So you can detect a mismatch with the task (if the user asks you to outreach to retail buyers but their ICP is B2B SaaS, flag it)
- So you can self-select which journey to run (e.g. “lead reply inbox” is only meaningful if at least one campaign has launched)
context or profile is null, stop and escalate to the human — no point launching campaigns, running research, or configuring signals for a user who hasn’t finished setting up their ICP and company profile. The UI blocks those actions too.
After this call, branch into the appropriate user journey below.
Credit system — check before spending
Puffle charges credits for actions that call paid third-party services, such as enrichment, signal scans, and LLM-powered generation. Before starting a large paid operation, read the public credit configuration and estimate cost from the requested batch size.Async patterns
Expensive operations are async. The pattern is uniform:POSTkicks off the work → responds202 Acceptedwith acorrelationId(also in thex-correlation-idheader) and a reference to a status endpoint.GETthe status endpoint by ID → returnsstatus: "pending" | "running" | "done" | "failed"plus a result payload whendone.- Poll with backoff (start 2 s, double up to 30 s). Most operations finish in 30 s–5 min.
correlationId. If the human reports an issue, capture and pass this ID back — support can trace every downstream call and background job through a single query.
Do not busy-loop without backoff. Do not poll more than once per second. Do surface the correlationId to the human in every error message.
Error handling
The API Overview documents the current error shapes. Prefer structured errors when present:{ "error": "..." }. Use each endpoint page’s response examples as the source of truth.
| Status | Agent response |
|---|---|
400 invalid_request | Fix the payload from the message content. Do not retry the same body. |
401 unauthorized | Stop. Ask the human for a valid API key. |
403 forbidden | Stop. This workspace lacks access to this feature; inform the human. |
404 not_found | Resource doesn’t exist or belongs to another workspace. Do not retry. |
409 conflict | Resource already exists. Fetch the existing one and continue. |
422 unprocessable_entity | Semantic error — reread the endpoint doc. Do not retry without changes. |
429 rate_limited | Back off. Respect Retry-After if present, otherwise wait 30 s. |
500 internal_error | Retry once after 5 s unless the endpoint says the action already happened. For one-off email sends, if the response says the message was sent but could not be saved, do not retry. |
Core user journeys
The five sequences below cover 90% of what a customer-role agent needs to do. Each chains endpoints in a specific order — follow it.Journey 1 — Launch a campaign end-to-end
Journey 2 — Import leads into a list
Journey 3 — Configure signals and query the feed
Journey 4 — Manage replies in Unibox
Journey 5 — Send a one-off email
500 that says the message was sent but could not be saved, do not retry the send. The recipient may already have received the email. Stop and report the response instead of using step 4 as a reason to send again.
Related: Create thread · Send message · Senders.
What agents MUST NOT do
- Do not call endpoints under
/api/admin/*— these are internal team tools, not part of the product surface. - Do not call inbound webhook receivers or internal integration callbacks — they are called by external services, never by you.
- Do not attempt OAuth flows (Gmail, LinkedIn, Reddit, or sender account connection) autonomously — they require a human-in-the-loop browser session. If a feature requires an OAuth-connected account, tell the human and stop.
- Do not persist the API key anywhere except in-memory for the duration of the task.
- Do not ignore endpoint-specific rate limits or poll faster than endpoint guidance — see API Overview rate limits.
Escalation
Stop and ask the human when:- Credits are insufficient for the requested work.
- An operation requires OAuth/browser interaction (account connection, login flows).
- A
403 forbiddenor404 not_foundon a resource you expected to exist. - A
500 internal_errorthat persists after one retry — include thecorrelationIdin the escalation. - The requested outcome has no corresponding endpoint documented here.