canonical: https://jentic.com/apis/2chat.co/2chat

# 2Chat WhatsApp API

Jentic publishes the only available OpenAPI specification for 2Chat WhatsApp API, keeping it validated and agent-ready. The 2Chat WhatsApp API lets applications send WhatsApp text, image, and document messages from connected WhatsApp numbers, list which numbers are connected to a 2Chat account, and check whether a destination phone number is registered on WhatsApp. Authentication is via an X-User-API-Key header. The API exposes five endpoints under /api/v1/whatsapp covering numbers, messages, and contact lookup.

## For AI agents

Send WhatsApp text, image, and document messages from a connected 2Chat number, list connected numbers, and verify whether a phone number is on WhatsApp.

## Scope

Does not handle SMS, voice calls, email, or push notifications - use for sending and validating WhatsApp messages from a connected 2Chat number only.

## Capabilities

- Send WhatsApp text messages from a connected number to any recipient in E.164 format
- Deliver image messages with an optional caption by referencing a public image URL
- Send document or file messages with a custom filename and caption to a WhatsApp recipient
- List the WhatsApp numbers currently connected to a 2Chat account along with their alias and status
- Check whether a target phone number is registered on WhatsApp before attempting delivery

## Use cases

### WhatsApp Order Confirmations

Send transactional WhatsApp messages such as order confirmations and shipping updates from a 2Chat-connected business number. The text endpoint accepts a recipient number in E.164 format and a message body, and returns a message UUID and status for delivery tracking. This avoids the WhatsApp Business Platform onboarding by reusing an already-connected number.

Example prompt: Send a WhatsApp text message to +14155551234 saying 'Your order #1042 has shipped - tracking: 1ZA999' from the connected 2Chat number 14155556789 and capture the returned message UUID.

### Document Delivery Over WhatsApp

Deliver invoices, receipts, contracts, or boarding passes as WhatsApp document messages by passing a public URL, filename, and optional caption. The 2Chat document endpoint forwards the file to the recipient's WhatsApp client without requiring local upload, which keeps integration light for back-office systems generating PDFs on the fly.

Example prompt: Send the PDF at https://example.com/invoice-1042.pdf as a WhatsApp document with filename 'invoice-1042.pdf' and caption 'Your June invoice' to recipient +442071234567 using the connected number 14155556789.

### WhatsApp Number Validation

Before launching a WhatsApp campaign or 1:1 outreach, verify that the destination number is actually registered on WhatsApp. The check-number endpoint returns a boolean indicating WhatsApp registration status, letting applications skip non-WhatsApp numbers and reduce delivery failures.

Example prompt: For a list of 50 phone numbers, call the check-number endpoint using connected number 14155556789 and return only the subset that are registered on WhatsApp.

### Agent-Driven WhatsApp Outreach

Allow an AI agent to handle WhatsApp messaging end-to-end through Jentic: discover the 2Chat send-text operation by intent, load the input schema, supply recipient and message body, and execute. Credentials stay isolated in Jentic's vault - the agent never sees the raw 2Chat API key.

Example prompt: Through Jentic, search for 'send a whatsapp message', load the 2Chat sendTextMessage schema, and dispatch a personalised reminder to each recipient in a contact list.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /api/v1/whatsapp/numbers/{phoneNumber}/messages/text | Send a WhatsApp text message |
| POST | /api/v1/whatsapp/numbers/{phoneNumber}/messages/image | Send a WhatsApp image with optional caption |
| POST | /api/v1/whatsapp/numbers/{phoneNumber}/messages/document | Send a WhatsApp document or file |
| GET | /api/v1/whatsapp/numbers | List connected WhatsApp numbers |
| GET | /api/v1/whatsapp/numbers/{phoneNumber}/check-number/{targetNumber} | Check whether a number is on WhatsApp |

## Key resources

- **Numbers** — List the WhatsApp numbers connected to your 2Chat account with their status and alias
- **Messages** — Send text, image, and document WhatsApp messages from a connected number
- **Contacts** — Check whether a target phone number is registered on WhatsApp

## Why Jentic

- **Setup:** Wiring the 2Chat WhatsApp API by hand means managing its X-User-API-Key header, targeting the api.2chat.io host, and shaping text, image, and document message payloads yourself. Through Jentic you install once, import the 2Chat WhatsApp API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** 2Chat puts the connected number in the URL path (/whatsapp/numbers/{phoneNumber}/...), so a rule can pin your agent to one number: it can send from and validate against that number and nothing else. You choose the operations it may call, so document or image sends are not included unless you add them.
- **Credential handling:** Your 2Chat API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'send a WhatsApp message' or 'check whether a number is on WhatsApp', and Jentic returns the matching 2Chat operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Twilio Messaging** — Twilio's messaging API also supports WhatsApp delivery alongside SMS and MMS at larger scale.
- **MessageBird SMS API** — Use MessageBird's SMS channel as a fallback when a recipient's number is not registered on WhatsApp.
- **46elks API** — 46elks provides SMS, MMS, and voice as additional channels alongside WhatsApp delivery via 2Chat.

## FAQ

### Why is there no official OpenAPI spec for 2Chat WhatsApp API?

2Chat does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call 2Chat WhatsApp API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the 2Chat WhatsApp API use?

It uses an API key passed in the X-User-API-Key request header. Through Jentic, the key is stored encrypted in the vault and injected at execution time, so agents never see the raw secret in their context.

### Can I send WhatsApp images and documents through the 2Chat API?

Yes. POST /api/v1/whatsapp/numbers/{phoneNumber}/messages/image accepts an image URL and optional caption, and POST /api/v1/whatsapp/numbers/{phoneNumber}/messages/document accepts a file URL plus filename and caption. Both return a message UUID for tracking.

### How do I check if a phone number is on WhatsApp before messaging?

Call GET /api/v1/whatsapp/numbers/{phoneNumber}/check-number/{targetNumber} with one of your connected numbers and the target number in E.164 format (no leading +). The response includes is_whatsapp_user, which you can use to filter recipients.

### How do I send a WhatsApp message with the 2Chat API through Jentic?

Run pip install jentic, then use the search-load-execute flow: search for 'send a whatsapp message', load the sendTextMessage operation, supply your connected phoneNumber, to_number, and text, and execute. Run it through Jentic One, the self-hosted execution layer, to get an agent API key. for execution.

### What number format does 2Chat expect for WhatsApp recipients?

Phone numbers must be in E.164 format without the leading + sign. For example, the US number +1 415 555 1234 is passed as 14155551234 in both the path parameter and the to_number body field.

### Can I limit what my agent is allowed to do with the 2Chat WhatsApp API?

Yes. Because Jentic One is self-hosted, your own rules decide which 2Chat operations and credentials the agent may use. Since 2Chat puts the connected number in the URL path (/whatsapp/numbers/{phoneNumber}/...), you can pin the agent to a single number so it only sends from and validates against that number. You also choose which operations it may call, so you can allow just text sends while excluding image sends, document sends, number listing, or check-number lookups.
