How can we help?
It's a platform that puts a team of AI specialists in charge of your marketing: social media, Google and Instagram ads, content, SEO and WhatsApp support. It works like an agency, but without the high price and without you needing to understand marketing.
No. You tell us what your business does and the AI team handles the rest. Everything is explained in plain language, no jargon. If you get stuck, just ask for help.
Plans start at R$297/month. Each plan comes with a monthly amount of credits, which cover the AI's work (creating images, sending messages, making calls). You can see all prices on the pricing page.
Credits are the simple way to pay for what the AI does. Each action (an image generated, a WhatsApp message, a minute of calls) uses a few credits. Your plan renews an amount every month, and you can top up more whenever you want. So you only pay for what you use.
Yes. AutoAgency was built for local businesses and small companies — clinics, restaurants, lawyers, repair shops, stores, service providers and many more. We have ready-made strategies for dozens of niches.
For most local businesses, yes — and at a fraction of the cost. The AI handles the day-to-day work an agency would do (posts, campaigns, support) consistently and 24/7. And there's always real people ready to help when you need.
Yes. We handle your data under privacy law (Brazil's LGPD), securely and without ever selling your information. You can request deletion of your data at any time.
Yes, you start with a 7-day trial to get to know the platform before being charged.
Yes. No lock-in, no penalty. You cancel anytime right from your dashboard.
Just use the contact page or write to contato@autoagencia.io. We reply fast, with real people.
The AutoAgencia API connects your AutoAgencia CRM, AIMailCheck email verification, LeadAdsPilot Meta events and Brazilian invoicing (NFS-e and NF-e) to Zapier, to Make, to your own n8n and to AI assistants through MCP — all with the same key. This page documents every endpoint they use. **Full reference (OpenAPI/Swagger):** every endpoint, field, example and error, with in-browser testing, is at [autoagencia.io/docs/api](https://autoagencia.io/docs/api/). The OpenAPI 3.1 file, to generate clients or import into Postman, is at [autoagencia.io/openapi.json](https://autoagencia.io/openapi.json). ## Before you start 1. In AutoAgencia, open **Integrations → Zapier** (`https://autoagencia.io/app/integracoes`). 2. Name the connection and enable only the permissions your Zap needs. 3. Copy the key. It is shown only once; AutoAgencia stores a hash, never the key itself. 4. In Zapier, add the AutoAgencia app and paste the key as the **API Key**. Each action also requires the matching module to be active in your workspace. Revoking the key in AutoAgencia stops all future calls; a new key requires reconnecting your Zaps. | Permission | What it allows | Module | | --- | --- | --- | | `crm:read` | New Lead, Lead Stage Changed, Lead Won, Find Contact | CRM | | `crm:write` | Create Lead, Create or Update Contact, pipeline list, send job status back to a won card | CRM | | `email:verify` | Verify Email (uses AIMailCheck credits) | AIMailCheck | | `meta:events` | Send CRM Event to Meta | LeadAdsPilot | | `fiscal:read` | Get and list invoices, download PDF/XML, invoice events and webhooks | Invoicing | | `fiscal:write` | Issue and cancel invoices | Invoicing | ## Authentication - Base URL: `https://autoagencia.io/api/public/zapier` - Header: `Authorization: Bearer <your key>` - Never put the key in the URL. Every response has `Cache-Control: no-store`. - Request bodies are JSON, up to 16 KB. The workspace is always derived from the key. A request can never choose or read another workspace. ## Endpoints ### GET /me Tests the connection. Returns the workspace and connection names. ```json { "id": "workspace-id", "workspace_name": "Example Company", "connection_name": "Sales Zaps", "scopes": ["crm:read"] } ``` ### GET /events Lists CRM events, newest first, in pages of 100. Only events after the key was created are returned; deleted and merged leads are not exposed. | Parameter | Required | Description | | --- | --- | --- | | `kind` | yes | `new_lead`, `stage_changed` or `lead_won` | | `page` | no | Page number, starting at 0 | | `before` | no | ISO-8601 timestamp; returns events that occurred at or before it | Each event has `id` (stable event ID), `lead_id`, `kind`, `occurred_at` (ISO-8601), `title`, `stage_name`, `value_brl` and the contact's `name`, `email`, `phone` and `company`. ### POST /subscribe and POST /unsubscribe (instant triggers) The Zapier app uses these to receive CRM events within about a minute instead of waiting for the next poll. Requires `crm:read`. - `POST /subscribe` with `{ "kind": "new_lead", "target_url": "https://hooks.zapier.com/..." }` returns `{ "id": "<hook-id>" }`. Only `https://hooks.zapier.com/` addresses are accepted. Subscribing the same address again returns the same ID. - `POST /unsubscribe` with `{ "id": "<hook-id>" }` returns `{ "id": "...", "removed": true }`. A key can only remove its own hooks. Deliveries are a JSON array of events (same fields as `GET /events`), oldest first, up to 50 per delivery. A `410 Gone` answer removes the hook; after 20 consecutive failures the hook is paused until Zapier subscribes again. Revoking the key stops deliveries. ### GET /pipelines Lists CRM pipelines (`id`, `name`), pages of 100 (`page` parameter). Used by the Pipeline dropdown in Create Lead. ### GET /find-contact Finds one contact by `email` and/or `phone` (at least one). Returns a list with the contact, or an empty list. If the email and phone belong to two different contacts, returns 409. ### POST /contacts Creates or updates a contact matched by email or phone. Fields not sent are preserved. ```json { "name": "Example Contact", "email": "contact@example.com", "phone": "+15555550123", "company": "Example Company" } ``` ### POST /leads Creates a lead, or attaches the source event to the contact's open lead. `external_id` is the stable ID of the record in the previous app; repeating the same `external_id` returns the original result with no duplicate. ```json { "external_id": "form-123", "title": "Website form", "contact": { "email": "contact@example.com" }, "pipeline_id": "optional-pipeline-id", "value_brl": 100, "note": "Optional note" } ``` Returns `{ "id": "lead-id", "contact_id": "contact-id", "deduplicated": false }`. ### POST /verify-email Verifies one email with AIMailCheck: `{ "email": "contact@example.com" }`. Returns `status`, `reason`, `score`, `credits_used` and, when the mail server asks to wait, `retry_after` in seconds. `credits_used` reports the cost of each call; a recent verdict for the same email may be reused. Returns 402 when the workspace has no credits. ### POST /meta-events Queues a stage change from an external CRM to Meta. First enable **Own CRM + webhook input** in LeadAdsPilot. ```json { "eventId": "crm-event-123", "stage": "qualified", "leadId": "optional-meta-lead-id", "email": "contact@example.com", "value": 100, "currency": "BRL", "eventTime": 1760000000, "testEventCode": "TEST12345" } ``` - `stage`: `lead`, `qualified`, `converted` or `lost`. - Provide the Meta Lead ID, email or phone. - `eventTime` is a Unix timestamp within the last seven days. - `testEventCode` (optional) sends the event only to Meta Events Manager → Test Events. Returns 202 `{ "accepted": true, "duplicate": false }`. Acceptance means the event was stored in the delivery queue, not that Meta processed it. ## Your own service order system (won deals) Run service orders in your own system? AutoAgencia can call it directly when a SalesFlow deal is won — no Zapier in between — and your system can report the job's progress back to the **same card**. ### Won deal notification (AutoAgencia → your system) Set it up in **Integrations → Your service order system** (`https://autoagencia.io/app/integracoes`): enter your `https://` address, save, copy the signing secret (**shown only once**; you can create a new one at any time) and click **Send test**. Only owners and admins can change it. When a card **moves into a won stage**, your address receives one `POST` within about a minute, with `id`, `type` (`lead_won` or `test`), `occurred_at`, `lead_id`, `title`, `source`, `pipeline_id`, `stage_id`, `stage_name`, `value_brl`, `contact_id`, `name`, `email`, `phone` and `company`. | Header | Value | | --- | --- | | `X-AutoAgencia-Event` | `lead_won` or `test` | | `X-AutoAgencia-Delivery` | Same as `id` — use it to ignore repeats | | `X-AutoAgencia-Signature` | `t=<unix seconds>,v1=<hex>` where `v1` = HMAC-SHA256 of `"<t>.<raw body>"` with your secret | - **Verify the signature** before trusting the request (same Node.js example as the invoice webhooks below). - **Delivery is at least once.** `id` stays the same across retries: if you already processed it, answer 2xx and do nothing. `lead_id` identifies the card — use it to avoid opening two orders for the same sale (a card reopened and won again sends a new `id` with the same `lead_id`). - **Tests** have `"type": "test"` and `"lead_id": null`: answer 2xx and open no order. - **Answer any 2xx within 10 seconds.** We only read the status code. Redirects are **not** followed: use the final address. - **Retries:** 9 attempts in total — right away, then after 1, 5 and 15 minutes and 1, 3, 6, 12 and 24 hours (about two days). After that the sale shows as not delivered on the card and in Integrations (the workspace is notified once), and you can send it again with the same `id`. - `410 Gone` turns delivery off until the address is saved again. - A card that leaves the won stage before delivery is not sent. Deals that arrive already won through a history import are not sent. - Only public `https://` addresses are accepted. The host name is resolved before every delivery; private, loopback, link-local and other reserved IP ranges are refused. - On the card, **Deal won: send it to the field** shows whether the sale was delivered, with a button to send it (also for deals won before the address was added). ### POST /service-status (`crm:write`) Your system reports the job back to the card that was sent. It is added to the card's history and shown on the card. It never creates a card or moves it to another stage. ```json { "lead_id": "5b1f7a52-9a55-4a4e-8d53-0f4b6f2c9a10", "external_id": "OS-1234", "status": "completed", "note": "Valve replaced and leak test passed.", "occurred_at": "2026-11-26T10:30:00-03:00" } ``` | Field | Required | Description | | --- | --- | --- | | `lead_id` | yes | The `lead_id` you received. If cards were merged, the surviving card receives it | | `external_id` | yes | Your order number (up to 120 characters). One number belongs to one card; a card may have several orders | | `status` | yes | `received`, `scheduled`, `in_progress`, `completed` or `cancelled` | | `note` | no | Text shown on the card (up to 2000 characters), such as the completion report | | `occurred_at` | no | ISO-8601 time with time zone. A call older than the current status is kept in the history without moving the status back | Returns `{ "id": "…", "lead_id": "…", "external_id": "OS-1234", "status": "completed", "deduplicated": false }`, where `status` is the order's current status. - **Repeating is safe:** a call identical to an earlier one (same `external_id`, `status`, `note` and `occurred_at`) changes nothing and returns `"deduplicated": true`. To record the same status again on purpose, send a new `occurred_at`. - `404 not_found`: the card does not exist in this workspace or was deleted. - `409 lead_not_won`: the card was never a won sale. - `409 external_id_conflict`: this order number is already linked to another card. Create the key in **Integrations** with **Create leads, update contacts and send back job progress**. ## Invoices (NFS-e and NF-e) Issue Brazilian tax invoices from any system — an ERP, an online store, n8n, Make, Zapier — through the workspace's invoicing setup in AutoAgencia (**Invoicing** at `https://autoagencia.io/app/fiscal`: company data and A1 certificate). Invoices requested here are the same invoices the workspace sees on that page. Invoice object (returned by every endpoint below): ```json { "id": "0b6a5f3c-…", "external_id": "order-123", "type": "nfse", "environment": "test", "status": "authorized", "number": "4375", "access_key": null, "protocol": "…", "message": null, "amount": 350, "customer_name": "Maria Silva", "customer_document": "12345678909", "description": "Water heater installation", "source": "api", "cancellation_requested": false, "created_at": "2026-10-21T13:00:00Z", "updated_at": "2026-10-21T13:00:20Z", "files": { "pdf": "https://autoagencia.io/api/public/zapier/invoice-file?id=…&format=pdf", "xml": "https://autoagencia.io/api/public/zapier/invoice-file?id=…&format=xml" } } ``` - `status`: `processing` → `authorized` or `rejected`; an authorized invoice can become `cancelled`. The tax authority answers in seconds to minutes; AutoAgencia checks every minute. - `environment`: `test` (no tax value) until the workspace switches to real issuing in AutoAgencia. - `files` is `null` until the invoice has a number; the links require the same `Authorization` header. ### POST /invoices (`fiscal:write`) Issues an invoice. `external_id` is the order ID in your system: repeating it returns the same invoice with `"deduplicated": true` and never issues another. If that invoice was **rejected**, the same `external_id` is accepted again, so you can fix the data and retry. Service invoice (NFS-e): ```json { "external_id": "order-123", "type": "nfse", "customer": { "document": "123.456.789-09", "name": "Maria Silva", "email": "maria@example.com" }, "description": "Water heater installation", "amount": 350 } ``` Product invoice (NF-e) — the customer's address is required, and up to 50 items: ```json { "external_id": "order-124", "type": "nfe", "nature": "VENDA", "customer": { "document": "11222333000181", "name": "Example Store Ltda", "address": { "street_type": "Rua", "street": "das Flores", "number": "10", "complement": "Sala 2", "district": "Centro", "city_code": "4115200", "city_name": "Maringá", "state": "PR", "zip": "87010-000" } }, "items": [ { "description": "Gas stove", "ncm": "73211100", "cfop": "5102", "quantity": 1, "unit_price": 900 } ] } ``` `document` is a CPF (11 digits) or CNPJ (14 digits); `city_code` is the IBGE code. The service code and ISS rate come from the workspace setup. Returns the invoice, usually with `status: "processing"`. A refusal from the tax provider returns 422 `invoice_rejected` with the reason in `message`; an incomplete setup (no certificate yet) returns 409 `fiscal_setup_incomplete`. ### GET /invoice (`fiscal:read`) One invoice by `id` or by `external_id` (query parameter). A `processing` invoice is checked with the tax provider before answering. ### GET /invoice-list (`fiscal:read`) Latest invoices first, pages of 100. Optional `status` (`processing`, `authorized`, `rejected`, `cancelled`) and `page`. ### POST /invoice-cancel (`fiscal:write`) `{ "id": "…" }` or `{ "external_id": "order-123" }`. Only an authorized invoice can be cancelled; this cannot be undone. Returns the invoice with `cancellation_requested: true` until the authority confirms (`status: "cancelled"`). ### GET /invoice-file (`fiscal:read`) `?id=…&format=pdf` or `format=xml`. Returns the file itself (`application/pdf` or `application/xml`). ### GET /invoice-events (`fiscal:read`) Polling, newest first, pages of 100, only after the key was created. `kind` is required: `invoice_authorized`, `invoice_cancelled` or `invoice_rejected`; optional `page` and `before`. Each event is `{ "id", "type", "occurred_at", "invoice": { …invoice object… } }`. The invoice shows its **current** state. ### Webhooks: POST /invoice-subscribe and POST /invoice-unsubscribe (`fiscal:read`) Receive each invoice event at your own address within about a minute — n8n "Webhook" node, Make "Custom webhook", Zapier "Catch Hook" or your system. - `POST /invoice-subscribe` with `{ "target_url": "https://…", "events": ["invoice_authorized", "invoice_cancelled", "invoice_rejected"] }` (`events` optional, all three by default) returns `{ "id": "…", "secret": "whsec_…", "events": [...] }`. **The secret is shown only once.** Subscribing the same address again replaces its secret and events. - `POST /invoice-unsubscribe` with `{ "id": "…" }`. A key can only remove the webhooks it created. - Workspace owners can also add webhooks without code at **Invoicing → Connect another system**. Only public `https://` addresses are accepted (no internal networks, IP addresses of private ranges or credentials in the URL). Each delivery is one `POST` with one event (same JSON as `/invoice-events`) and these headers: | Header | Value | | --- | --- | | `X-AutoAgencia-Event` | `invoice_authorized`, `invoice_cancelled` or `invoice_rejected` | | `X-AutoAgencia-Delivery` | Event ID — use it to ignore repeats | | `X-AutoAgencia-Signature` | `t=<unix seconds>,v1=<hex>` where `v1` = HMAC-SHA256 of `"<t>.<raw body>"` with your secret | Answer with any 2xx. Other answers are retried every minute, in order; after 20 consecutive failures the webhook is turned off (add it again to turn it back on). `410 Gone` removes it. Revoking the key that created it also turns it off. Verifying the signature (Node.js): ```js const [t, v1] = header.split(",").map((p) => p.split("=")[1]); const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex"); const valid = crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected)) && Date.now() / 1000 - Number(t) < 300; ``` ## MCP server (AI assistants) Connect AI assistants (Claude, ChatGPT, Cursor and other MCP clients) at `https://autoagencia.io/api/public/mcp` — Streamable HTTP, JSON responses, no SSE stream. ### Sign in with your AutoAgencia account (Claude, ChatGPT) 1. In the assistant, add a custom connector with the address `https://autoagencia.io/api/public/mcp`. Keep the default options. 2. Click **Connect**. AutoAgencia opens and asks you to sign in. 3. Choose the workspace and what the assistant may do, then click **Allow access**. Only owners and admins can connect. The assistant gets its own access, separate from your keys. It lasts one hour and renews by itself; every call checks again that you still manage the workspace and that the module is active. To stop it, open **Integrations → Connected assistants** and click **Disconnect** — the access ends at once. To grant more permissions, disconnect and connect again. Technical details: OAuth 2.1 with PKCE (S256), discovery at `/.well-known/oauth-protected-resource` and `/.well-known/oauth-authorization-server`, Client ID Metadata Documents and dynamic client registration (`/api/public/oauth/register`). Tokens are stored only as hashes. ### With a key (Claude Code, Cursor, scripts) Send `Authorization: Bearer <key>` with a key created in Integrations. Example for Claude Code: ``` claude mcp add --transport http autoagencia https://autoagencia.io/api/public/mcp --header "Authorization: Bearer aa_zap_..." ``` ### Tools Only the tools allowed by the connection's permissions are listed: `get_workspace`, `list_crm_events`, `find_contact` (`crm:read`); `list_pipelines`, `upsert_contact`, `create_lead` (`crm:write`); `verify_email` (`email:verify`); `send_meta_crm_event` (`meta:events`); `get_invoice`, `list_invoices` (`fiscal:read`); `issue_invoice`, `cancel_invoice` (`fiscal:write`). Each tool calls the endpoint above with the same rules, limits and errors; an API error comes back as a tool result with `isError: true` and the API message. A missing, invalid, expired or revoked credential answers HTTP 401 with a `WWW-Authenticate` header that points to the sign-in. ## n8n node Running your own n8n? Install the community node `n8n-nodes-autoagencia` under **Settings → Community Nodes**, then create an "AutoAgencia API" credential with the same key. It includes the **AutoAgencia Trigger** (New Lead, Lead Stage Changed, Lead Won — on the schedule you choose; the first activation only marks the starting point) and the **AutoAgencia** node (Create Lead, Create or Update Contact, Find Contact, Verify Email, Send CRM Event to Meta, Issue Service Invoice, Issue Product Invoice, Get Invoice, Cancel Invoice, Download Invoice File), which can also be used as an AI Agent tool. The trigger also starts on Invoice Authorized, Invoice Cancelled and Invoice Rejected. ## Errors Errors return `{ "error": { "code": "...", "message": "..." } }`. | Status | Meaning | | --- | --- | | 400 | Invalid input | | 401 | Invalid or revoked key — reconnect in Zapier | | 402 | No AIMailCheck credits | | 403 | Missing permission, inactive module or workspace, or Meta connection disabled | | 404 | Unknown operation, pipeline, invoice or card | | 405 | Wrong HTTP method | | 409 | Contact identity conflict, invoicing setup incomplete, card not won, or order number linked to another card | | 413 | Body larger than 16 KB | | 422 | Invoice refused by the tax provider (reason in `message`) | | 429 | Rate limit or full queue — retry after the `Retry-After` header | | 503 | Temporarily unavailable — retry later | ## Support Email `contato@autoagencia.io` or open the help center at `https://autoagencia.io/ajuda/autoagencia/en`. Privacy policy: `https://autoagency.io/privacidade`. Terms of service: `https://autoagency.io/termos`.
Ask Rebeca
Rebeca is our AI assistant and answers in plain language, any time. Just click the chat bubble in the corner of the screen.
Step-by-step manuals live inside each module, in the “How to use” tab — written and maintained by the agents themselves. When logged in, you can also find them all in the search above.
Still stuck? Our AI agents help you find a solution.
Talk to us