REST API platform for integrating systems with WhatsApp with stability, multi-instance management, message sending, and full webhook event streaming. Designed for enterprise automation, bots, SaaS platforms, CRMs, ERPs, and large-scale integrations.
ZapToBox WhatsApp API is an advanced REST platform built on top of Baileys, enabling fast and stable integration between applications and WhatsApp.
-
Multi-instance session management
-
File-system based authentication (/sessions/{{owner}}/{{instanceName}})
-
Full event webhook streaming
-
High-performance message persistence
-
All Baileys methods exposed through endpoints
-
Scalable architecture using DDD (Domain Driven Design)
-
Full TypeScript backend with Prisma ORM
-
Automatic reconnection and failure handling
Each instance is fully isolated using the structure:
/sessions/{owner}/{instanceName}This enables:
-
Multiple authenticated devices per system
-
Multi-user/multi-tenant architecture
-
Stateless REST integration across environments
-
Messages
-
Media
-
Chat
-
Group
-
Profile
-
Privacy
- messaging-history.set
- chats.upsert
- chats.update
- chats.delete
- lid-mapping.update
- presence.update
- contacts.upsert
- contacts.update
- messages.upsert
- messages.update
- messages.delete
- messages.media-update
- messages.reaction
- message-receipt.update
- groups.upsert
- groups.update
- group-participants.update
- group.join-request
- blocklist.set
- blocklist.update
- call
- labels.edit
- labels.association
- newsletter.reaction
- newsletter.view
- newsletter-participants.update
- newsletter-settings.update
- chats.set
- messages.set
- qrcode.updated
- qrcode.limit
- connection.open
- connection.close
- connection.removed
/prisma/migrations...
schema.prisma
/src/core/connectionprisma.ts
/repositoriesinstances.ts
/infra/baileysservices.ts
/configenv.ts
/http/controllerschat.tsgroup.tsinstances.tsmedia.tsmessages.tsprivacy.tsprofile.ts
/routeschat.tsgroup.tsinstances.tsmedia.tsmessages.tsprivacy.tsprofile.ts
/mapperscontactMapper.tsmessageMapper.ts
/stateauth.tssessions.ts
/webhookqueue.ts
/sharedconstants.tstypes.tsutils.ts
main.ts
/docs.env.example.gitignoredocker-compose.ymlDockerfileLICENSEpackage.jsonprisma.config.tsREADME.mdtsconfig.json
git clone https://github.com/jeankassio/ZapToBox-Whatsapp-Api.git
cd ZapToBox-Whatsapp-Apinpm installcp .env.example .envPlease fill in all the information correctly within the .env file before proceeding, especially the PostgreSQL connection URL.
npx prisma migrate deploynpm run devnpm run startnpm run buildnpm run start:pm2
//optionals:
pm2 save
pm2 startupdocker build -t zaptobox-whatsapp-apidocker run -d --name zaptobox -p 3000:3000 --env-file .env zaptobox-whatsapp-api
