Skip to content

WhatsApp Groups API

Use these endpoints to create WhatsApp groups, list and sync them from Meta, manage invite links and join requests, remove participants, and send text, media, or template messages to a group.

Participants cannot be added through the API. Share the group invite link so members can join themselves.

Headers

  • Name
    Content-Type
    Type
    string
    Description

    application/json

  • Name
    apikey
    Type
    string
    Description

    Dashboard API key. See Authentication.


Create Group

Create a new WhatsApp group on the selected business number. Meta creates groups asynchronously, so metaGroupId and inviteLink may be empty at first. Use Sync groups from Meta if the group does not appear immediately.

Required attributes

  • Name
    subject
    Type
    string
    Description

    Group name. Maximum 128 characters.

  • Name
    phoneNumberId
    Type
    string
    Description

    Phone number ID of the WhatsApp Business number that owns the group. Provide this or whatsappNumberId.

Optional attributes

  • Name
    whatsappNumberId
    Type
    string
    Description

    Internal WhatsApp number ID. Use this if you do not have phoneNumberId.

  • Name
    description
    Type
    string
    Description

    Group description. Maximum 2048 characters.

  • Name
    joinApprovalMode
    Type
    string
    Description

    Who can join via the invite link. Use auto_approve or approval_required.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/createGroup' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "subject": "Support Group",
  "description": "Customer support group",
  "joinApprovalMode": "auto_approve",
  "phoneNumberId": "123456789012345"
}'

Response

{
  "groupName": "Support Group",
  "groupDescription": "Customer support group",
  "phoneNumberId": "123456789012345",
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
  "inviteLink": "https://chat.whatsapp.com/XXXX",
  "joinApprovalMode": "auto_approve",
  "status": "active",
  "pending": false,
  "message": "Group created successfully",
  "error": null
}

Get Groups List

Returns groups stored for the API key, with optional search and pagination.

Optional attributes

  • Name
    phoneNumberId
    Type
    string
    Description

    Filter groups by WhatsApp Business phone number ID.

  • Name
    searching
    Type
    string
    Description

    Search by group name. Maximum 128 characters.

  • Name
    page
    Type
    number
    Description

    Page number. Defaults to 1.

  • Name
    limit
    Type
    number
    Description

    Results per page. Defaults to 10, maximum 100.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/getGroupsList' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "phoneNumberId": "123456789012345",
  "searching": "Support",
  "page": 1,
  "limit": 10
}'

Response

{
  "data": {
    "groups": [
      {
        "groupName": "Support Group",
        "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
        "phoneNumberId": "123456789012345",
        "inviteLink": "https://chat.whatsapp.com/XXXX",
        "status": "active"
      }
    ],
    "pagination": {
      "currentPage": 1,
      "totalPages": 1,
      "totalGroups": 1,
      "limit": 10
    }
  },
  "message": "Groups list fetched successfully",
  "error": null
}

Sync Groups From Meta

Pulls groups from Meta into the platform. Use this after creating a group, or to import groups created outside the API.

Optional attributes

  • Name
    phoneNumberId
    Type
    string
    Description

    Sync groups for this number only. If omitted, all numbers on the account are synced.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/syncGroupsFromMeta' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "phoneNumberId": "123456789012345"
}'

Response

{
  "data": {
    "synced": 3
  },
  "message": "Groups synced from Meta successfully",
  "error": null
}

Get Group By ID

Returns stored group details merged with live Meta data such as participants, approval mode, and suspension state.

Required attributes

  • Name
    metaGroupId
    Type
    string
    Description

    WhatsApp group ID returned when the group is created or synced.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/getGroupById' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX"
}'

Response

{
  "data": {
    "groupName": "Support Group",
    "groupDescription": "Customer support group",
    "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
    "phoneNumberId": "123456789012345",
    "joinApprovalMode": "auto_approve",
    "inviteLink": "https://chat.whatsapp.com/XXXX",
    "participants": [],
    "totalParticipants": 1
  },
  "message": "Group details fetched successfully",
  "error": null
}

Update Group

Updates the group subject and/or description. At least one of those fields is required.

Required attributes

  • Name
    metaGroupId
    Type
    string
    Description

    WhatsApp group ID.

Optional attributes

  • Name
    subject
    Type
    string
    Description

    New group name. Maximum 128 characters.

  • Name
    description
    Type
    string
    Description

    New group description. Maximum 2048 characters.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/updateGroup' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
  "subject": "Updated Support Group",
  "description": "Updated description"
}'

Response

{
  "data": {
    "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
    "subject": "Updated Support Group",
    "description": "Updated description"
  },
  "message": "Group updated successfully",
  "error": null
}

Delete Group

Deletes the group on Meta and marks it inactive on the platform.

Required attributes

  • Name
    metaGroupId
    Type
    string
    Description

    WhatsApp group ID.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/deleteGroup' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX"
}'

Response

{
  "data": {
    "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX"
  },
  "message": "Group deleted successfully",
  "error": null
}

Returns the current invite link. Members join through this link because WhatsApp does not allow adding participants via API.

Required attributes

  • Name
    metaGroupId
    Type
    string
    Description

    WhatsApp group ID.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/getGroupInviteLink' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX"
}'

Response

{
  "data": {
    "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
    "inviteLink": "https://chat.whatsapp.com/XXXX"
  },
  "message": "Invite link fetched successfully",
  "error": null
}

Invalidates the previous invite link and returns a new one.

Required attributes

  • Name
    metaGroupId
    Type
    string
    Description

    WhatsApp group ID.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/resetGroupInviteLink' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX"
}'

Response

{
  "data": {
    "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
    "inviteLink": "https://chat.whatsapp.com/YYYY"
  },
  "message": "Invite link reset successfully",
  "error": null
}

Add Participants

WhatsApp does not allow adding participants through the API. This endpoint always returns an error. Share the invite link instead.

Required attributes

  • Name
    metaGroupId
    Type
    string
    Description

    WhatsApp group ID.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/addParticipants' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX"
}'

Response

{
  "error": true,
  "message": "WhatsApp does not allow adding participants via API. Share the group invite link instead."
}

Remove Participants

Removes 1 to 8 unique phone numbers from the group. Meta allows a maximum of 8 removals per request.

Required attributes

  • Name
    metaGroupId
    Type
    string
    Description

    WhatsApp group ID.

  • Name
    participants
    Type
    array
    Description

    Phone numbers to remove, with country code. Example: ["+91XXXXXXXXXX"].

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/removeParticipants' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
  "participants": [
    "+91XXXXXXXXXX"
  ]
}'

Response

{
  "data": {
    "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
    "removed": ["+91XXXXXXXXXX"]
  },
  "message": "Participants removed successfully",
  "error": null
}

Send Text Message

Sends a text message to the group.

Required attributes

  • Name
    metaGroupId
    Type
    string
    Description

    WhatsApp group ID.

  • Name
    messageType
    Type
    string
    Description

    Use text.

  • Name
    messageContent
    Type
    string
    Description

    Message body. Maximum 4096 characters.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/sendGroupMessage' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
  "messageType": "text",
  "messageContent": "Hello group"
}'

Response

{
  "data": {
    "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
    "messageId": "wamid.XXXX",
    "status": "sent"
  },
  "message": "Message sent to group successfully",
  "error": null
}

Send Media Message

Sends an image, video, or document to the group using a publicly accessible URL.

Required attributes

  • Name
    metaGroupId
    Type
    string
    Description

    WhatsApp group ID.

  • Name
    messageType
    Type
    string
    Description

    Use image, video, or document.

  • Name
    mediaUrl
    Type
    string
    Description

    Public HTTPS URL of the media file.

Optional attributes

  • Name
    caption
    Type
    string
    Description

    Caption shown with the media. Maximum 1024 characters.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/sendGroupMessage' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
  "messageType": "image",
  "mediaUrl": "https://example.com/image.jpg",
  "caption": "Order update"
}'

Response

{
  "data": {
    "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
    "messageId": "wamid.XXXX",
    "status": "sent"
  },
  "message": "Message sent to group successfully",
  "error": null
}

Send Template Message

Sends an approved WhatsApp template to the group. The template must already exist on the account. Language is taken from the stored template, not from the request.

Required attributes

  • Name
    metaGroupId
    Type
    string
    Description

    WhatsApp group ID.

  • Name
    messageType
    Type
    string
    Description

    Use template.

  • Name
    template
    Type
    string
    Description

    Approved template name. This contains only lowercase alphanumeric characters and underscores.

Optional attributes

  • Name
    components
    Type
    object
    Description

    Template variables. Use the same structure as Send Templates: BODY.params for body placeholders, plus header, buttons, or media fields when the template requires them.

  • Name
    otp
    Type
    string
    Description

    One-time password value for authentication templates.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/sendGroupMessage' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
  "messageType": "template",
  "template": "only_text",
  "components": {
    "BODY": {
      "params": [
        "John",
        "ORD-123"
      ]
    }
  }
}'

Response

{
  "data": {
    "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
    "messageId": "wamid.XXXX",
    "status": "sent"
  },
  "message": "Message sent to group successfully",
  "error": null
}

Get Join Requests

Lists pending join requests for groups created with joinApprovalMode set to approval_required.

Required attributes

  • Name
    metaGroupId
    Type
    string
    Description

    WhatsApp group ID.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/getGroupJoinRequests' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX"
}'

Response

{
  "data": {
    "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
    "joinRequests": [
      {
        "join_request_id": "JOIN_REQUEST_ID"
      }
    ]
  },
  "message": "Join requests fetched successfully",
  "error": null
}

Approve Join Requests

Approves one or more pending join requests.

Required attributes

  • Name
    metaGroupId
    Type
    string
    Description

    WhatsApp group ID.

  • Name
    joinRequestIds
    Type
    array
    Description

    Join request IDs returned by Get join requests.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/approveGroupJoinRequests' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
  "joinRequestIds": [
    "JOIN_REQUEST_ID"
  ]
}'

Response

{
  "data": {
    "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
    "approved": ["JOIN_REQUEST_ID"],
    "failed": []
  },
  "message": "Join requests approved successfully",
  "error": null
}

Reject Join Requests

Rejects one or more pending join requests.

Required attributes

  • Name
    metaGroupId
    Type
    string
    Description

    WhatsApp group ID.

  • Name
    joinRequestIds
    Type
    array
    Description

    Join request IDs returned by Get join requests.

Request

curl --location --request POST 'https://api.azmarq.com/v1/whatsapp/rejectGroupJoinRequests' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
  "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
  "joinRequestIds": [
    "JOIN_REQUEST_ID"
  ]
}'

Response

{
  "data": {
    "metaGroupId": "Y2FwaV9ncm91cDoXXXXXXXX",
    "rejected": ["JOIN_REQUEST_ID"],
    "failed": []
  },
  "message": "Join requests rejected successfully",
  "error": null
}

Was this page helpful?