Built for AI agents. Skip the UI screenshots. This page covers everything an agent needs: auth, base URL, first call, errors, idempotency, pagination, polling, rate limits.Documentation Index
Fetch the complete documentation index at: https://bavlio.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
All examples use the live production API at
https://api.bavlio.com. Replace bav_live_REPLACE_WITH_YOUR_KEY with your real key before running.1. Get an API key
Sign in to bavlio.com
Open bavlio.com/login. Free-tier accounts cannot create keys — upgrade to a paid plan if you see a 403 on creation.
Generate a key from Settings → API keys
Click Create key, name it (e.g.
production-agent), and copy the full value immediately. The full string is shown only once.2. Authenticate
Pass the key as a Bearer token in theAuthorization header on every request. Base URL: https://api.bavlio.com.
3. Make your first call
List your campaigns. Most list endpoints accept?offset=0&limit=100 — see Pagination for endpoint-specific patterns.
cURL
4. Handle errors
Three error envelopes coexist today (a unification migration is on the roadmap). On 4xx, fix the request. On 429, waitRetry-After seconds. On 5xx, retry with exponential backoff. Full taxonomy at Errors.
Python
5. Idempotency (current state)
Workaround until the middleware ships: after a failed mutation, follow up with a read before retrying. For example, after a failedPOST /api/v1/campaigns/, call GET /api/v1/campaigns/?name=<your-name> to check whether your campaign was already created. Match on a stable client-side correlation field. See Errors → Idempotency for the full pattern.
6. Drain a paginated list
Most list endpoints use offset+limit. Some returnhas_more. Some return the full collection. The helper below handles both common shapes.
Python
7. Webhooks (poll instead, for now)
8. Respect rate limits
Bavlio setsX-RateLimit-Limit and X-RateLimit-Reset headers on responses to API-key authenticated requests. On a 429, the Retry-After header tells you exactly how long to wait. There is no X-RateLimit-Remaining header. See Rate Limits.
Copy this for Claude / GPT / Codex
Paste this block into your AI coding assistant to bootstrap a Bavlio integration with the right context.agent-context.py
FAQ
How do I authenticate?
How do I authenticate?
Pass your API key as a Bearer token:
Authorization: Bearer bav_live_<your-key>. Generate keys in your Bavlio dashboard. Keys are scoped to the workspace that created them.What is the base URL?
What is the base URL?
https://api.bavlio.com for the SaaS API. https://api.bavlio.com/api/x402 for x402 pay-per-call endpoints (no auth required).How do I retry safely after a network failure?
How do I retry safely after a network failure?
Bavlio does not yet honor the
Idempotency-Key header. For non-mutating reads (GET), retry freely. For mutating writes (POST/PUT/PATCH/DELETE), check the resulting state with a follow-up GET before retrying. The Idempotency-Key middleware is on the roadmap.How do I paginate results?
How do I paginate results?
Pagination is endpoint-specific. Most list endpoints accept
?offset=0&limit=100. Some return { items, has_more }. Some return the full collection. See Pagination for per-endpoint guidance.Are there webhooks?
Are there webhooks?
Customer-registered webhooks are not yet available. Poll the campaign stats and BaviMail email-events endpoints in the meantime. See Webhooks for the full polling guide and roadmap.
What is the rate limit?
What is the rate limit?
Rate limits apply only to API-key authenticated requests and depend on Redis availability. The
X-RateLimit-Limit and X-RateLimit-Reset headers tell you the current limit window. On 429 the Retry-After header tells you how long to wait.Next
API Reference
Full OpenAPI 3.1 spec, every endpoint.
Authentication
Key format, rotation, scoping.
MCP
Docs MCP live now; API-action MCP on the roadmap.