Whatsapp Business API (v0.14.0)

Download OpenAPI specification:Download

This is a Unofficial Whatsapp Business Server API

account

Log out Account

Log out Account and remove from database

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Get List of Accounts

Get List of Accounts

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Init Account

Init Account

Authorizations:
BasicAuth
Request Body schema: application/json

Account

id
string
only_status_updates
boolean
Array of objects (events.Webhook)

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "only_status_updates": true,
  • "webhooks": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Get Account by ID

Get Account by ID

Authorizations:
ApiKeyAuth
path Parameters
id
required
string

Account ID

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Get Pair Code

Get Pair Code

Authorizations:
ApiKeyAuth
query Parameters
phone
required
string

Phone number

Responses

Response samples

Content type
application/json
{
  • "data": "string",
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Get Status Privacy

Get Status Privacy

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

/v1/refresh

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Get Account Status

Get Account Status

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Delete Webhook

Delete Webhook

Authorizations:
ApiKeyAuth
Request Body schema: application/json

Webhook

chat_ids
Array of strings

Chat ids filter. Can be one or more chat ids. must be a valid chat id including the server.

chat_types
Array of strings
Items Enum: "contact" "group" "channel" "broadcast"

Chat types filter.

object
mentions
Array of strings

Only send events that @mention the specified users. use "me" to catch events that mention this session.

message_types
Array of strings

Message types filter.

settings_types
Array of strings
Items Enum: "chats" "messages" "groups" "system"

Settings types filter. If set, chat and message types filters will be ignored. Can't be combined with chat or message types filters. System setting events are: "logged_out", "client_connected", "joined_group".

url
required
string

Webhook URL. Required. Must be a valid URL. Must be unique within the account's webhooks.

Responses

Request samples

Content type
application/json
{
  • "chat_ids": [
    ],
  • "chat_types": [
    ],
  • "headers": {
    },
  • "mentions": [
    ],
  • "message_types": [
    ],
  • "settings_types": [
    ],
  • "url": "string"
}

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Get Webhooks

Get Webhooks

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Create Webhook

Create Webhook Webhook is a struct that represents a webhook. You can add headers to the webhook, and filter the events that will be sent to it. You can filter by chat types, chat ids, message types, and settings types. You can also filter by a combination of chat types and chat ids, or chat types and message types. You can't filter by a combination of chat types and chat ids, and chat types and message types.

Request Body schema: application/json

Webhook

chat_ids
Array of strings

Chat ids filter. Can be one or more chat ids. must be a valid chat id including the server.

chat_types
Array of strings
Items Enum: "contact" "group" "channel" "broadcast"

Chat types filter.

object
mentions
Array of strings

Only send events that @mention the specified users. use "me" to catch events that mention this session.

message_types
Array of strings

Message types filter.

settings_types
Array of strings
Items Enum: "chats" "messages" "groups" "system"

Settings types filter. If set, chat and message types filters will be ignored. Can't be combined with chat or message types filters. System setting events are: "logged_out", "client_connected", "joined_group".

url
required
string

Webhook URL. Required. Must be a valid URL. Must be unique within the account's webhooks.

Responses

Request samples

Content type
application/json
{
  • "chat_ids": [
    ],
  • "chat_types": [
    ],
  • "headers": {
    },
  • "mentions": [
    ],
  • "message_types": [
    ],
  • "settings_types": [
    ],
  • "url": "string"
}

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Delete All Webhooks

Delete All Webhooks

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

chats

Archive chat by id

Archive chat by id

Authorizations:
ApiKeyAuth
path Parameters
chatId
required
string

Chat ID

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Unarchive chat by id

Unarchive chat by id

Authorizations:
ApiKeyAuth
path Parameters
chatId
required
string

Group ID

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Get all groups

Get all groups

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "message": "string",
  • "success": true
}

Create a new group

Create a new group

Authorizations:
ApiKeyAuth
Request Body schema: application/json

Group info

admins
Array of strings
archived
boolean
broadcast
boolean
community_id
string
created
string
ephemeral
boolean
id
required
string
locked
boolean
members
Array of strings
muted
boolean
name
required
string
owner
string
photo
string
topic
string

Responses

Request samples

Content type
application/json
{
  • "admins": [
    ],
  • "archived": true,
  • "broadcast": true,
  • "community_id": "string",
  • "created": "string",
  • "ephemeral": true,
  • "id": "string",
  • "locked": true,
  • "members": [
    ],
  • "muted": true,
  • "name": "string",
  • "owner": "string",
  • "photo": "string",
  • "topic": "string"
}

Response samples

Content type
application/json
{
  • "groups": {
    },
  • "message": "string",
  • "success": true
}

Delete a group

Delete a group by group id

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Get group info

Get group info by group id

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Responses

Response samples

Content type
application/json
{
  • "groups": {
    },
  • "message": "string",
  • "success": true
}

Update group info

Update group info by group id

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Request Body schema: application/json

Group info

locked
boolean
name
string
photo
string
topic
string

Responses

Request samples

Content type
application/json
{
  • "locked": true,
  • "name": "string",
  • "photo": "string",
  • "topic": "string"
}

Response samples

Content type
application/json
{
  • "groups": {
    },
  • "message": "string",
  • "success": true
}

Demote group admins

Demote group admins by group id

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Request Body schema: application/json

Group members

Array
id
string

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string",
  • "success": true
}

Promote group admins

Promote group admins by group id

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Request Body schema: application/json

Group members

Array
id
string

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string",
  • "success": true
}

Set group as announce group

Set group as announce group, so only admins can send messages

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Clear group history

Clear group history by group id

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Get group invite link

Get group invite link by group id

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

query Parameters
reset
boolean

Reset invite link

Responses

Response samples

Content type
application/json
{
  • "data": "string",
  • "message": "string",
  • "success": true
}

Lock group by id

Lock group by id, so only admins can update group info like name, icon description and so.

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Delete group members

Delete group members by group id

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Request Body schema: application/json

Group members

Array
id
string

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string",
  • "success": true
}

Add group members

Add group members by group id

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Request Body schema: application/json

Group members

Array
id
string

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string",
  • "success": true
}

Approve group members requests

Approve group members requests by group id

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Request Body schema: application/json

Group members

Array
id
string

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Reject group members requests

Reject group members requests by group id

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Request Body schema: application/json

Group members

Array
id
string

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Get group members requests

Get group members requests by group id

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "message": "string",
  • "success": true
}

Pin group by group id to the top of the chat list

Pin group by group id to the top of the chat list

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Set group is announce group

Set group is announce group, so any member can send messages

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Unlock group by id

Unlock group by id, so any member can update group info like name, icon description and so.

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Unpin group by group id from the top of the chat list

Unpin group by group id from the top of the chat list

Authorizations:
ApiKeyAuth
path Parameters
groupId
required
string

Group ID

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

contacts

Get the contacts

Get the contacts

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "message": "string",
  • "success": true
}

Update the contact name

Update the contact name

Authorizations:
ApiKeyAuth
Request Body schema: application/json

Contact object

id
integer
object (handlers.ContactUpdateInfo)

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "info": {
    }
}

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Check if the contact is on WhatsApp

Check if the contact is on WhatsApp

Authorizations:
ApiKeyAuth
Request Body schema: application/json

Phone numbers

Array
id
string

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string",
  • "success": true
}

Get the contacts that can see the status

Get the contacts that can see the status

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "message": "string",
  • "success": true
}

media

Upload media

Upload media

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

message

Send message to Chat

"type" and "to" are alweys required, except for status messages (like read,played,typing and recording) to send media message, include the media id or url in the respective media type field to reply to spesific message, add the message id in the context field. when the message is in group, participant is also required to send mark messages as read, or to send "typing" indicator, use the status field.

Authorizations:
ApiKeyAuth
Request Body schema: application/json

Send message

object

The audio of the message

object

The context of the message, used for replies, mentions, and reactions in groups

object

The document of the message

id
string

ID of the message, can be used to pre-fill for later use

object

The image of the message

object

The interactive message

object

The invite message, used when user privacy are not allowed us to add them to group

object

The location of the message

participants
Array of strings

The participants list, can be used to override who the message is sent to in group chats

object

The poll of the message

preview_url
boolean
Default: false

Whether to include a preview URL in the message

object

The reaction of the message

recipient_type
string
Default: "individual"
Enum: "individual" "group"

The type of the recipient, individual or group

status
string
Enum: "read" "played" "typing" "recording"

The status of the message, used to mark message as read or played, or to show typing/recording indicators

object

The text of the message

to
required
string

The recipient of the message

type
required
string
Default: "text"
Enum: "text" "image" "video" "audio" "document" "location" "poll" "reaction" "invite" "interactive" "status"

The type of the message

object

The video of the message

Responses

Request samples

Content type
application/json
{
  • "audio": {
    },
  • "context": {
    },
  • "document": {
    },
  • "id": "string",
  • "image": {
    },
  • "interactive": {
    },
  • "invite": {
    },
  • "location": {
    },
  • "participants": [
    ],
  • "poll": {
    },
  • "preview_url": false,
  • "reaction": {
    },
  • "recipient_type": "individual",
  • "status": "read",
  • "text": {
    },
  • "to": "string",
  • "type": "text",
  • "video": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Delete message from Chat

delete message from Chat

Authorizations:
ApiKeyAuth
path Parameters
message_id
required
string

Message ID

chat_id
required
string

Chat ID

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

newsletters

Get all newsletters

Get all newsletters

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Follow a newsletter

Follow a newsletter

Authorizations:
ApiKeyAuth
Request Body schema: application/json

Newsletter ID

id
string

Responses

Request samples

Content type
application/json
{
  • "id": "string"
}

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Unfollow a newsletter

Unfollow a newsletter

Authorizations:
ApiKeyAuth
path Parameters
id
required
string

Newsletter ID

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}

Get a newsletter

Get a newsletter

Authorizations:
ApiKeyAuth
path Parameters
id
required
string

Newsletter ID

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string",
  • "success": true,
  • "timestamp": "string"
}