Download OpenAPI specification:Download
This is a Unofficial Whatsapp Business Server API
{- "data": [
- {
- "account": {
- "accountSignature": [
- 0
], - "accountSignatureKey": [
- 0
], - "details": [
- 0
], - "deviceSignature": [
- 0
]
}, - "advSecretKey": [
- 0
], - "appState": null,
- "appStateKeys": null,
- "businessName": "string",
- "chatSettings": null,
- "contacts": null,
- "container": null,
- "facebookUUID": "string",
- "id": {
- "device": 0,
- "integrator": 0,
- "rawAgent": 0,
- "server": "string",
- "user": "string"
}, - "identities": null,
- "identityKey": {
- "priv": [
- 0
], - "pub": [
- 0
]
}, - "initialized": true,
- "log": null,
- "msgSecrets": null,
- "noiseKey": {
- "priv": [
- 0
], - "pub": [
- 0
]
}, - "platform": "string",
- "preKeys": null,
- "privacyTokens": null,
- "pushName": "string",
- "registrationID": 0,
- "senderKeys": null,
- "sessions": null,
- "signedPreKey": {
- "keyID": 0,
- "priv": [
- 0
], - "pub": [
- 0
], - "signature": [
- 0
]
}
}
], - "message": "string",
- "success": true,
- "timestamp": "string"
}Init Account
Account
| id | string |
| only_status_updates | boolean |
Array of objects (events.Webhook) |
{- "id": "string",
- "only_status_updates": true,
- "webhooks": [
- {
- "chat_ids": [
- "string"
], - "chat_types": [
- "contact"
], - "headers": {
- "property1": "string",
- "property2": "string"
}, - "mentions": [
- "string"
], - "message_types": [
- "string"
], - "settings_types": [
- "chats"
], - "url": "string"
}
]
}{- "data": {
- "code": "string",
- "id": "string",
- "image": "string",
- "jid": {
- "device": 0,
- "integrator": 0,
- "rawAgent": 0,
- "server": "string",
- "user": "string"
}, - "only_status_updates": true,
- "token": "string"
}, - "message": "string",
- "success": true,
- "timestamp": "string"
}Get Account by ID
| id required | string Account ID |
{- "data": [
- {
- "account": {
- "accountSignature": [
- 0
], - "accountSignatureKey": [
- 0
], - "details": [
- 0
], - "deviceSignature": [
- 0
]
}, - "advSecretKey": [
- 0
], - "appState": null,
- "appStateKeys": null,
- "businessName": "string",
- "chatSettings": null,
- "contacts": null,
- "container": null,
- "facebookUUID": "string",
- "id": {
- "device": 0,
- "integrator": 0,
- "rawAgent": 0,
- "server": "string",
- "user": "string"
}, - "identities": null,
- "identityKey": {
- "priv": [
- 0
], - "pub": [
- 0
]
}, - "initialized": true,
- "log": null,
- "msgSecrets": null,
- "noiseKey": {
- "priv": [
- 0
], - "pub": [
- 0
]
}, - "platform": "string",
- "preKeys": null,
- "privacyTokens": null,
- "pushName": "string",
- "registrationID": 0,
- "senderKeys": null,
- "sessions": null,
- "signedPreKey": {
- "keyID": 0,
- "priv": [
- 0
], - "pub": [
- 0
], - "signature": [
- 0
]
}
}
], - "message": "string",
- "success": true,
- "timestamp": "string"
}Delete Webhook
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. |
{- "chat_ids": [
- "string"
], - "chat_types": [
- "contact"
], - "headers": {
- "property1": "string",
- "property2": "string"
}, - "mentions": [
- "string"
], - "message_types": [
- "string"
], - "settings_types": [
- "chats"
], - "url": "string"
}{- "data": null,
- "message": "string",
- "success": true,
- "timestamp": "string"
}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.
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. |
{- "chat_ids": [
- "string"
], - "chat_types": [
- "contact"
], - "headers": {
- "property1": "string",
- "property2": "string"
}, - "mentions": [
- "string"
], - "message_types": [
- "string"
], - "settings_types": [
- "chats"
], - "url": "string"
}{- "data": null,
- "message": "string",
- "success": true,
- "timestamp": "string"
}{- "data": [
- {
- "admins": [
- "string"
], - "archived": true,
- "broadcast": true,
- "community_id": "string",
- "created": "string",
- "ephemeral": true,
- "id": "string",
- "locked": true,
- "members": [
- "string"
], - "muted": true,
- "name": "string",
- "owner": "string",
- "photo": "string",
- "topic": "string"
}
], - "message": "string",
- "success": true
}Create a new group
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 |
{- "admins": [
- "string"
], - "archived": true,
- "broadcast": true,
- "community_id": "string",
- "created": "string",
- "ephemeral": true,
- "id": "string",
- "locked": true,
- "members": [
- "string"
], - "muted": true,
- "name": "string",
- "owner": "string",
- "photo": "string",
- "topic": "string"
}{- "groups": {
- "admins": [
- "string"
], - "archived": true,
- "broadcast": true,
- "community_id": "string",
- "created": "string",
- "ephemeral": true,
- "id": "string",
- "locked": true,
- "members": [
- "string"
], - "muted": true,
- "name": "string",
- "owner": "string",
- "photo": "string",
- "topic": "string"
}, - "message": "string",
- "success": true
}Get group info by group id
| groupId required | string Group ID |
{- "groups": {
- "admins": [
- "string"
], - "archived": true,
- "broadcast": true,
- "community_id": "string",
- "created": "string",
- "ephemeral": true,
- "id": "string",
- "locked": true,
- "members": [
- "string"
], - "muted": true,
- "name": "string",
- "owner": "string",
- "photo": "string",
- "topic": "string"
}, - "message": "string",
- "success": true
}Update group info by group id
| groupId required | string Group ID |
Group info
| locked | boolean |
| name | string |
| photo | string |
| topic | string |
{- "locked": true,
- "name": "string",
- "photo": "string",
- "topic": "string"
}{- "groups": {
- "admins": [
- "string"
], - "archived": true,
- "broadcast": true,
- "community_id": "string",
- "created": "string",
- "ephemeral": true,
- "id": "string",
- "locked": true,
- "members": [
- "string"
], - "muted": true,
- "name": "string",
- "owner": "string",
- "photo": "string",
- "topic": "string"
}, - "message": "string",
- "success": true
}Demote group admins by group id
| groupId required | string Group ID |
Group members
| id | string |
[- {
- "id": "string"
}
]{- "data": {
- "added": [
- {
- "id": "string"
}
], - "demoted": [
- {
- "id": "string"
}
], - "errors": [
- {
- "code": "string",
- "error": 0,
- "expiration": "string",
- "id": "string"
}
], - "promoted": [
- {
- "id": "string"
}
], - "removed": [
- {
- "id": "string"
}
]
}, - "message": "string",
- "success": true
}Promote group admins by group id
| groupId required | string Group ID |
Group members
| id | string |
[- {
- "id": "string"
}
]{- "data": {
- "added": [
- {
- "id": "string"
}
], - "demoted": [
- {
- "id": "string"
}
], - "errors": [
- {
- "code": "string",
- "error": 0,
- "expiration": "string",
- "id": "string"
}
], - "promoted": [
- {
- "id": "string"
}
], - "removed": [
- {
- "id": "string"
}
]
}, - "message": "string",
- "success": true
}Lock group by id, so only admins can update group info like name, icon description and so.
| groupId required | string Group ID |
{- "data": null,
- "message": "string",
- "success": true,
- "timestamp": "string"
}Delete group members by group id
| groupId required | string Group ID |
Group members
| id | string |
[- {
- "id": "string"
}
]{- "data": {
- "added": [
- {
- "id": "string"
}
], - "demoted": [
- {
- "id": "string"
}
], - "errors": [
- {
- "code": "string",
- "error": 0,
- "expiration": "string",
- "id": "string"
}
], - "promoted": [
- {
- "id": "string"
}
], - "removed": [
- {
- "id": "string"
}
]
}, - "message": "string",
- "success": true
}Add group members by group id
| groupId required | string Group ID |
Group members
| id | string |
[- {
- "id": "string"
}
]{- "data": {
- "added": [
- {
- "id": "string"
}
], - "demoted": [
- {
- "id": "string"
}
], - "errors": [
- {
- "code": "string",
- "error": 0,
- "expiration": "string",
- "id": "string"
}
], - "promoted": [
- {
- "id": "string"
}
], - "removed": [
- {
- "id": "string"
}
]
}, - "message": "string",
- "success": true
}Approve group members requests by group id
| groupId required | string Group ID |
Group members
| id | string |
[- {
- "id": "string"
}
]{- "data": null,
- "message": "string",
- "success": true,
- "timestamp": "string"
}Reject group members requests by group id
| groupId required | string Group ID |
Group members
| id | string |
[- {
- "id": "string"
}
]{- "data": null,
- "message": "string",
- "success": true,
- "timestamp": "string"
}Pin group by group id to the top of the chat list
| groupId required | string Group ID |
{- "data": null,
- "message": "string",
- "success": true,
- "timestamp": "string"
}Unlock group by id, so any member can update group info like name, icon description and so.
| groupId required | string Group ID |
{- "data": null,
- "message": "string",
- "success": true,
- "timestamp": "string"
}Unpin group by group id from the top of the chat list
| groupId required | string Group ID |
{- "data": null,
- "message": "string",
- "success": true,
- "timestamp": "string"
}Update the contact name
Contact object
| id | integer |
object (handlers.ContactUpdateInfo) |
{- "id": 0,
- "info": {
- "first_name": "string",
- "full_name": "string"
}
}{- "data": null,
- "message": "string",
- "success": true,
- "timestamp": "string"
}Check if the contact is on WhatsApp
Phone numbers
| id | string |
[- {
- "id": "string"
}
]{- "data": {
- "property1": true,
- "property2": true
}, - "message": "string",
- "success": true
}Get the contacts that can see the status
{- "data": [
- {
- "id": 0,
- "info": {
- "businessName": "string",
- "firstName": "string",
- "found": true,
- "fullName": "string",
- "pushName": "string"
}
}
], - "message": "string",
- "success": true
}"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.
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 |
{- "audio": {
- "caption": "string",
- "filename": "string",
- "id": "string",
- "link": "string"
}, - "context": {
- "disappearing_timer": 0,
- "group_id": "string",
- "mentions": [
- "string"
], - "message_id": "string",
- "participant_id": "string",
- "quoted_text": "string"
}, - "document": {
- "caption": "string",
- "filename": "string",
- "id": "string",
- "link": "string"
}, - "id": "string",
- "image": {
- "caption": "string",
- "filename": "string",
- "id": "string",
- "link": "string"
}, - "interactive": {
- "action": {
- "button": "string",
- "buttons": [
- {
- "copy_code": "string",
- "display_text": "string",
- "id": "string",
- "phone_number": "string",
- "reply": {
- "id": "string",
- "title": "string"
}, - "sections": [
- {
- "highlight_label": "string",
- "rows": [
- {
- "description": "string",
- "header": "string",
- "id": "string",
- "title": "string"
}
], - "title": "string"
}
], - "title": "string",
- "type": "reply",
- "url": "string"
}
], - "name": "cta_call",
- "parameters": {
- "copy_code": "string",
- "display_text": "string",
- "id": "string",
- "phone_number": "string",
- "reply": {
- "id": "string",
- "title": "string"
}, - "sections": [
- {
- "highlight_label": "string",
- "rows": [
- {
- "description": "string",
- "header": "string",
- "id": "string",
- "title": "string"
}
], - "title": "string"
}
], - "title": "string",
- "type": "reply",
- "url": "string"
}, - "sections": [
- {
- "highlight_label": "string",
- "rows": [
- {
- "description": "string",
- "header": "string",
- "id": "string",
- "title": "string"
}
], - "title": "string"
}
]
}, - "body": {
- "text": "string"
}, - "footer": {
- "text": "string"
}, - "header": {
- "image": {
- "caption": "string",
- "filename": "string",
- "id": "string",
- "link": "string"
}, - "text": "string",
- "type": "text",
- "video": {
- "caption": "string",
- "filename": "string",
- "id": "string",
- "link": "string"
}
}, - "type": "list"
}, - "invite": {
- "caption": "string",
- "code": "string",
- "expiration": "string",
- "id": "string",
- "name": "string"
}, - "location": {
- "address": "string",
- "latitude": 0,
- "longitude": 0,
- "name": "string"
}, - "participants": [
- "string"
], - "poll": {
- "multiple": false,
- "options": [
- "string"
], - "question": "string"
}, - "preview_url": false,
- "reaction": {
- "emoji": "string",
- "message_id": "string"
}, - "recipient_type": "individual",
- "status": "read",
- "text": {
- "background_color": "string",
- "body": "string",
- "font": "SYSTEM",
- "text_color": "string"
}, - "to": "string",
- "type": "text",
- "video": {
- "caption": "string",
- "filename": "string",
- "id": "string",
- "link": "string"
}
}{- "data": {
- "message_id": "string",
- "poll_options": {
- "property1": "string",
- "property2": "string"
}
}, - "message": "string",
- "success": true,
- "timestamp": "string"
}