Create and manage API keys
Create an API key for each system that calls IconEngage, start from the Send WhatsApp messages preset or choose its permissions, copy it once, and revoke or replace it.
An API key lets one of your systems call the IconEngage public API. Create a separate key for each system, so you can revoke one without touching the others.
Note: Owners, Admins and Developers can see and manage API keys. Your plan must include the public API to create one.
The API keys page
Go to Settings › Developers › API keys. The page lists your organisation's keys with these columns:
| Column | What it shows |
|---|---|
| Name | The name you gave the key |
| Key | The key's public start and its last four characters. The full key is never shown again after you create it. |
| Permissions | How many permissions the key carries. Hover to see them. |
| Last used | When the key last made a request, or Never |
| Created | When the key was created |
| Status | Active or Revoked |
Revoked keys are hidden. Turn on Show revoked keys to see them.
The page also shows the address your keys work with, as Public API: ….
Create a key
- Go to Settings › Developers › API keys.
- Click New API key.
- In Name, name the key after the system that will use it, for example "Order sync". Names are up to 120 characters, and two active keys cannot share a name.
- Under What will this key do?, choose a preset or Custom. See Presets below.
- With a preset, the dialog lists in plain words what the key will be able to do. To start from a preset and change it, click Customise these permissions.
- With Custom, tick what the key needs. Type in Filter permissions to find one. Give the key only what it needs.
- Click Create key.
- If you have not confirmed your identity in the last few minutes, IconEngage asks for your two-factor code or your password. Enter it to continue.
- Copy the key from Copy your API key now and store it somewhere safe, such as your server's secret store or a password manager.
- If the key can send messages, the same screen shows Send your first message: ready-to-run examples in curl, Node.js, Python and PHP. They are filled in with your organisation's WhatsApp number and, if you have one, an approved template. They read the key from the
ICONENGAGE_API_KEYenvironment variable and never contain the key itself. See Send your first message in 5 minutes. - Click I have copied it.
Note: This is the only time the key is shown. IconEngage stores only a one-way hash of it, so nobody (including support) can recover it. If you lose it, create a new key.
Presets
A preset is a ready-made set of permissions for a common job. The key gets exactly the preset's permissions, listed one by one, as if you had ticked them yourself.
| Preset | What the key can do | Permissions |
|---|---|---|
| Send WhatsApp messages (recommended) | Send messages from your numbers, check whether they were delivered, add a contact when you message a new phone number, and see your contacts, templates and numbers | messages.send, messages.read, contacts.read, contacts.create, templates.read, channels.read |
| Send messages and sync contacts | Everything Send WhatsApp messages can do, and also update a contact's details and record their opt-in or opt-out, so a send can carry contact and you can use POST /contacts/consent | the same, plus contacts.update |
| Read only | Read contacts, conversations, messages, templates, campaigns and numbers, and change nothing | contacts.read, messages.read, templates.read, campaigns.read, channels.read |
Note: templates.read, which every preset includes, also returns each template's sample values: the example values its author typed for Meta's review. Make sure your team doesn't use a real customer's details as samples.
Why two sending presets. contacts.update can record a customer's opt-in. Send WhatsApp messages leaves it out, so a key that leaks can't opt back in a customer who said STOP. Choose Send messages and sync contacts only for a system that keeps your contacts up to date.
Starting flows (automation.trigger) is in no preset. A flow can do more than send messages: it can tag contacts, assign conversations and call your other systems. So a key gets this permission only if you choose it: pick Custom and tick it. Owners, Admins and Marketing Managers can give it. See Start a flow with the API.
A preset that needs a permission you don't hold is shown but can't be chosen, and the dialog names what's missing. For example, the Developer role can't send messages or add contacts, so a Developer can't create a Send WhatsApp messages key. Ask an Owner or Admin to create it.
Which permissions a key can have
The list only shows permissions you hold yourself, and a key can carry up to 64. Each API endpoint needs one permission; the API overview lists which.
A key never does more than the person who created it:
- It acts with its creator's authority, checked on every request. If the creator's role later loses a permission, the key loses it too, and requests needing it are refused.
- If the creator leaves the organisation or is suspended, all their keys stop working.
Tip: For an integration that must outlive any one person, create its keys from an account kept for that purpose. Make sure that account's role has the permissions the integration needs. For example, the Developer role cannot send messages, so a key that sends must be created by someone whose role can.
See Roles and permissions for what each role holds.
Revoke a key
- Go to Settings › Developers › API keys.
- Open the actions menu on the key's row and choose Revoke.
- Click Revoke key to confirm.
Anything using the key stops working at once. Revoking cannot be undone.
Replace (rotate) a key
There is no rotate button. To replace a key without downtime:
- Create a new key with the same permissions.
- Update your system to use the new key.
- Check that Last used on the new key updates.
- Revoke the old key.
A revoked key's name can be reused, so the new key can carry the old name once the old one is revoked.
Related
- Send your first message in 5 minutes
- Authenticate API requests
- Event webhooks: every webhook is signed for one of your API keys
- Track your API usage
- Security and two-factor authentication
Still need help?
Write to us at [email protected] and tell us what you were trying to do. Already a customer? Sign in to IconEngage — the same articles are under Help in the app.