Authentication
API keys per connection, the headers that carry them, rotation and revocation.
Every call to the Wappfy API is authenticated with an API key that belongs to one connection (one WhatsApp number).
One key, one connection
- A key looks like
wpf_followed by random characters. The dashboard shows its first characters as a prefix, so you can tell keys apart. - A key only reaches the connection it was generated for. Routes never take a connection id: the key already says which connection it is, and it cannot reach any other.
- To use two numbers, generate one key on each connection.
- A key only works while the account's subscription is active. Otherwise every call answers
402 sem_assinaturauntil the plan is reactivated.
Sending the key
Use either header. If both are present, X-Api-Key wins.
curl https://app.wappfy.io/api/v1/instance \
-H "X-Api-Key: wpf_YOUR_KEY"curl https://app.wappfy.io/api/v1/instance \
-H "Authorization: Bearer wpf_YOUR_KEY"Authorization: Bearer is what n8n, Make and most HTTP libraries offer out of the box.
Generating a key
- In the dashboard, open Connections and the connection you want.
- On the Integrations tab, click Generate key on the API card.
- Give it a name (up to 60 characters) that tells you where it is used, such as
n8norCRM, and click Generate. - Copy the key and store it safely.
The key is shown only once, when it is created. Wappfy only keeps a hash of it and cannot show it again. If you lose it, generate a new one and revoke the old one.
Only the owner of a connection can generate and revoke its keys. People the connection was shared with cannot.
The API card lists every active key with its name, prefix, creation date and when it was last used.
Up to 3 active keys
Each connection can have up to 3 active keys. That is enough for one key per system, and to rotate a key without downtime:
Generate the new key
Create a second key on the same connection.
Switch your system to it
Update the key in n8n, your CRM or your code, and check that calls succeed.
Revoke the old key
Revoke it on the API card only after nothing uses it anymore.
To generate a fourth key, revoke one you no longer use first.
Revoking a key
Click Revoke next to the key on the API card. It stops working immediately, and this cannot be undone. Any system still using it starts getting 401 chave_invalida.
Idempotency-Key
Every route that changes something (POST, PUT, PATCH and DELETE) accepts an optional Idempotency-Key header: 1 to 255 visible ASCII characters, no spaces, such as a UUID or your workflow run id. Repeating the same value with the same API key within 24 hours returns the first response, with the header idempotent-replayed: true, without doing it again.
curl -X POST https://app.wappfy.io/api/v1/messages/text \
-H "X-Api-Key: wpf_YOUR_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7d0c1f9e-5b7a-4a52-9a49-2f1b0e6d3c11" \
-d '{ "to": "5581999999999", "text": "Your appointment is confirmed." }'Send it whenever your system may retry on its own (n8n and Make retry on timeout). The rules are in Response format.
Authentication errors
| Status | Code | Meaning |
|---|---|---|
401 | chave_invalida | The key is missing, malformed, unknown or revoked. The answer is the same in all four cases. |
402 | sem_assinatura | The account that owns the connection has no active subscription. |
429 | muitas_tentativas | Your IP sent 20 missing or invalid keys within 10 minutes and is blocked for 15 minutes. Fix the key and wait for Retry-After. Calls with a valid key keep working, even from the blocked IP. |
403 sem_permissao is not about your key. It means WhatsApp refused the action for lack of permission, for example changing a group when the number is not an admin.
A route that doesn't exist answers 404 rota_nao_encontrada, but only after a valid key: without one, you get 401.
Keep keys safe
Server side only
Never put a key in front-end code, a mobile app, a repository or a screenshot. Anyone with the key can send messages from your number.
One key per system
Give each integration its own named key, so you can revoke one without stopping the others.
Leaked? Revoke it
Revoking takes effect immediately. Generate a new key and update your system.
Watch Last used
A key you think is unused but shows recent use deserves a look.

