# Join a Community

## Join a Community

<mark style="color:green;">`POST`</mark> `https://api.whisk.com/community/v2/{community_id}/join`

You can use the following path parameter to join a particular community:

#### Path Parameters

| Name          | Type   | Description                                                                |
| ------------- | ------ | -------------------------------------------------------------------------- |
| community\_id | string | The community identifier. For example, `d25506c2690f4b81b2050b9b90bda3b7`. |

#### Headers

| Name           | Type   | Description                                                                                                                |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------------------------- |
| Authentication | string | User Access token containing `community:write` scope to authorize the API usage. For more information, see Authentication. |

{% tabs %}
{% tab title="200 This is how a successful response looks." %}

```graphql
{
  "permissions": {
    "role": "COMMUNITY_ROLE_INVALID",
    "mode": "COMMUNITY_CONTRIBUTION_PERMISSION_MODE_INVALID",
    "visibility": "COMMUNITY_VISIBILITY_INVALID"
  }
}
```

{% endtab %}

{% tab title="400 This failed response appears when error codes are found in the endpoint query." %}

```yaml
{
  "error_code": "REAL_CODES_ARE_IN_ENDPOINT_DESCRIPTION",
  "message": "Additional details about error are not static and can be changed"
}
```

{% endtab %}

{% tab title="401 This failed response appears due to API authentication failure. The possible error codes that may appear are:auth.tokenNotFound, auth.tokenExpired, auth.tokenInvalid, auth.tokenRequired." %}

```yaml
{
  "code": "auth.tokenNotFound"
}
```

{% endtab %}

{% tab title="500 This failed response appears when something is not right on Whisk's end. Please send a message to <help@whisk.com>, and be sure to include both the Request and Response data. We’ll get back to you soon." %}

```yaml
This is unexpected response, something is wrong on our side, please contact: help@whisk.com
```

{% endtab %}
{% endtabs %}

### Sample Request and Response

{% tabs %}
{% tab title="Curl Request" %}

```bash
curl -X POST "https://api.whisk.com/community/v2/69129600a88f499795ec047c2b5f69c4/join"
    -H "Accept: application/json" 
    -H "Authorization: Bearer <YOUR-API-ACCESS-KEY>"
```

{% hint style="info" %}
Whisk allows you to discover and understand its API capabilities on the Swagger interface with the ability to try out the API calls directly in your browser. You can call this endpoint [here](https://api.whisk.com/spec/#/CommunityMembershipAPI/CommunityMembershipAPI_JoinPublicCommunity).
{% endhint %}
{% endtab %}

{% tab title="Response" %}

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

{% endtab %}
{% endtabs %}
