Skip to content

The IconEngage public API

What the public REST API lets your own systems do, where it lives, how it is versioned and which resources it offers.

The public API lets your own software work with one IconEngage organisation: send every kind of WhatsApp message, upload media, and read or update contacts, conversations, templates and campaigns. Event webhooks do the reverse: they tell your system the moment something happens in IconEngage.

Before you start

  • Your plan must include the public API. If it does not, creating an API key is refused with a message about your plan. See Plans and trial.
  • You need an API key. An Owner, Admin or Developer creates one in Settings › Developers › API keys. To send messages, use the Send WhatsApp messages preset. See Create and manage API keys.
  • Your WhatsApp number must be connected. The API sends through the same numbers as the rest of the app. See Numbers and accounts.

Base URL and versioning

Every endpoint lives under /api/public/v1 on your IconEngage web address. The exact base URL is shown on the API keys page as Public API: …. On iconengage.com it is:

https://iconengage.com/api/public/v1

Tip: To send a message right away, follow Send your first message in 5 minutes.

The v1 in the path is the API's major version. It is versioned separately from the app, so changes to the app's own screens do not change this API. Webhook bodies carry their own version field for the same reason.

Note: An API key only works on /api/public/v1. The app's own /api/v1 addresses refuse it.

What's new in version 1.5.0

Everything is additive: every request that worked in 1.4.0 works the same way now.

  • Template variables by name. template.variables also takes an object: { "first_name": "Asha", "order_id": "#1042" }, by the template's own variable names, or by key (body.1, header.1) for one place. A list still works. See Fill the variables by name.
  • A template's header in the send. template.header gives an image, video or document by link or media_id, a location, or a text header's value. See Give the template's header.
  • Ready-to-send examples. GET /templates/{template_id} now returns header_format, every variable with its name, key and sample, and example, a complete POST /messages body: copy it and change to. GET /templates?name= finds a template by name. See Start from the template's example.
  • Clearer template refusals. Variables that don't fit the template are 400 validation_failed with details.reason: template_variables and details.expected, instead of 409 template_not_approved. A header that doesn't match is template_header. See template_variables and template_header.

What's new in version 1.4.0

Everything is additive: every request that worked before works the same way now.

  • to takes a phone number. "to": "+91XXXXXXXXXX", with a real number in place of the X's and always with its + and country code, sends to that number and creates the contact if you don't have it. The {contact_id} and {wa_id} forms still work.
  • from is optional. With one WhatsApp number, leave it out. With several, name the number by its id or the number itself. A send without it is refused with details.reason: from_required and the list of your numbers. See Choose the sending number.
  • GET /numbers lists your WhatsApp numbers, with whether each can send.
  • Errors say how to fix them. Common refusals carry fix and docs_url. See Fixing a refusal.
  • Key presets. Send WhatsApp messages gives a key everything a send needs. See Presets.

How requests work

  • Authentication: send your key as Authorization: Bearer iek_… on every request. See Authenticate API requests.
  • Your organisation comes from the key. No request carries an organisation id. A key reaches exactly one organisation.
  • JSON in, JSON out. Send Content-Type: application/json with a body. The one exception is a file upload to POST /media, which uses multipart/form-data.
  • Pagination: list endpoints return a page and a next_cursor. Pass it back as ?cursor= to get the next page, and stop when it is null. Set the page size with ?limit= (1 to 100, default 25). Never build a cursor yourself.
  • Errors always have the same shape: {code, message, request_id, details}, plus fix and docs_url when there is a known remedy. See Rate limits and errors.

What you can do

Each endpoint needs one permission on the key. The permission is named in brackets.

Messages and media

Method and pathWhat it does
POST /messagesSend a message: text, image, video, audio, document, sticker, location, contacts, interactive buttons or lists, reaction, or template (messages.send)
GET /messages/{message_id}One message, its status and, if it failed, why (messages.read)
POST /mediaUpload a file, or import one from an https URL, to send by its media_id (messages.send)
GET /media/{media_id}One media object, with a short-lived download link (messages.read)

See Send a message with the API.

WhatsApp numbers

Method and pathWhat it does
GET /numbersYour organisation's WhatsApp numbers, with can_send and the default a send without from uses (channels.read)

See List your numbers.

Conversations

Method and pathWhat it does
GET /conversationsList conversations, filtered by contact_id or window_state (messages.read)
GET /conversations/{conversation_id}/messagesOne conversation's messages, filtered by direction (messages.read)

Contacts

Method and pathWhat it does
GET /contactsList contacts, searched with q or changed since updated_since (contacts.read)
POST /contactsCreate or update a contact by WhatsApp number (contacts.create)
GET /contacts/{contact_id}One contact (contacts.read)
PATCH /contacts/{contact_id}Update a contact (contacts.update)
POST /contacts/{contact_id}/consentRecord an opt-in or an opt-out (contacts.update)
POST /contacts/consentRecord an opt-in or an opt-out by phone number, adding the contact if it's new (contacts.update, contacts.create)
POST /contacts/{contact_id}/tagsAdd tags to a contact (contacts.update)
DELETE /contacts/{contact_id}/tags/{tag}Remove a tag from a contact (contacts.update)
GET /contact-fieldsYour organisation's custom contact fields (contacts.read)
GET /tagsYour organisation's tags (contacts.read)

Message templates

Method and pathWhat it does
GET /templatesList templates, filtered by status, language or name (templates.read)
POST /templatesCreate a template draft (templates.create)
GET /templates/{template_id}One template, with its status, header format, variables and a ready-to-send example (templates.read)
POST /templates/{template_id}/submitSubmit a template to Meta for review (templates.submit)

Campaigns

Method and pathWhat it does
GET /campaignsList campaigns, filtered by status (campaigns.read)
POST /campaignsCreate a campaign (campaigns.create)
GET /campaigns/{campaign_id}One campaign (campaigns.read)
GET /campaigns/{campaign_id}/progressA campaign's progress (campaigns.read)
POST /campaigns/{campaign_id}/scheduleSet when a campaign sends (campaigns.update)
POST /campaigns/{campaign_id}/resolveResolve the audience into recipients (campaigns.send)
POST /campaigns/{campaign_id}/launchLaunch a campaign (campaigns.send)
POST /campaigns/{campaign_id}/pausePause a campaign (campaigns.send)
POST /campaigns/{campaign_id}/resumeResume a paused campaign (campaigns.send)

Webhook subscriptions

A key can manage its own event webhook subscriptions over the API, as well as on the Event webhooks page.

Method and pathWhat it does
GET /webhook-subscriptionsThis key's subscriptions (developer.webhooks.manage)
POST /webhook-subscriptionsSubscribe this key to events; the answer holds the signing secret, once (developer.webhooks.manage)
PATCH /webhook-subscriptions/{webhook_id}Change a subscription (developer.webhooks.manage)
DELETE /webhook-subscriptions/{webhook_id}Delete a subscription (developer.webhooks.manage)
POST /webhook-subscriptions/{webhook_id}/testSend test events to a subscription (developer.webhooks.manage)

A key sees and changes only the subscriptions it owns. See Event webhooks.

Event webhooks and inbound webhooks are different

Event webhooks (this section) send events from IconEngage to your system. Inbound webhooks do the opposite: your system calls IconEngage to start an automation flow.

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.