Learn R Programming

evolution

     

R wrapper for Evolution API v2 — a lightweight WhatsApp integration API.

Overview

evolution is a tidy-style R client for the Evolution API v2, a RESTful platform that enables automation across WhatsApp (via Web/Baileys or Cloud API modes). It wraps HTTP calls using {httr2}, exposes snake_case helper functions, and integrates structured logging with {cli} for use in modern R pipelines and production tasks.

With evolution you can:

  • Send plain text, media (image/video/document), WhatsApp audio, stickers, or status stories
  • Send locations, contacts, interactive buttons, polls, or list messages
  • Check if numbers are registered on WhatsApp
  • Use options(evolution.timeout) to control timeouts and verbose = TRUE for detailed CLI logs with timing

Note: This package is an independent wrapper for the Evolution API and is not affiliated with WhatsApp or Meta.

Installation

# From CRAN
install.packages("evolution")

# Or the development version from GitHub
# install.packages("remotes")
remotes::install_github("StrategicProjects/evolution")

Quick Start

library(evolution)

client <- evo_client(
  base_url = "https://YOUR-HOST",
  api_key  = Sys.getenv("EVO_APIKEY"),
  instance = "yourInstance"
)

# Optional: set a global timeout (default: 60s)
options(evolution.timeout = 30)

# Send a simple message
send_text(client, "5581999990000", "Hello from R!", verbose = TRUE)

Functions Overview

FunctionDescriptionKey Arguments
evo_client()Creates preconfigured API clientbase_url, api_key, instance
send_text()Sends plain text messagenumber, text, delay, verbose
send_status()Posts a status/story (text or media)type, content, caption, verbose
send_media()Sends image/video/document (URL, base64, or file)number, mediatype, mimetype, media, file_name
send_whatsapp_audio()Sends voice note (PTT)number, audio, verbose
send_sticker()Sends sticker (URL or base64)number, sticker, verbose
send_location()Sends location pinnumber, latitude, longitude, name
send_contact()Sends one or more contacts (auto wuid)number, contact, verbose
send_reaction()Sends emoji reaction to a messagekey, reaction, verbose
send_buttons()Sends message with interactive buttons ⚠️number, buttons, verbose
send_poll()Sends a pollnumber, name, values, verbose
send_list()Sends an interactive list message ⚠️number, sections, button_text
check_is_whatsapp()Checks if numbers are on WhatsAppnumbers
jid()Builds WhatsApp JID from phone numbernumber

⚠️ send_buttons() and send_list() — Baileys users: Interactive buttons and list messages are not supported on the Baileys (WhatsApp Web) connector and are likely to be discontinued by Evolution API. Use send_poll() instead. These endpoints work only on the Cloud API connector.

Copy Link

Version

Install

install.packages('evolution')

Monthly Downloads

444

Version

0.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Andre Leite

Last Published

February 27th, 2026

Functions in evolution (0.1.0)

send_buttons

Send interactive buttons
jid

Build a WhatsApp JID from a raw phone number
evo_client

Create an Evolution API client
check_is_whatsapp

Check if numbers are on WhatsApp
send_contact

Send a WhatsApp contact (auto-generate wuid)
.compact

Compact a list removing NULL elements
send_list

Send a list message
send_status

Send a WhatsApp Status (story)
send_reaction

React to a message
send_poll

Send a poll
send_whatsapp_audio

Send WhatsApp audio (voice note)
send_location

Send a location
send_sticker

Send a sticker
send_media

Send media (image, video, document)
send_text

Send a plain text message
.evo_post

Perform a JSON POST request (internal)
.assert_scalar_string

Assert that a value is a single non-empty string
.normalize_media

Normalise media input (URL, file path, base64, data-URI)
.evo_path

Build internal API path