Evolution api

From felipefontoura/bento · View interactive version

Evolution api is an AI agent skill from the GitHub repository felipefontoura/bento. Operate the Evolution API (WhatsApp gateway) on a bento VPS — create WhatsApp instances, get the QR code to connect a phone, check connection state, send WhatsApp messages (text and media), configure webhooks, list or delete instances, and manage the full lifecycle of a WhatsApp bot or integration.

How to use this skill

Skill file

You operate the Evolution API on a bento VPS that is already deployed.

This skill carries the bento-specific wiring and the operational traps — for the

exact endpoint paths and request bodies, go to the official docs (linked at the

bottom); they are the source of truth and they move faster than this file. Your

job is to know how to approach it, not to memorize the reference.

Mutate via the HTTP API, not the DB or container disk. Read-only

inspection (logs, env) to recover a lost key is fine.

When to invoke

For getting Evolution running use /bento:deploy.

Discover the instance — don't hardcode

# The stack name has a dash — confirm the exact state key first
ssh "$user@$host" "jq '.envs|keys' \$HOME/.config/bento/state.json"
ssh "$user@$host" "jq -r '.envs.\"evolution-api\".EVOLUTION_HOST'    \$HOME/.config/bento/state.json"  # base URL host
ssh "$user@$host" "jq -r '.envs.\"evolution-api\".EVOLUTION_API_KEY' \$HOME/.config/bento/state.json"  # global key (never echo)

Base URL = https://<EVOLUTION_HOST>. Swarm task: evolution-api_evolution.1.*

(stack evolution-api, service evolution — confirm with docker ps).

Auth — the part that isn't obvious from the docs

Evolution uses a flat apikey: <key> header — not Authorization: Bearer.

There are two keys, and using the wrong one is the #1 source of 401s:

| Key | Scope | Source |

|---|---|---|

| Global | lifecycle: create / list / delete / logout instances | EVOLUTION_API_KEY (bento state) |

| Instance | messaging + per-instance config (send, webhooks, state) | hash.apikey in the POST /instance/create response; re-readable via fetchInstances |

Rule: global key for instance lifecycle, instance key for everything you do

to an instance.

How to operate it

The flow is always: **create an instance → connect a phone (QR) → it goes

open → send/receive**. The endpoints you'll reach for, grouped by which key:

Look up exact paths, request bodies, and the full event list in the docs — don't

guess them from memory. Confirm the live shape against the running instance's

own Swagger if in doubt.

Gotchas (the reason this skill exists)

webhook with QRCODE_UPDATED to receive fresh codes, and watch

CONNECTION_UPDATE for state: open. Polling the endpoint races the expiry.

lifecycle call used the instance key, or a message call used the global key.

(5511999990000). Wrong format = silent non-delivery or 400.

a "Maximum call stack" error). Files over ~3 MB → pass an HTTPS URL instead.

destructive, no undo.**

does not wire one** — drive everything through per-instance webhooks set via

the API (they live in the DB and survive restarts). Add the env + redeploy

only if you specifically want a global one.

(curl --max-time 180).

Report back

captured and shown masked (last 4 only); for send, the returned message id.

Docs (source of truth): https://doc.evolution-api.com/v2 · live OpenAPI on

your instance at https://<EVOLUTION_HOST>/docs. When this skill and the docs

disagree, the docs win — tell the operator.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.