Create / Delete Group Invite Link

Get WhatsApp Group Invite Link API

This API allows you to retrieve the invite link for an existing WhatsApp group created through your Gupshup app.


Endpoint

POST  {{API_FRONT_URL}}/app/{APP_ID}/group/{GROUP_ID}/invite_link

Headers

KeyDescriptionRequired
apikeyAPI key of the account where the app exists. Must be a valid Gupshup.io API key.✅ Yes
Content-TypeMust be application/json.✅ Yes

Path parameters

ParameterDescriptionRequiredConstraints
APP_IDID of your WhatsApp app✅ YesMust be a valid Gupshup App ID
GROUP_IDID of the WhatsApp group✅ YesMust be a valid group ID

Request Body

Content-Type: application/json

{
  "messaging_product": "whatsapp"
}

Body Parameters

KeyDescriptionRequiredConstraints
messaging_productMust be "whatsapp"✅ YesFixed value

Response

Success (HTTP 200)

{
  "invite_link": "https://chat.whatsapp.com/LINK_ID",
  "messaging_product": "whatsapp",
  "status": "success"
}

Error
If the request fails, an appropriate HTTP status code and error message will be returned. Ensure your APP_ID, GROUP_ID, and apikey are valid and active.

Response Parameters

KeyDescription
invite_linkA WhatsApp group invite link. Always begins with https://chat.whatsapp.com/ and ends with a unique LINK_ID.
messaging_productWill be "whatsapp"
statusStatus of the request, e.g., "success"

Example cURL

curl --location --globoff '{{API_FRONT_URL}}/app/{{APP_ID}}/group/{{GROUP_ID}}/invite_link' \
--header 'Content-Type: application/json' \
--header 'apikey: {{API_KEY}}' \
--data '{
    "messaging_product": "whatsapp"
}'

Notes

  1. The invite_link can be used to invite users to the WhatsApp group.
  2. Only works for groups created and managed via the Gupshup platform.


Delete WhatsApp Group Invite Link API

This API deletes the invite link for a specific WhatsApp group created through the Gupshup platform.


Endpoint

DELETE {{API_FRONT_URL}}/app/{APP_ID}/group/{GROUP_ID}/invite_link

Headers

KeyDescriptionRequired
apikeyAPI key of the account where the app exists. Must be a valid Gupshup.io API key.✅ Yes
Content-TypeMust be application/json.✅ Yes

Path parameters

ParameterDescriptionRequiredConstraints
APP_IDID of your WhatsApp app✅ YesMust be a valid Gupshup App ID
GROUP_IDID of the WhatsApp group✅ YesMust be a valid group ID

Request Body

Content-Type: application/json

{
  "messaging_product": "whatsapp"
}

Body Parameters

KeyDescriptionRequiredConstraints
messaging_productMust be "whatsapp"✅ YesFixed value

Response

Success (HTTP 200)

{
  "messaging_product": "whatsapp",
  "request_id": "REQUEST_ID",
  "status": "success"
}

Error
If the request fails, the server will return an appropriate HTTP status code and an error message.

Example cURL

curl --location --globoff --request DELETE '{{API_FRONT_URL}}/app/{{APP_ID}}/group/{{GROUP_ID}}/invite_link' \
--header 'Content-Type: application/json' \
--header 'apikey: {{API_KEY}}' \
--data '{
    "messaging_product": "whatsapp"
}'

Notes

  1. Once deleted, the group’s existing invite link becomes invalid.
  2. A new invite link must be generated if needed.