canonical: https://jentic.com/apis/apistart01.megaapi.com.br/megaapi

# Apistart01 Megaapi Documentation MegaAPI

Jentic publishes the only available OpenAPI specification for Documentation MegaAPI, keeping it validated and agent-ready. MegaAPI is a Brazilian unofficial WhatsApp gateway that lets developers run WhatsApp instances, scan QR codes, and send text, media, location, list, and contact messages programmatically. The API also covers webhook configuration, group management, and chat presence updates, so integrators can build full conversational experiences without using the official WhatsApp Business Platform. It is widely used in Brazil for SME customer support, e-commerce notifications, and chatbot deployment.

## For AI agents

Send WhatsApp messages, manage instances and groups, and receive webhook events for unofficial WhatsApp automation in Brazil.

## Scope

Does not handle official WhatsApp Business Platform template review, voice or video calling, or SMS/email channels - use for unofficial WhatsApp messaging and instance management only.

## Capabilities

- Send text, media, location, link-preview, list, and contact messages to WhatsApp users via `/rest/sendMessage` endpoints
- Provision and manage WhatsApp instances with QR code and pairing-code login flows
- Configure webhooks per instance to receive incoming messages and event notifications
- Manage WhatsApp groups, list members, and inspect group metadata
- Update chat presence (typing, recording) and delete messages from a conversation

## Use cases

### Brazilian E-commerce Order Notifications

Brazilian Shopify and Tray storefronts send WhatsApp order confirmations, shipping updates, and abandoned-cart reminders through MegaAPI without subscribing to the official WhatsApp Business Platform. POST `/rest/sendMessage/{instance_key}/text` dispatches the message and the configured webhook captures the customer reply for the support agent to pick up.

Example prompt: Send a WhatsApp text message to the customer's number with the order tracking link via POST `/rest/sendMessage/{instance_key}/text` using the active instance's bearer token.

### Customer Support Chatbot

Customer-support teams deploy a chatbot on a MegaAPI instance to triage incoming WhatsApp messages, send template responses, and escalate to a human when needed. The webhook configured via POST `/rest/webhook/{instance_key}/configWebhook` delivers each inbound message in real time, while POST `/rest/sendMessage/{instance_key}/listMessage` offers a structured menu reply.

Example prompt: Configure a webhook for the support instance, then on each inbound event send a list message back to the customer with the available support categories.

### Group Broadcast and Community Management

Community managers running paid WhatsApp groups use MegaAPI to enumerate group membership, broadcast announcements, and remove off-topic messages. GET `/rest/group/list/{instance_key}` returns the group inventory and POST `/rest/sendMessage` endpoints push the announcement, with delete-message operations available to clean up.

Example prompt: List all groups on an instance, pick the target group by name, and send a broadcast text message to it via POST `/rest/sendMessage/{instance_key}/text.`

### AI Agent WhatsApp Outbound

An AI agent running an outreach workflow can use Jentic to dispatch WhatsApp messages through MegaAPI without managing instance lifecycle, QR-code login, or webhook reconnection. Jentic surfaces the send-message and instance-status operations by intent, so the agent only has to choose the right message type and pass the recipient.

Example prompt: Search Jentic for 'send a WhatsApp text message', load the POST `/rest/sendMessage/{instance_key}/text` schema, and execute it with the customer phone number and message body.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/rest/sendMessage/{instance_key}/text` | Send a WhatsApp text message to a user. |
| POST | `/rest/sendMessage/{instance_key}/mediaUrl` | Send a media message via a hosted URL. |
| POST | `/rest/sendMessage/{instance_key}/listMessage` | Send a structured list message for chatbot menus. |
| GET | `/rest/instance/{instance_key}` | Check the status of a WhatsApp instance. |
| GET | `/rest/instance/qrcode/{instance_key}` | Fetch the QR code for instance login. |
| POST | `/rest/webhook/{instance_key}/configWebhook` | Configure the inbound webhook URL for an instance. |
| GET | `/rest/group/list/{instance_key}` | List all WhatsApp groups for an instance. |
| GET | `/rest/instance/isOnWhatsApp/{instance_key}` | Check whether a phone number is registered on WhatsApp. |

## Key resources

- **Instance** — Provision, monitor, restart, and log out WhatsApp instances; fetch QR codes and pairing codes for authentication.
- **SendMessage** — Send text, media (URL or base64), location, list, contact (vCard), forwarded, and quoted messages on behalf of an instance.
- **Webhook** — Read and configure per-instance webhook URLs to receive incoming messages and event notifications.
- **Chat** — Update presence indicators and delete messages within an existing chat.
- **Group** — List groups and communities for an instance and inspect individual group metadata.

## Why Jentic

- **Setup:** Wiring MegaAPI by hand means managing its bearer auth, tracking the instance_key in every WhatsApp path, and scanning QR codes to keep the instance connected. Through Jentic you install once, import MegaAPI from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** MegaAPI puts the instance_key in the URL path (`/rest/sendMessage/{instance_key}/...`), so a rule can pin your agent to one WhatsApp instance: it can send messages and read that instance's groups and nothing else. You choose the operations it may call, so instance configuration like configWebhook is not included unless you add it.
- **Credential handling:** Your MegaAPI bearer token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'send a WhatsApp text message' or 'get the instance QR code', and Jentic returns the matching MegaAPI operation with its input schema so the agent calls the right endpoint without browsing the MegaAPI documentation site.

## Related APIs

- **Twilio API** — Official multichannel messaging including WhatsApp Business Platform via Twilio's regulated infrastructure.
- **SendGrid Email Activity** — Pairs with WhatsApp outreach to cover email channel for the same customer journey.
- **Mailchimp API** — Manage audience segments and email campaigns that feed WhatsApp outreach lists.

## FAQ

### Why is there no official OpenAPI spec for Documentation MegaAPI?

MegaAPI does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Documentation MegaAPI via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the MegaAPI use?

MegaAPI uses HTTP Bearer authentication. Pass an Authorization: Bearer <token> header on every request, where the token is the API key associated with your MegaAPI account. Through Jentic the bearer token is stored encrypted and injected at call time, so it never enters the agent's prompt context.

### Can I send media files larger than the WhatsApp limit?

MegaAPI exposes two media-send paths - POST `/rest/sendMessage/{instance_key}/mediaUrl` for hosted files and POST `/rest/sendMessage/{instance_key}/mediaBase64` for in-line base64 - but the underlying WhatsApp transport still enforces the standard 16 MB media size cap. For larger files, host them externally and send the link with POST `/rest/sendMessage/{instance_key}/sendLinkPreview` instead.

### What are the rate limits for MegaAPI?

Rate limits are not declared in the OpenAPI spec and are governed by your MegaAPI plan and by WhatsApp's own anti-spam thresholds. As an unofficial gateway the practical guidance is to keep outbound throughput conservative - bursts of broadcast traffic are the most common cause of instance bans.

### How do I send a WhatsApp text message through Jentic?

Run pip install jentic, then search Jentic for 'send a WhatsApp text message', load the schema for POST `/rest/sendMessage/{instance_key}/text`, and execute it with the instance_key, recipient phone number, and message body. Jentic injects the bearer token from your stored credentials. Run it through Jentic One, the self-hosted execution layer.

### How do I receive incoming WhatsApp messages?

Configure a webhook on your instance with POST `/rest/webhook/{instance_key}/configWebhook`, pointing at an endpoint you control. MegaAPI then POSTs every inbound message and event to that URL. You can read or update the current webhook config at any time via GET `/rest/webhook/{instance_key}.`

### Can I limit what my agent is allowed to do with the MegaAPI?

Yes. Because you run Jentic One yourself, your own rules decide which MegaAPI operations and credentials the agent may use. MegaAPI carries the instance_key in every URL path, so a rule can pin the agent to a single WhatsApp instance and let it only send messages via POST `/rest/sendMessage/{instance_key}/text` and read that instance's groups via GET `/rest/group/list/{instance_key}.` You choose the operations it may call, so instance configuration such as POST `/rest/webhook/{instance_key}/configWebhook` stays off limits unless you explicitly add it.
