/install evolution-api
\r \r
Evolution API v2.3\r
\r Complete WhatsApp automation via Evolution API v2.3. Send messages, manage groups, integrate chatbots (Typebot, OpenAI, Dify, Flowise, N8N, Evo AI), configure webhooks, and connect with Chatwoot.\r \r ---\r \r
Quick Start\r
\r
1. Set Environment Variables\r
\r
{\r
env: {\r
EVO_API_URL: "http://localhost:8080", // Your API URL\r
EVO_GLOBAL_KEY: "your-global-admin-key", // Admin key (instance mgmt)\r
EVO_INSTANCE: "my-bot", // Instance name\r
EVO_API_KEY: "your-instance-token" // Instance token (messaging)\r
}\r
}\r
```\r
\r
### 2. Create Instance & Connect\r
\r
```bash\r
# Create instance (supports Baileys, Business, or Evolution integration)\r
curl -X POST "$EVO_API_URL/instance/create" \\r
-H "apikey: $EVO_GLOBAL_KEY" \\r
-H "Content-Type: application/json" \\r
-d '{\r
"instanceName": "my-bot",\r
"qrcode": true,\r
"integration": "WHATSAPP-BAILEYS"\r
}'\r
\r
# Connect & get QR code\r
curl -X GET "$EVO_API_URL/instance/connect/$EVO_INSTANCE" \\r
-H "apikey: $EVO_API_KEY"\r
```\r
\r
Scan the QR code returned in `base64` field. Alternately pass `?number=5511999999999` for pairing code.\r
\r
### 3. Send First Message\r
\r
```bash\r
curl -X POST "$EVO_API_URL/message/sendText/$EVO_INSTANCE" \\r
-H "apikey: $EVO_API_KEY" \\r
-H "Content-Type: application/json" \\r
-d '{\r
"number": "5511999999999",\r
"text": "Hello from Evolution API v2! 🚀"\r
}'\r
```\r
\r
---\r
\r
## Authentication\r
\r
Two authentication levels:\r
\r
| Type | Header | Usage |\r
|------|--------|-------|\r
| **Global API Key** | `apikey: $EVO_GLOBAL_KEY` | Admin: create/delete instances, fetch all |\r
| **Instance API Key** | `apikey: $EVO_API_KEY` | Messaging, groups, chat, profile, labels |\r
\r
All instance endpoints use the path pattern: `/{resource}/{action}/{instanceName}`\r
\r
---\r
\r
## Core Concepts\r
\r
### Phone Number Formats\r
\r
| Context | Format | Example |\r
|---------|--------|---------|\r
| **Sending messages** | Country code + number | `5511999999999` |\r
| **Group JID** | Group ID | `[email protected]` |\r
| **User JID** | Number + suffix | `[email protected]` |\r
\r
### Integration Types\r
\r
| Value | Description |\r
|-------|-------------|\r
| `WHATSAPP-BAILEYS` | Unofficial (default, full features) |\r
| `WHATSAPP-BUSINESS` | Official Cloud API |\r
| `EVOLUTION` | Evolution channel |\r
\r
### Message Delay\r
\r
Add `delay` (milliseconds) to avoid rate limits:\r
```json\r
{ "delay": 1200 }\r
```\r
\r
---\r
\r
## Feature Reference\r
\r
### Instance Management\r
\r
#### Create Instance\r
```bash\r
POST /instance/create\r
Header: apikey: $EVO_GLOBAL_KEY\r
\r
{\r
"instanceName": "my-bot",\r
"qrcode": true,\r
"integration": "WHATSAPP-BAILEYS",\r
// Optional\r
"token": "custom-api-key",\r
"number": "5511999999999",\r
// Settings (optional)\r
"rejectCall": false,\r
"msgCall": "",\r
"groupsIgnore": false,\r
"alwaysOnline": false,\r
"readMessages": false,\r
"readStatus": false,\r
"syncFullHistory": false,\r
// Proxy (optional)\r
"proxyHost": "",\r
"proxyPort": "",\r
"proxyProtocol": "",\r
"proxyUsername": "",\r
"proxyPassword": ""\r
}\r
```\r
\r
**Inline webhook** (optional during creation):\r
```json\r
{\r
"webhook": {\r
"url": "https://webhook.site/your-id",\r
"byEvents": false,\r
"base64": true,\r
"headers": {\r
"autorization": "Bearer TOKEN"\r
},\r
"events": ["MESSAGES_UPSERT", "CONNECTION_UPDATE"]\r
}\r
}\r
```\r
\r
**Inline RabbitMQ / SQS** (optional during creation):\r
```json\r
{\r
"rabbitmq": { "enabled": true, "events": ["MESSAGES_UPSERT"] },\r
"sqs": { "enabled": true, "events": ["MESSAGES_UPSERT"] }\r
}\r
```\r
\r
**Inline Chatwoot** (optional during creation):\r
```json\r
{\r
"chatwootAccountId": "1",\r
"chatwootToken": "TOKEN",\r
"chatwootUrl": "https://chatwoot.com",\r
"chatwootSignMsg": true,\r
"chatwootReopenConversation": true,\r
"chatwootConversationPending": false,\r
"chatwootImportContacts": true,\r
"chatwootNameInbox": "evolution",\r
"chatwootMergeBrazilContacts": true,\r
"chatwootImportMessages": true,\r
"chatwootDaysLimitImportMessages": 3\r
}\r
```\r
\r
#### Fetch Instances\r
```bash\r
GET /instance/fetchInstances\r
Header: apikey: $EVO_GLOBAL_KEY\r
\r
# Optional query params:\r
# ?instanceName=my-bot\r
# ?instanceId=INSTANCE_ID\r
```\r
\r
#### Connect Instance (QR Code)\r
```bash\r
GET /instance/connect/{instance}\r
Header: apikey: $EVO_API_KEY\r
\r
# Optional: ?number=5511999999999 (for pairing code)\r
```\r
\r
#### Connection Status\r
```bash\r
GET /instance/connectionState/{instance}\r
Header: apikey: $EVO_API_KEY\r
```\r
\r
#### Restart Instance\r
```bash\r
POST /instance/restart/{instance}\r
Header: apikey: $EVO_API_KEY\r
```\r
\r
#### Set Presence\r
```bash\r
POST /instance/setPresence/{instance}\r
Header: apikey: $EVO_API_KEY\r
\r
{ "presence": "available" }\r
```\r
**Options:** `available`, `unavailable`\r
\r
#### Logout Instance\r
```bash\r
DELETE /instance/logout/{instance}\r
Header: apikey: $EVO_API_KEY\r
```\r
\r
#### Delete Instance\r
```bash\r
DELETE /instance/delete/{instance}\r
Header: apikey: $EVO_GLOBAL_KEY\r
```\r
\r
---\r
\r
### Settings\r
\r
#### Set Settings\r
```bash\r
POST /settings/set/{instance}\r
Header: apikey: $EVO_API_KEY\r
\r
{\r
"rejectCall": true,\r
"msgCall": "I do not accept calls",\r
"groupsIgnore": false,\r
"alwaysOnline": true,\r
"readMessages": false,\r
"syncFullHistory": false,\r
"readStatus": false\r
}\r
```\r
\r
#### Find Settings\r
```bash\r
GET /settings/find/{instance}\r
Header: apikey: $EVO_API_KEY\r
```\r
\r
---\r
\r
### Proxy\r
\r
#### Set Proxy\r
```bash\r
POST /proxy/set/{instance}\r
Header: apikey: $EVO_API_KEY\r
\r
{\r
"enabled": true,\r
"host": "0.0.0.0",\r
"port": "8000",\r
"protocol": "http",\r
"username": "user",\r
"password": "pass"\r
}\r
```\r
\r
#### Find Proxy\r
```bash\r
GET /proxy/find/{instance}\r
Header: apikey: $EVO_API_KEY\r
```\r
\r
---\r
\r
### Send Messages\r
\r
#### Send Text\r
```bash\r
POST /message/sendText/{instance}\r
\r
{\r
"number": "5511999999999",\r
"text": "Hello World!"\r
// Options:\r
// "delay": 1200,\r
// "linkPreview": false,\r
// "mentionsEveryOne": false,\r
// "mentioned": ["5511888888888"],\r
// "quoted": { "key": { "id": "MESSAGE_ID" }, "message": { "conversation": "quoted text" } }\r
}\r
```\r
\r
#### Send Media (URL)\r
```bash\r
POST /message/sendMedia/{instance}\r
\r
{\r
"number": "5511999999999",\r
"mediatype": "image",\r
"mimetype": "image/png",\r
"caption": "Caption text",\r
"media": "https://example.com/photo.jpg",\r
"fileName": "photo.png"\r
// Options: delay, quoted, mentionsEveryOne, mentioned\r
}\r
```\r
\r
**Media types:** `image`, `video`, `document`\r
\r
#### Send Media (File Upload)\r
```bash\r
POST /message/sendMedia/{instance}\r
Content-Type: multipart/form-data\r
\r
# Use form-data with file field\r
```\r
\r
#### Send PTV (Round Video)\r
```bash\r
POST /message/sendPtv/{instance}\r
\r
{\r
"number": "5511999999999",\r
"video": "https://example.com/video.mp4"\r
// Options: delay, quoted, mentionsEveryOne, mentioned\r
}\r
```\r
\r
Also supports file upload via form-data.\r
\r
#### Send Narrated Audio (Voice Note)\r
```bash\r
POST /message/sendWhatsAppAudio/{instance}\r
\r
{\r
"number": "5511999999999",\r
"audio": "https://example.com/audio.mp3"\r
// Options: delay, quoted, encoding (true/false)\r
}\r
```\r
\r
#### Send Status/Stories\r
```bash\r
POST /message/sendStatus/{instance}\r
\r
{\r
"type": "text",\r
"content": "My status update!",\r
"backgroundColor": "#008000",\r
"font": 1,\r
"allContacts": false,\r
"statusJidList": ["[email protected]"]\r
}\r
```\r
\r
**Types:** `text`, `image`, `video`, `audio` \r
**Fonts (text only):** `1` SERIF, `2` NORICAN_REGULAR, `3` BRYNDAN_WRITE, `4` BEBASNEUE_REGULAR, `5` OSWALD_HEAVY \r
For image/video: use `content` as URL and `caption` for text.\r
\r
#### Send Sticker\r
```bash\r
POST /message/sendSticker/{instance}\r
\r
{\r
"number": "5511999999999",\r
"sticker": "https://example.com/sticker.webp"\r
// Options: delay, quoted\r
}\r
```\r
\r
#### Send Location\r
```bash\r
POST /message/sendLocation/{instance}\r
\r
{\r
"number": "5511999999999",\r
"name": "Bora Bora",\r
"address": "French Polynesia",\r
"latitude": -16.505538,\r
"longitude": -151.742277\r
// Options: delay, quoted\r
}\r
```\r
\r
#### Send Contact (vCard)\r
```bash\r
POST /message/sendContact/{instance}\r
\r
{\r
"number": "5511999999999",\r
"contact": [\r
{\r
"fullName": "Contact Name",\r
"wuid": "559999999999",\r
"phoneNumber": "+55 99 9 9999-9999",\r
"organization": "Company",\r
"email": "[email protected]",\r
"url": "https://example.com"\r
}\r
]\r
}\r
```\r
\r
Multiple contacts can be sent in the array.\r
\r
#### Send Reaction\r
```bash\r
POST /message/sendReaction/{instance}\r
\r
{\r
"key": {\r
"remoteJid": "[email protected]",\r
"fromMe": true,\r
"id": "BAE5A75CB0F39712"\r
},\r
"reaction": "🚀"\r
}\r
```\r
\r
Set `reaction: ""` to remove.\r
\r
#### Send Poll\r
```bash\r
POST /message/sendPoll/{instance}\r
\r
{\r
"number": "5511999999999",\r
"name": "What is your favorite color?",\r
"selectableCount": 1,\r
"values": ["Red", "Blue", "Green"]\r
// Options: delay, quoted\r
}\r
```\r
\r
#### Send List\r
```bash\r
POST /message/sendList/{instance}\r
\r
{\r
"number": "5511999999999",\r
"title": "List Title",\r
"description": "Choose an option",\r
"buttonText": "Click Here",\r
"footerText": "Footer text",\r
"sections": [\r
{\r
"title": "Section 1",\r
"rows": [\r
{\r
"title": "Option A",\r
"description": "Description of option A",\r
"rowId": "opt_a"\r
},\r
{\r
"title": "Option B",\r
"description": "Description of option B",\r
"rowId": "opt_b"\r
}\r
]\r
}\r
]\r
// Options: delay, quoted\r
}\r
```\r
\r
#### Send Buttons\r
```bash\r
POST /message/sendButtons/{instance}\r
\r
{\r
"number": "5511999999999",\r
"title": "Button Title",\r
"description": "Button Description",\r
"footer": "Footer Text",\r
"buttons": [\r
{ "type": "reply", "displayText": "Reply", "id": "btn_1" },\r
{ "type": "copy", "displayText": "Copy Code", "copyCode": "ABC123" },\r
{ "type": "url", "displayText": "Open Link", "url": "https://example.com" },\r
{ "type": "call", "displayText": "Call Us", "phoneNumber": "5511999999999" },\r
{ "type": "pix", "currency": "BRL", "name": "John Doe", "keyType": "random", "key": "uuid-key" }\r
]\r
// Options: delay, quoted\r
}\r
```\r
\r
**Button types:** `reply`, `copy`, `url`, `call`, `pix` \r
**Pix keyType:** `phone`, `email`, `cpf`, `cnpj`, `random`\r
\r
---\r
\r
### Chat Operations\r
\r
#### Check WhatsApp Numbers\r
```bash\r
POST /chat/whatsappNumbers/{instance}\r
\r
{\r
"numbers": [\r
"55911111111",\r
"55922222222",\r
"55933333333"\r
]\r
}\r
```\r
\r
#### Read Messages (Mark as Read)\r
```bash\r
POST /chat/markMessageAsRead/{instance}\r
\r
{\r
"readMessages": [\r
{\r
"remoteJid": "[email protected]",\r
"fromMe": false,\r
"id": "MESSAGE_ID"\r
}\r
]\r
}\r
```\r
\r
#### Archive Chat\r
```bash\r
POST /chat/archiveChat/{instance}\r
\r
{\r
"lastMessage": {\r
"key": {\r
"remoteJid": "[email protected]",\r
"fromMe": false,\r
"id": "MESSAGE_ID"\r
}\r
},\r
"chat": "[email protected]",\r
"archive": true\r
}\r
```\r
\r
Set `archive: false` to unarchive.\r
\r
#### Mark Chat Unread\r
```bash\r
POST /chat/markChatUnread/{instance}\r
\r
{\r
"lastMessage": {\r
"key": {\r
"remoteJid": "[email protected]",\r
"fromMe": false,\r
"id": "MESSAGE_ID"\r
}\r
},\r
"chat": "[email protected]"\r
}\r
```\r
\r
#### Delete Message\r
```bash\r
DELETE /chat/deleteMessageForEveryone/{instance}\r
\r
{\r
"id": "MESSAGE_ID",\r
"remoteJid": "[email protected]",\r
"fromMe": true,\r
"participant": "participant_jid"\r
}\r
```\r
\r
#### Update Message (Edit)\r
```bash\r
POST /chat/updateMessage/{instance}\r
\r
{\r
"number": "5511999999999",\r
"key": {\r
"remoteJid": "[email protected]",\r
"fromMe": true,\r
"id": "MESSAGE_ID"\r
},\r
"text": "new edited message"\r
}\r
```\r
\r
#### Send Presence (Typing Indicator)\r
```bash\r
POST /chat/sendPresence/{instance}\r
\r
{\r
"number": "5511999999999",\r
"delay": 1200,\r
"presence": "composing"\r
}\r
```\r
\r
**Options:** `composing`, `recording`, `paused`\r
\r
#### Update Block Status\r
```bash\r
POST /message/updateBlockStatus/{instance}\r
\r
{\r
"number": "5511999999999",\r
"status": "block"\r
}\r
```\r
\r
**Options:** `block`, `unblock`\r
\r
#### Fetch Profile Picture\r
```bash\r
POST /chat/fetchProfilePictureUrl/{instance}\r
\r
{ "number": "5511999999999" }\r
```\r
\r
#### Get Base64 From Media Message\r
```bash\r
POST /chat/getBase64FromMediaMessage/{instance}\r
\r
{\r
"message": {\r
"key": { "id": "MESSAGE_ID" }\r
},\r
"convertToMp4": false\r
}\r
```\r
\r
Extracts base64 from received media. Set `convertToMp4: true` for audio files to get MP4 instead of OGG.\r
\r
#### Find Contacts\r
```bash\r
POST /chat/findContacts/{instance}\r
\r
{\r
"where": {\r
"id": "5511999999999"\r
}\r
}\r
```\r
\r
Omit `id` to list all contacts.\r
\r
#### Find Messages\r
```bash\r
POST /chat/findMessages/{instance}\r
\r
{\r
"where": {\r
"key": {\r
"remoteJid": "5511999999999"\r
}\r
},\r
"page": 1,\r
"offset": 10\r
}\r
```\r
\r
#### Find Status Message\r
```bash\r
POST /chat/findStatusMessage/{instance}\r
\r
{\r
"where": {\r
"remoteJid": "[email protected]",\r
"id": "MESSAGE_ID"\r
},\r
"page": 1,\r
"offset": 10\r
}\r
```\r
\r
#### Find Chats\r
```bash\r
POST /chat/findChats/{instance}\r
```\r
\r
---\r
\r
### Calls\r
\r
#### Fake Call (Offer)\r
```bash\r
POST /call/offer/{instance}\r
\r
{\r
"number": "5511999999999",\r
"isVideo": false,\r
"callDuration": 3\r
}\r
```\r
\r
Simulates a call offer to the number. `callDuration` is in seconds.\r
\r
---\r
\r
### Labels\r
\r
#### Find Labels\r
```bash\r
GET /label/findLabels/{instance}\r
```\r
\r
#### Handle Labels (Add/Remove)\r
```bash\r
POST /label/handleLabel/{instance}\r
\r
{\r
"number": "5511999999999",\r
"labelId": "label_id_here",\r
"action": "add"\r
}\r
```\r
\r
**Actions:** `add`, `remove`\r
\r
---\r
\r
### Profile Settings\r
\r
#### Fetch Business Profile\r
```bash\r
POST /chat/fetchBusinessProfile/{instance}\r
\r
{ "number": "5511999999999" }\r
```\r
\r
#### Fetch Profile\r
```bash\r
POST /chat/fetchProfile/{instance}\r
\r
{ "number": "5511999999999" }\r
```\r
\r
#### Update Profile Name\r
```bash\r
POST /chat/updateProfileName/{instance}\r
\r
{ "name": "My Bot Name" }\r
```\r
\r
#### Update Profile Status\r
```bash\r
POST /chat/updateProfileStatus/{instance}\r
\r
{ "status": "Available 24/7" }\r
```\r
\r
#### Update Profile Picture\r
```bash\r
POST /chat/updateProfilePicture/{instance}\r
\r
{ "picture": "https://example.com/avatar.jpg" }\r
```\r
\r
#### Remove Profile Picture\r
```bash\r
DELETE /chat/removeProfilePicture/{instance}\r
```\r
\r
#### Fetch Privacy Settings\r
```bash\r
GET /chat/fetchPrivacySettings/{instance}\r
```\r
\r
#### Update Privacy Settings\r
```bash\r
POST /chat/updatePrivacySettings/{instance}\r
\r
{\r
"readreceipts": "all",\r
"profile": "all",\r
"status": "contacts",\r
"online": "all",\r
"last": "contacts",\r
"groupadd": "none"\r
}\r
```\r
\r
**Privacy values:**\r
- `readreceipts`: `all`, `none`\r
- `profile`: `all`, `contacts`, `contact_blacklist`, `none`\r
- `status`: `all`, `contacts`, `contact_blacklist`, `none`\r
- `online`: `all`, `match_last_seen`\r
- `last`: `all`, `contacts`, `contact_blacklist`, `none`\r
- `groupadd`: `all`, `contacts`, `contact_blacklist`\r
\r
---\r
\r
### Group Management\r
\r
#### Create Group\r
```bash\r
POST /group/create/{instance}\r
\r
{\r
"subject": "Group Name",\r
"description": "Group description (optional)",\r
"participants": [\r
"5531900000000",\r
"5531900000000"\r
]\r
}\r
```\r
\r
#### Update Group Picture\r
```bash\r
POST /group/updateGroupPicture/{instance}?groupJid={groupJid}\r
\r
{ "image": "https://example.com/group-photo.png" }\r
```\r
\r
#### Update Group Subject (Name)\r
```bash\r
POST /group/updateGroupSubject/{instance}?groupJid={groupJid}\r
\r
{ "subject": "New Group Name" }\r
```\r
\r
#### Update Group Description\r
```bash\r
POST /group/updateGroupDescription/{instance}?groupJid={groupJid}\r
\r
{ "description": "New group description" }\r
```\r
\r
#### Fetch Invite Code\r
```bash\r
GET /group/inviteCode/{instance}?groupJid={groupJid}\r
```\r
\r
#### Revoke Invite Code\r
```bash\r
POST /group/revokeInviteCode/{instance}?groupJid={groupJid}\r
```\r
\r
#### Send Invite URL\r
```bash\r
POST /group/sendInvite/{instance}\r
\r
{\r
"groupJid": "[email protected]",\r
"description": "Join my WhatsApp group:",\r
"numbers": ["5511999999999"]\r
}\r
```\r
\r
#### Find Group by Invite Code\r
```bash\r
GET /group/inviteInfo/{instance}?inviteCode={inviteCode}\r
```\r
\r
#### Find Group by JID\r
```bash\r
GET /group/findGroupInfos/{instance}?groupJid={groupJid}\r
```\r
\r
#### Fetch All Groups\r
```bash\r
GET /group/fetchAllGroups/{instance}\r
# Optional: ?getParticipants=true\r
```\r
\r
#### Find Participants\r
```bash\r
GET /group/participants/{instance}?groupJid={groupJid}\r
```\r
\r
#### Update Participants\r
```bash\r
POST /group/updateParticipant/{instance}?groupJid={groupJid}\r
\r
{\r
"action": "add",\r
"participants": ["5511999999999"]\r
}\r
```\r
\r
**Actions:** `add`, `remove`, `promote`, `demote`\r
\r
#### Update Group Settings\r
```bash\r
POST /group/updateSetting/{instance}?groupJid={groupJid}\r
\r
{ "action": "announcement" }\r
```\r
\r
**Actions:** \r
- `announcement` - Only admins send messages \r
- `not_announcement` - Everyone can send \r
- `locked` - Only admins edit group info \r
- `unlocked` - Everyone can edit group info\r
\r
#### Toggle Ephemeral (Disappearing Messages)\r
```bash\r
POST /group/toggleEphemeral/{instance}?groupJid={groupJid}\r
\r
{ "expiration": 86400 }\r
```\r
\r
**Expiration values (seconds):** \r
- `0` - Off \r
- `86400` - 24 hours \r
- `604800` - 7 days \r
- `7776000` - 90 days\r
\r
#### Leave Group\r
```bash\r
DELETE /group/leaveGroup/{instance}?groupJid={groupJid}\r
```\r
\r
---\r
\r
### Integrations - Events\r
\r
#### Webhook\r
```bash\r
# Set Webhook\r
POST /webhook/set/{instance}\r
\r
{\r
"webhook": {\r
"enabled": true,\r
"url": "https://webhook.site/your-id",\r
"headers": {\r
"autorization": "Bearer TOKEN",\r
"Content-Type": "application/json"\r
},\r
"byEvents": false,\r
"base64": false,\r
"events": [\r
"APPLICATION_STARTUP",\r
"QRCODE_UPDATED",\r
"MESSAGES_UPSERT",\r
"MESSAGES_UPDATE",\r
"MESSAGES_DELETE",\r
"SEND_MESSAGE",\r
"CONTACTS_UPDATE",\r
"PRESENCE_UPDATE",\r
"CHATS_UPDATE",\r
"CHATS_DELETE",\r
"GROUPS_UPSERT",\r
"GROUP_UPDATE",\r
"GROUP_PARTICIPANTS_UPDATE",\r
"CONNECTION_UPDATE",\r
"LABELS_EDIT",\r
"LABELS_ASSOCIATION",\r
"CALL",\r
"TYPEBOT_START",\r
"TYPEBOT_CHANGE_STATUS"\r
]\r
}\r
}\r
\r
# Find Webhook\r
GET /webhook/find/{instance}\r
```\r
\r
**Key options:**\r
- `byEvents` - If `true`, sends to separate URLs per event type\r
- `base64` - If `true`, media comes as base64 in payload\r
\r
#### WebSocket\r
```bash\r
POST /websocket/set/{instance}\r
\r
{\r
"websocket": {\r
"enabled": true,\r
"events": ["MESSAGES_UPSERT", "CONNECTION_UPDATE"]\r
}\r
}\r
\r
GET /websocket/find/{instance}\r
```\r
\r
#### RabbitMQ\r
```bash\r
POST /rabbitmq/set/{instance}\r
\r
{\r
"rabbitmq": {\r
"enabled": true,\r
"events": ["MESSAGES_UPSERT", "CONNECTION_UPDATE"]\r
}\r
}\r
\r
GET /rabbitmq/find/{instance}\r
```\r
\r
#### SQS (Amazon)\r
```bash\r
POST /sqs/set/{instance}\r
\r
{\r
"sqs": {\r
"enabled": true,\r
"events": ["MESSAGES_UPSERT", "CONNECTION_UPDATE"]\r
}\r
}\r
\r
GET /sqs/find/{instance}\r
```\r
\r
#### NATS\r
```bash\r
POST /nats/set/{instance}\r
GET /nats/find/{instance}\r
```\r
Same payload structure as SQS/RabbitMQ.\r
\r
#### Pusher\r
```bash\r
POST /pusher/set/{instance}\r
GET /pusher/find/{instance}\r
```\r
Same payload structure as SQS/RabbitMQ.\r
\r
**Available Events (all transports):**\r
`APPLICATION_STARTUP`, `QRCODE_UPDATED`, `MESSAGES_SET`, `MESSAGES_UPSERT`, `MESSAGES_UPDATE`, `MESSAGES_DELETE`, `SEND_MESSAGE`, `CONTACTS_SET`, `CONTACTS_UPSERT`, `CONTACTS_UPDATE`, `PRESENCE_UPDATE`, `CHATS_SET`, `CHATS_UPSERT`, `CHATS_UPDATE`, `CHATS_DELETE`, `GROUPS_UPSERT`, `GROUP_UPDATE`, `GROUP_PARTICIPANTS_UPDATE`, `CONNECTION_UPDATE`, `LABELS_EDIT`, `LABELS_ASSOCIATION`, `CALL`, `TYPEBOT_START`, `TYPEBOT_CHANGE_STATUS`\r
\r
---\r
\r
### Integrations - Chatbots\r
\r
All chatbot integrations share a common pattern with settings, session management, CRUD, and trigger configuration.\r
\r
**Common trigger options (all chatbots):**\r
```json\r
{\r
"triggerType": "keyword",\r
"triggerOperator": "equals",\r
"triggerValue": "hello",\r
"expire": 20,\r
"keywordFinish": "#SAIR",\r
"delayMessage": 1000,\r
"unknownMessage": "Message not recognized",\r
"listeningFromMe": false,\r
"stopBotFromMe": false,\r
"keepOpen": false,\r
"debounceTime": 10,\r
"ignoreJids": []\r
}\r
```\r
\r
| Field | Description |\r
|-------|-------------|\r
| `triggerType` | `all` (every message) or `keyword` (matched) |\r
| `triggerOperator` | `contains`, `equals`, `startsWith`, `endsWith`, `regex`, `none` |\r
| `triggerValue` | The keyword/pattern to match |\r
| `expire` | Session timeout (minutes) |\r
| `keywordFinish` | Keyword to end bot session |\r
| `delayMessage` | Delay between messages (ms) |\r
| `unknownMessage` | Response for unrecognized input |\r
| `listeningFromMe` | Process messages sent by you |\r
| `stopBotFromMe` | Pause bot when you send a message |\r
| `keepOpen` | Keep session alive after flow ends |\r
| `debounceTime` | Debounce interval (seconds) |\r
| `ignoreJids` | JIDs to ignore (e.g., `["@g.us"]` to ignore groups) |\r
\r
#### Chatwoot\r
```bash\r
# Set Chatwoot\r
POST /chatwoot/set/{instance}\r
\r
{\r
"enabled": true,\r
"accountId": "1",\r
"token": "CHATWOOT_TOKEN",\r
"url": "https://chatwoot.yourdomain.com",\r
"signMsg": true,\r
"reopenConversation": true,\r
"conversationPending": false,\r
"nameInbox": "evolution",\r
"mergeBrazilContacts": true,\r
"importContacts": true,\r
"importMessages": true,\r
"daysLimitImportMessages": 2,\r
"signDelimiter": "\
",\r
"autoCreate": true,\r
"organization": "BOT",\r
"logo": "https://example.com/logo.png",\r
"ignoreJids": ["@g.us"]\r
}\r
\r
# Find Chatwoot\r
GET /chatwoot/find/{instance}\r
```\r
\r
#### Typebot\r
```bash\r
# Create Typebot\r
POST /typebot/create/{instance}\r
\r
{\r
"enabled": true,\r
"url": "https://typebot.yourdomain.com",\r
"typebot": "my-typebot-flow-id",\r
"triggerType": "keyword",\r
"triggerOperator": "regex",\r
"triggerValue": "^atend.*",\r
"expire": 20,\r
"keywordFinish": "#SAIR",\r
"delayMessage": 1000,\r
"unknownMessage": "Message not recognized",\r
"listeningFromMe": false,\r
"stopBotFromMe": false,\r
"keepOpen": false,\r
"debounceTime": 10\r
}\r
\r
# Find/Fetch/Update/Delete\r
GET /typebot/find/{instance}\r
GET /typebot/fetch/{typebotId}/{instance}\r
PUT /typebot/update/{typebotId}/{instance}\r
DELETE /typebot/delete/{typebotId}/{instance}\r
\r
# Start Typebot manually\r
POST /typebot/start/{instance}\r
\r
{\r
"url": "https://typebot.yourdomain.com",\r
"typebot": "flow-id",\r
"remoteJid": "[email protected]",\r
"startSession": false,\r
"variables": [\r
{ "name": "pushName", "value": "User Name" }\r
]\r
}\r
\r
# Change session status\r
POST /typebot/changeStatus/{instance}\r
{ "remoteJid": "[email protected]", "status": "closed" }\r
\r
# Fetch sessions\r
GET /typebot/fetchSessions/{typebotId}/{instance}\r
\r
# Default settings\r
POST /typebot/settings/{instance}\r
GET /typebot/fetchSettings/{instance}\r
\r
{\r
"expire": 20,\r
"keywordFinish": "#SAIR",\r
"delayMessage": 1000,\r
"unknownMessage": "Not recognized",\r
"listeningFromMe": false,\r
"stopBotFromMe": false,\r
"keepOpen": false,\r
"debounceTime": 10,\r
"ignoreJids": [],\r
"typebotIdFallback": "fallback-typebot-id"\r
}\r
```\r
\r
**Session statuses:** `opened`, `paused`, `closed`\r
\r
#### OpenAI\r
```bash\r
# Set Credentials\r
POST /openai/creds/{instance}\r
{ "name": "apikey", "apiKey": "sk-proj-..." }\r
\r
GET /openai/creds/{instance}\r
DELETE /openai/creds/{openaiCredsId}/{instance}\r
\r
# Create Bot (Assistant or Chat Completion)\r
POST /openai/create/{instance}\r
\r
{\r
"enabled": true,\r
"openaiCredsId": "creds-id",\r
"botType": "assistant",\r
// For assistants:\r
"assistantId": "asst_XXXXX",\r
"functionUrl": "https://n8n.site.com",\r
// For chatCompletion:\r
"model": "gpt-4o",\r
"systemMessages": ["You are a helpful assistant."],\r
"assistantMessages": ["Hello, how can I help?"],\r
"userMessages": ["Hello!"],\r
"maxTokens": 300,\r
// Trigger options...\r
"triggerType": "keyword",\r
"triggerOperator": "equals",\r
"triggerValue": "ai"\r
}\r
\r
# Find/Fetch/Update/Delete\r
GET /openai/find/{instance}\r
GET /openai/fetch/{openaiBotId}/{instance}\r
PUT /openai/update/{openaiBotId}/{instance}\r
DELETE /openai/delete/{openaiBotId}/{instance}\r
\r
# Session management\r
POST /openai/changeStatus/{instance}\r
GET /openai/fetchSessions/{openaiBotId}/{instance}\r
\r
# Default settings\r
POST /openai/settings/{instance}\r
GET /openai/fetchSettings/{instance}\r
```\r
\r
**Bot types:** `assistant`, `chatCompletion`\r
\r
#### Dify\r
```bash\r
POST /dify/create/{instance}\r
\r
{\r
"enabled": true,\r
"botType": "chatBot",\r
"apiUrl": "http://dify.site.com/v1",\r
"apiKey": "app-123456",\r
// Trigger options...\r
}\r
\r
GET /dify/find/{instance}\r
GET /dify/fetch/{difyId}/{instance}\r
PUT /dify/update/{difyId}/{instance}\r
DELETE /dify/delete/{difyId}/{instance}\r
\r
POST /dify/changeStatus/{instance}\r
GET /dify/fetchSessions/{difyId}/{instance}\r
\r
POST /dify/settings/{instance}\r
GET /dify/fetchSettings/{instance}\r
```\r
\r
**Dify bot types:** `chatBot`, `textGenerator`, `agent`, `workflow`\r
\r
#### Flowise\r
```bash\r
POST /flowise/create/{instance}\r
\r
{\r
"enabled": true,\r
"apiUrl": "http://flowise.site.com/v1",\r
"apiKey": "app-123456",\r
// Trigger options...\r
}\r
\r
GET /flowise/find/{instance}\r
GET /flowise/fetch/{flowiseId}/{instance}\r
PUT /flowise/update/{flowiseId}/{instance}\r
DELETE /flowise/delete/{flowiseId}/{instance}\r
\r
POST /flowise/changeStatus/{instance}\r
GET /flowise/fetchSessions/{flowiseId}/{instance}\r
\r
POST /flowise/settings/{instance}\r
GET /flowise/fetchSettings/{instance}\r
```\r
\r
#### N8N\r
```bash\r
POST /n8n/create/{instance}\r
\r
{\r
"enabled": true,\r
"apiUrl": "http://n8n.site.com/v1",\r
"apiKey": "app-123456",\r
// Trigger options...\r
}\r
\r
GET /n8n/find/{instance}\r
GET /n8n/fetch/{n8nId}/{instance}\r
PUT /n8n/update/{n8nId}/{instance}\r
DELETE /n8n/delete/{n8nId}/{instance}\r
\r
POST /n8n/changeStatus/{instance}\r
GET /n8n/fetchSessions/{n8nId}/{instance}\r
\r
POST /n8n/settings/{instance}\r
GET /n8n/fetchSettings/{instance}\r
```\r
\r
#### Evolution Bot\r
```bash\r
POST /evolutionBot/create/{instance}\r
\r
{\r
"enabled": true,\r
"apiUrl": "http://api.site.com/v1",\r
"apiKey": "app-123456",\r
// Trigger options...\r
}\r
\r
GET /evolutionBot/find/{instance}\r
GET /evolutionBot/fetch/{evolutionBotId}/{instance}\r
PUT /evolutionBot/update/{evolutionBotId}/{instance}\r
DELETE /evolutionBot/delete/{evolutionBotId}/{instance}\r
\r
POST /evolutionBot/changeStatus/{instance}\r
GET /evolutionBot/fetchSessions/{evolutionBotId}/{instance}\r
\r
POST /evolutionBot/settings/{instance}\r
GET /evolutionBot/fetchSettings/{instance}\r
```\r
\r
#### Evo AI\r
```bash\r
POST /evoai/create/{instance}\r
\r
{\r
"enabled": true,\r
"apiUrl": "http://evoai.site.com/v1",\r
"apiKey": "app-123456",\r
// Trigger options...\r
}\r
\r
GET /evoai/find/{instance}\r
GET /evoai/fetch/{evoaiId}/{instance}\r
PUT /evoai/update/{evoaiId}/{instance}\r
DELETE /evoai/delete/{evoaiId}/{instance}\r
\r
POST /evoai/changeStatus/{instance}\r
GET /evoai/fetchSessions/{evoaiId}/{instance}\r
\r
POST /evoai/settings/{instance}\r
GET /evoai/fetchSettings/{instance}\r
```\r
\r
---\r
\r
### Integrations - Channel (WhatsApp Business Cloud API)\r
\r
#### Send Template\r
```bash\r
POST /message/sendTemplate/{instance}\r
\r
{\r
"number": "5511999999999",\r
"name": "hello_world",\r
"language": "en_US",\r
"components": [\r
{\r
"type": "body",\r
"parameters": [\r
{ "type": "text", "text": "John" },\r
{ "type": "text", "text": "[email protected]" }\r
]\r
},\r
{\r
"type": "button",\r
"sub_type": "URL",\r
"index": "1",\r
"parameters": [\r
{ "type": "text", "text": "/reset-password/1234" }\r
]\r
}\r
]\r
}\r
```\r
\r
#### Create Template\r
```bash\r
POST /template/create/{instance}\r
\r
{\r
"name": "my_template",\r
"category": "MARKETING",\r
"allowCategoryChange": false,\r
"language": "en_US",\r
"components": [\r
{\r
"type": "BODY",\r
"text": "Thank you {{1}}! Confirmation: {{2}}",\r
"example": {\r
"body_text": [["John", "860198-230332"]]\r
}\r
},\r
{\r
"type": "BUTTONS",\r
"buttons": [\r
{ "type": "QUICK_REPLY", "text": "Unsubscribe" },\r
{ "type": "URL", "text": "Support", "url": "https://example.com" }\r
]\r
}\r
]\r
}\r
```\r
\r
**Categories:** `AUTHENTICATION`, `MARKETING`, `UTILITY`\r
\r
#### Find Templates\r
```bash\r
GET /template/find/{instance}\r
```\r
\r
#### Evolution Channel Webhook\r
```bash\r
POST /webhook/evolution\r
\r
{\r
"numberId": "5511999999999",\r
"key": {\r
"remoteJid": "5511888888888",\r
"fromMe": false,\r
"id": "ABC1234"\r
},\r
"pushName": "Contact Name",\r
"message": {\r
"conversation": "Hello"\r
},\r
"messageType": "conversation"\r
}\r
```\r
\r
**Message types:** `conversation`, `imageMessage`, `videoMessage`, `documentMessage`, `audioMessage`\r
\r
---\r
\r
### Storage (S3/MinIO)\r
\r
#### Get Media\r
```bash\r
POST /s3/getMedia/{instance}\r
\r
{\r
"id": "media-id",\r
"type": "image",\r
"messageId": "MESSAGE_ID"\r
}\r
```\r
\r
#### Get Media URL\r
```bash\r
POST /s3/getMediaUrl/{instance}\r
\r
{\r
"id": "media-id"\r
}\r
```\r
\r
---\r
\r
### System\r
\r
#### Get API Information\r
```bash\r
GET /\r
```\r
\r
Returns API version and system info.\r
\r
#### Metrics\r
```bash\r
GET /metrics\r
Authorization: Basic (METRICS_USER:password)\r
```\r
\r
---\r
\r
## Common Workflows\r
\r
### Broadcast Message\r
```bash\r
for number in 5511999999999 5511888888888 5511777777777; do\r
curl -X POST "$EVO_API_URL/message/sendText/$EVO_INSTANCE" \\r
-H "apikey: $EVO_API_KEY" \\r
-H "Content-Type: application/json" \\r
-d "{\r
\"number\": \"$number\",\r
\"text\": \"Broadcast message!\",\r
\"delay\": 2000\r
}"\r
done\r
```\r
\r
### Auto-Create Group + Configure Bot\r
```bash\r
# 1. Create group\r
curl -X POST "$EVO_API_URL/group/create/$EVO_INSTANCE" \\r
-H "apikey: $EVO_API_KEY" \\r
-H "Content-Type: application/json" \\r
-d '{\r
"subject": "Support Group",\r
"participants": ["5511999999999"]\r
}'\r
\r
# 2. Attach Typebot for auto-response\r
curl -X POST "$EVO_API_URL/typebot/create/$EVO_INSTANCE" \\r
-H "apikey: $EVO_API_KEY" \\r
-H "Content-Type: application/json" \\r
-d '{\r
"enabled": true,\r
"url": "https://typebot.yourdomain.com",\r
"typebot": "support-flow-id",\r
"triggerType": "all"\r
}'\r
```\r
\r
### Full Instance Setup (Instance + Webhook + Chatwoot)\r
```bash\r
# 1. Create instance with webhook inline\r
curl -X POST "$EVO_API_URL/instance/create" \\r
-H "apikey: $EVO_GLOBAL_KEY" \\r
-H "Content-Type: application/json" \\r
-d '{\r
"instanceName": "support-bot",\r
"qrcode": true,\r
"integration": "WHATSAPP-BAILEYS",\r
"webhook": {\r
"url": "https://n8n.yourdomain.com/webhook/evo",\r
"byEvents": false,\r
"base64": false,\r
"events": ["MESSAGES_UPSERT", "CONNECTION_UPDATE"]\r
}\r
}'\r
\r
# 2. Connect\r
curl -X GET "$EVO_API_URL/instance/connect/support-bot" \\r
-H "apikey: $EVO_API_KEY"\r
\r
# 3. Configure Chatwoot\r
curl -X POST "$EVO_API_URL/chatwoot/set/support-bot" \\r
-H "apikey: $EVO_API_KEY" \\r
-H "Content-Type: application/json" \\r
-d '{\r
"enabled": true,\r
"accountId": "1",\r
"token": "CHATWOOT_TOKEN",\r
"url": "https://chatwoot.yourdomain.com",\r
"signMsg": true,\r
"importContacts": true,\r
"importMessages": true,\r
"autoCreate": true,\r
"nameInbox": "support-bot"\r
}'\r
```\r
\r
### Check Numbers Before Sending\r
```bash\r
# 1. Validate numbers\r
curl -X POST "$EVO_API_URL/chat/whatsappNumbers/$EVO_INSTANCE" \\r
-H "apikey: $EVO_API_KEY" \\r
-H "Content-Type: application/json" \\r
-d '{ "numbers": ["5511999999999", "5511888888888"] }'\r
\r
# 2. Send only to valid numbers\r
```\r
\r
---\r
\r
## Rate Limits & Best Practices\r
\r
### Delays\r
Always add delays between messages:\r
```json\r
{ "delay": 1200 }\r
```\r
\r
**Recommended:**\r
- 1-2 seconds between individual messages\r
- 3-5 seconds between mass sends\r
- Exponential backoff on errors\r
\r
### Error Handling\r
\r
| Status | Meaning |\r
|--------|---------|\r
| `200` | Success |\r
| `400` | Bad request (check body/params) |\r
| `401` | Unauthorized (check API key) |\r
| `404` | Not found (instance/resource) |\r
| `500` | Server error |\r
\r
### Common Issues\r
\r
| Error | Solution |\r
|-------|----------|\r
| Instance not connected | Run `GET /instance/connect/{instance}` |\r
| Invalid phone format | Use country code without `+`: `5511999999999` |\r
| Message not sent | Check `GET /instance/connectionState/{instance}` |\r
| Group operation failed | Verify you're admin |\r
| Media extraction fails | Ensure MongoDB/file storage is enabled |\r
| Chatwoot not syncing | Check token and URL, verify `importMessages` is true |\r
\r
---\r
\r
## Troubleshooting\r
\r
### Instance Won't Connect\r
```bash\r
# 1. Check instances\r
GET /instance/fetchInstances\r
\r
# 2. Restart instance\r
POST /instance/restart/{instance}\r
\r
# 3. Reconnect\r
GET /instance/connect/{instance}\r
```\r
\r
### Chatbot Not Responding\r
1. Check bot is enabled: `GET /{botType}/find/{instance}`\r
2. Check trigger matches incoming message\r
3. Check session status: `GET /{botType}/fetchSessions/{botId}/{instance}`\r
4. Reset session: `POST /{botType}/changeStatus/{instance}` with `status: "closed"`\r
\r
### Messages Not Being Delivered\r
1. Verify connection: `GET /instance/connectionState/{instance}`\r
2. Check phone format (no `+`, no spaces)\r
3. Verify recipient has WhatsApp: `POST /chat/whatsappNumbers/{instance}`\r
4. Check webhook for delivery status events\r
\r
---\r
\r
## v2 vs v3 (Evolution Go) Differences\r
\r
| Feature | v2.3 | v3 (Go) |\r
|---------|------|---------|\r
| **Language** | Node.js/TypeScript | Go |\r
| **Endpoints** | `/message/sendText/{instance}` | `/send/text` |\r
| **Chatbot integrations** | 7 (Typebot, OpenAI, Dify, Flowise, N8N, EvolutionBot, EvoAI) | Fewer built-in |\r
| **Chatwoot** | Native integration | Separate |\r
| **Event transports** | 6 (Webhook, WS, RabbitMQ, SQS, NATS, Pusher) | Fewer |\r
| **Lists/Buttons** | Supported | Deprecated |\r
| **PTV (Round Video)** | Supported | Supported |\r
| **Status/Stories** | Supported | Supported |\r
| **Templates** | Business Cloud API | Business Cloud API |\r
| **S3 Storage** | Built-in | Separate |\r
\r
---\r
\r
## Resources\r
\r
- **Evolution API:** https://github.com/EvolutionAPI/evolution-api\r
- **Documentation:** https://doc.evolution-api.com\r
- **Chatwoot:** https://www.chatwoot.com\r
- **Typebot:** https://typebot.io\r
- **WhatsApp Business API:** https://developers.facebook.com/docs/whatsapp\r
\r
---\r
\r
## Tips\r
\r
1. **Always check connection** before operations\r
2. **Use delays** to avoid rate limits (1.2s+ between messages)\r
3. **Store keys** in environment variables, never hardcode\r
4. **Handle disconnects** with webhook `CONNECTION_UPDATE` event\r
5. **Validate numbers** with `whatsappNumbers` before bulk sends\r
6. **Use `debounceTime`** in chatbots to group fast messages\r
7. **Set `ignoreJids: ["@g.us"]`** in chatbots to ignore group messages\r
8. **Test triggers** with `triggerType: "keyword"` before switching to `"all"`\r
9. **Monitor sessions** - expired sessions stop chatbot responses\r
10. **Use Chatwoot** for human handoff from chatbot flows\r
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install evolution-api - After installation, invoke the skill by name or use
/evolution-api - Provide required inputs per the skill's parameter spec and get structured output
What is Evolution Api v2?
Complete WhatsApp automation via Evolution API v2.3 - instances, messages (text/media/polls/lists/buttons/status), groups, labels, chatbots (Typebot/OpenAI/Dify/Flowise/N8N/EvoAI), webhooks, proxy, S3 storage, and Chatwoot integration. It is an AI Agent Skill for Claude Code / OpenClaw, with 981 downloads so far.
How do I install Evolution Api v2?
Run "/install evolution-api" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Evolution Api v2 free?
Yes, Evolution Api v2 is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Evolution Api v2 support?
Evolution Api v2 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Evolution Api v2?
It is built and maintained by impa365 (@impa365); the current version is v2.3.0.