Skip to content

lbarreiro/whatssend

Repository files navigation

WhatsSend

A lightweight self-hosted WhatsApp REST API built with Go.

WhatsSend allows you to send WhatsApp messages through a simple REST API while keeping your own WhatsApp account and session under your control.


Quick Start

Create a directory:

mkdir whatssend
cd whatssend

Create a file named docker-compose.yml:

services:
  whatssend:
    image: lbarreiro71/whatssend:latest

    container_name: whatssend

    restart: unless-stopped

    ports:
      - "8082:8082"

    volumes:
      - ./data:/app/data

    environment:
      TZ: Europe/Lisbon

Start the container:

docker compose up -d

Open your browser:

http://YOUR_SERVER_IP:8082

Scan the QR Code once.

Done.


REST API

Send a message:

POST /api/send

Example:

{
    "to":"351912345678",
    "message":"Hello from WhatsSend!"
}

Example using curl:

curl -X POST http://localhost:8082/api/send \
-H "Content-Type: application/json" \
-d '{
  "to":"351912345678",
  "message":"Hello!"
}'

Home Assistant

rest_command:
  whatssend:
    url: "http://YOUR_SERVER_IP:8082/api/send"
    method: POST
    content_type: application/json
    payload: >
      {
        "to": {{ to | to_json }},
        "message": {{ message | to_json }}
      }

Persistent Storage

WhatsSend stores all data in:

data/
├── config.yaml
└── session.db

Keep this folder to preserve your WhatsApp session.


Features

  • Lightweight
  • Self-hosted
  • QR authentication
  • Persistent session
  • REST API
  • Docker
  • Home Assistant integration

Source Code

https://github.com/lbarreiro/whatssend


License

MIT

About

Lightweight self-hosted WhatsApp HTTP API for Home Assistant and automation, written in Go

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors