Skip to main content

Messages API

Send different types of WhatsApp messages.

All requests are POST with Content-Type: application/json and must include the X-API-KEY header. Responses follow {message: string, success: boolean}.

Receivers must be E.164 digits without plus (e.g., 14155552671).

Text

POST /messages/text

When to use it

  • Send plain text updates, OTPs, and quick replies.
  • Ideal for low-latency transactional notifications.

Body

  • instance: string — Your instance identifier.
  • receiver: string — E.164 digits without plus.
  • text: string — The message text.
curl -X POST https://api.communiktor.com/messages/text \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"text": "Hello from Communiktor!"
}'

Image

POST /messages/image

When to use it

  • Send product photos, tickets, receipts, or screenshots.
  • Use viewOnce for sensitive content that should not persist in the chat.

Body

  • instance: string — Your instance identifier.
  • receiver: string — E.164 digits without plus.
  • url: string — Publicly accessible image URL.
  • viewOnce?: boolean — If true, the media disappears after being viewed once.
  • caption?: string — Optional text shown below the image.
curl -X POST https://api.communiktor.com/messages/image \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"url": "https://example.com/image.jpg",
"caption": "Order #12345",
"viewOnce": false
}'

Video

POST /messages/video

When to use it

  • Send feature demos, announcements, or short clips.
  • Use asGif/asNote for lightweight previews when appropriate.

Body

  • instance: string — Your instance identifier.
  • receiver: string — E.164 digits without plus.
  • url: string — Publicly accessible video URL.
  • asGif?: boolean — Send as short looping preview (no sound).
  • asNote?: boolean — Send as a circular video note (like push-to-talk style).
  • caption?: string — Optional text shown below the video.
  • viewOnce?: boolean — If true, the media disappears after being viewed once.
curl -X POST https://api.communiktor.com/messages/video \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"url": "https://example.com/video.mp4",
"caption": "Feature demo",
"asGif": false,
"asNote": false,
"viewOnce": false
}'

Audio

POST /messages/audio

When to use it

  • Share voice notes, short audio confirmations, or hotline messages.
  • Use asNote for a push-to-talk style waveform.

Body

  • instance: string — Your instance identifier.
  • receiver: string — E.164 digits without plus.
  • url: string — Publicly accessible audio URL.
  • asNote?: boolean — Send as a voice note (push-to-talk style).
  • viewOnce?: boolean — If true, the media disappears after being viewed once.
curl -X POST https://api.communiktor.com/messages/audio \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"url": "https://example.com/audio.mp3",
"asNote": false,
"viewOnce": false
}'

Document

POST /messages/document

When to use it

  • Send PDFs, invoices, contracts, or other business files.
  • Set filename to control how the file appears to the recipient.

Body

  • instance: string — Your instance identifier.
  • receiver: string — E.164 digits without plus.
  • url: string — Publicly accessible document URL.
  • viewOnce?: boolean — If true, the media disappears after being viewed once.
  • caption?: string — Optional text shown below the document.
  • filename?: string — File name shown to the recipient.
curl -X POST https://api.communiktor.com/messages/document \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"url": "https://example.com/invoice.pdf",
"caption": "Invoice May",
"filename": "invoice-may.pdf",
"viewOnce": false
}'

Location

POST /messages/location

When to use it

  • Share store locations, delivery coordinates, or meeting points.
  • Include name/address to display a readable pin name.

Body

  • instance: string — Your instance identifier.
  • receiver: string — E.164 digits without plus.
  • location: object — Coordinates and label to pin on the map:
    • latitude: number — Latitude in decimal degrees.
    • longitude: number — Longitude in decimal degrees.
    • name: string — Pin title shown to the user.
    • address: string — Human‑readable address for the pin.
curl -X POST https://api.communiktor.com/messages/location \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"location": {"latitude": 37.7749, "longitude": -122.4194, "name": "Communiktor HQ", "address": "1 Market St, San Francisco"}
}'

vCard

POST /messages/vcard

When to use it

  • Share a contact card for sales agents, stores, or support lines.
  • Ensure the contact phone is E.164 digits to allow immediate messaging.

Body

  • instance: string — Your instance identifier.
  • receiver: string — E.164 digits without plus.
  • name: string — Title of the card shown in the chat.
  • contact: object with fields:
    • fullname: string — Contact full name.
    • phone: string — E.164 digits without plus.
    • waid?: string — WhatsApp ID of the contact (if known).
    • organization?: string — Company or organization name.
    • title?: string — Role or job title.
    • email?: string — Contact email address.
    • url?: string — Website or profile URL.
    • address?: string — Postal address.
    • note?: string — Additional notes.
curl -X POST https://api.communiktor.com/messages/vcard \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"name": "Sales Contact",
"contact": {
"fullname": "Jane Doe",
"phone": "14155552671",
"organization": "ACME Inc.",
"title": "Account Executive",
"email": "jane.doe@example.com",
"url": "https://example.com",
"address": "1 Market St, San Francisco",
"note": "VIP client handler"
}
}'