# Community

Let's first understand the Community object and its data structure before looking at its endpoints’ description.

## Community Object

A Community object is a collection of arrays and attributes that defines the data structure for any given community.

This is how the data structure of a community looks:

```graphql
{
  "community": {
    "id": "39d539c738eb47debfb1a6319d34235a",
    "name": "WAPID Community",
    "image": {
      ...
    },
    "description": "Food and fun with WAPID!",
    "topics": [
      {
        "id": "914d167bb1754adbbcd1f085cdcc4f6c",
        "display_name": "Family Friendly"
      }
    ],
    "social_settings": {
      "website_url": "https://wapid.com/",
      "instagram_username": "wapid",
      "youtube_channel_url": "https://www.youtube.com/channel/WAPID",
      "tiktok_username": "wapid"
    },
     "permissions": {
      "role": "COMMUNITY_ROLE_OWNER",
      "mode": "COMMUNITY_CONTRIBUTION_PERMISSION_MODE_ANYONE",
      "visibility": "COMMUNITY_VISIBILITY_PUBLIC"
    },
    "members": {
      "count": 1
    },
    "recipes": {
      "count": 2
    },
    "is_sponsored": true
  }
}
```

### Core Data

The following attributes define the core of a community:

| Attribute | Type   | Description                          |
| --------- | ------ | ------------------------------------ |
| `id`      | string | The community identifier.            |
| `name`    | string | The full name of the community.      |
| `image`   | object | The community's cover image details. |

#### Image

The `image` object contains the following attributes that store details of the cover image added in the community.

```graphql
"image": {
    "url": "https://image-cdn.whisk.com/image/upload/v1611066523/v3/user-recipes/nfaul13bavzqyiirk0sl.jpg",
    "width": 1280,
    "height": 854
    "selection": {
      "x": 0,
      "y": 88,
      "width": 422,
      "height": 767
    }
},
```

| Attribute   | Type   | Description                                                                                |
| ----------- | ------ | ------------------------------------------------------------------------------------------ |
| `url`       | string | The cover image URL.                                                                       |
| `width`     | string | Image width.                                                                               |
| `height`    | string | Image height.                                                                              |
| `selection` | object | It contains the `x` and `y` coordinates and the actual size of the cover image on display. |

### Optional Data

The community data structure may include extra information based on any additional parameters included in the API request.

| Attribute         | Type    | Description                                                                                                                                                   |
| ----------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `description`     | string  | A summary describing the community.                                                                                                                           |
| `topics`          | array   | A list of topics that include the community. For more information, see [topics](#topics).                                                                     |
| `social_settings` | object  | It contains the community's account on various social platforms like Facebook, Instagram, etc. For more information, see [social settings](#social-settings). |
| `permissions`     | object  | It contains the different permissions configured for the community. For more information, see [permissions](#permissions).                                    |
| `members`         | object  | It contains the count of members in the community.                                                                                                            |
| `recipes`         | object  | It contains the count of recipes added to the community.                                                                                                      |
| `is_sponsored`    | boolean | Indicates if the community is commercially sponsored or not.                                                                                                  |

#### Topics

Topics are categories that appear on the home page of your Whisk app or website like - Featured Communities, 30 Minutes Meals, Quick and Healthy, etc. Each community is assigned a category at the time of its creation, and later we may also add it to the Featured Communities topic if we like it. The `topics` array contains a list of such topics that include the community.

```graphql
"topics": [
    {
      "id": "914d167bb1754adbbcd1f085cdcc4f6c",
      "display_name": "Family Friendly"
    },
    {
      "id": "69f7f66c4c774fcf90ba4d5762f06517",
      "display_name": "Featured Communities"
    }
],
```

Each topic contains the following attributes:

| Attribute      | Type   | Description                                             |
| -------------- | ------ | ------------------------------------------------------- |
| `id`           | string | The topic identifier.                                   |
| `display_name` | string | Topic's name as it appears on the Whisk website or app. |

#### Social Settings

This object contains details on the community's presence on different social platforms.

```graphql
"social_settings": {
    "website_url": "https://wapid.com/",
    "instagram_username": "@wapid",
    "youtube_channel_url": "https://www.youtube.com/channel/WAPID",
    "tiktok_username": "@wapid"
},
```

| Attribute             | Type   | Description                         |
| --------------------- | ------ | ----------------------------------- |
| `website_url`         | string | The community's website.            |
| `instagram_username`  | string | The community's Instagram username. |
| `youtube_channel_url` | string | The community channel on Youtube.   |
| `tiktok_username`     | string | The community's TikTok username.    |

#### Permissions

This object contains information on your role in the community and other details like the community's general visibility and contribution scope.

```graphql
"permissions": {
    "role": "COMMUNITY_ROLE_OWNER",
    "mode": "COMMUNITY_CONTRIBUTION_PERMISSION_MODE_ANYONE",
    "visibility": "COMMUNITY_VISIBILITY_PUBLIC"
},
```

| Attribute    | Type | Description                                                                                            | Supported Values                                                                                                                                                                                                                                                                                                                     |
| ------------ | ---- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `role`       | enum | Indicates your role in the community.                                                                  | <ul><li><code>COMMUNITY\_ROLE\_INVALID</code></li><li><code>COMMUNITY\_ROLE\_UNSET</code></li><li><code>COMMUNITY\_ROLE\_OWNER</code></li><li><code>COMMUNITY\_ROLE\_ADMIN</code></li><li><code>COMMUNITY\_ROLE\_MEMBER</code></li><li><code>COMMUNITY\_ROLE\_BLOCKED</code></li><li><code>COMMUNITY\_ROLE\_PENDING</code></li></ul> |
| `mode`       | enum | Indicates the contribution mode configured for the community. By default, it is set to `Anyone`.       | <ul><li><code>COMMUNITY\_CONTRIBUTION\_PERMISSION\_MODE\_INVALID</code></li><li><code>COMMUNITY\_CONTRIBUTION\_PERMISSION\_MODE\_ANYONE</code></li><li><code>COMMUNITY\_CONTRIBUTION\_PERMISSION\_MODE\_ADMINS</code></li></ul>                                                                                                      |
| `visibility` | enum | Indicates the community's visibility on the Whisk's website or app. By default, it is set to `Public`. | <ul><li><code>COMMUNITY\_VISIBILITY\_INVALID</code></li><li><code>COMMUNITY\_VISIBILITY\_PUBLIC</code></li><li><code>COMMUNITY\_VISIBILITY\_PRIVATE</code></li></ul>                                                                                                                                                                 |

## Endpoints

Community API includes the following endpoints that you can use to pull, discover or search communities and their details.

{% content-ref url="/pages/-MRUkJajH2C56fELgffz" %}
[Get your Communities](/api/community/get-your-communities.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MRVh3XnZxbe-XqrxdUI" %}
[Get Communities from a Topic](/api/community/get-communities-by-topic.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MRWiGJWNtxaXggHZeju" %}
[Discover Recommended Communities](/api/community/discover-recommended-communities.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MRWof8zuY6C6rYVr5u\_" %}
[Search Communities](/api/community/search-communities.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MRe7-guHmLmgqSvykWB" %}
[Get a Community](/api/community/get-a-community.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MReATMkTSRIG9tpZ7k2" %}
[Get Recipes from a Community](/api/community/get-recipes-from-a-community.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MU8Em8i-zp\_EFa8YGXG" %}
[Add Recipes to a Community](/api/community/add-recipes-to-a-community.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MU8ExlcTva-bct0l8RB" %}
[Remove a Recipe from a Community](/api/community/remove-a-recipe-from-a-community.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MU8FKXyKV0-uhRNZeKY" %}
[Join a Community](/api/community/join-a-community.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MU8FQXeh0OD7m1\_D2kJ" %}
[Leave a Community](/api/community/leave-a-community.md)
{% endcontent-ref %}


---

# 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://docs.whisk.com/api/community.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.
