# Send announcement

To send a message (to post announcement) to a Community, you need to find out the exact ID of the group attached to that community.

Read more about it here: [#important-aspects-of-the-api-community](https://support.whapi.cloud/help-desk/introduction#important-aspects-of-the-api-community "mention")

***

### How to find the correct Announcements group

To send announcements to your Community, you need to use the dedicated **Announcements group**, which is technically separate from the Community’s main group.

The easiest and most reliable way to retrieve it is by using [the endpoint](https://whapi.readme.io/reference/getcommunitysubgroups):

```bash
GET /communities/{CommunityID}/subgroups
```

This call returns all subgroups linked to the Community — including the Announcements group.

Within the response, look for the group that has:

* `isCommunityAnnounce`: true
* `"linkedParent"` matching your Community ID
* The **same name** as your Community, but a **different ID**

Alternatively, you can also:

* Manually send a message from your phone and check the `chat_id` in the webhook event — that’s the ID of the Announcements group.

This approach removes the guesswork and ensures you are sending announcements to the correct destination.

***

Sending an announcement to a community is completely identical and follows the rules for sending a message to a group. To send this message, use this endpoint:

`POST https://gate.whapi.cloud/messages/text`

{% embed url="<https://whapi.readme.io/reference/sendmessagetext>" %}
This endpoint will allow you to send messages through the API
{% endembed %}

```
curl --request POST \
     --url https://gate.whapi.cloud/messages/text \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {your_token}' \
     --header 'content-type: application/json' \
     --data '
{
  "to": "120363297265854901@g.us",
  "body": "My first announcement"
}
'
```

We wrote more about how to post to a group here: [send-group-message](https://support.whapi.cloud/help-desk/sending/send-group-message "mention")


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.whapi.cloud/help-desk/communities/send-announcement.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
