> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opigno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a community

Communities are a part of social features functionality provided by Opigno Enterprise.
They allow to group users by interests and discuss different topics by sharing posts inside a community.
A community can be created by any user associated with a context with `AUTHENTICATED` scope.
The current API user will be set as a community owner and will not be considered as a member.

To create a community, `createCommunity` mutation should be executed.
Mutation has a single required incoming argument - `data` that represents `CommunityInput` object:

| Parameter                 | Type                                                                                 | Description                                                                                                                                                                                                                                      | Default |
| :------------------------ | :----------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `title`                   | `String`                                                                             | **Required**. Represents the community title.                                                                                                                                                                                                    | —       |
| `description`             | `String`                                                                             | **Required**. A community description. Available HTML tags are: `<br>`, `<p>`, `<h2>`, `<h3>`, `<h4>`, `<h5>`, `<h6>`, `<strong>`, `<em>`, `<u>`, `<s>`, `<sub>`, `<sup>`, `<a href>`, `<ul>`, `<ol start>`, `<li>`. Any other tag will trimmed. | —       |
| `visibility`              | `CommunityVisibility`                                                                | **Required**. A community [visibility](/OpignoEnterpriseAPI/Community/GetCommunity#community-visibility).                                                                                                                                        | —       |
| `postNotificationEnabled` | `Boolean`                                                                            | A flag that indicates that a notification about a new post is enabled.                                                                                                                                                                           | `true`  |
| `imageBase64`             | [`UploadedFileInput`](/OpignoEnterpriseAPI/Post/CreatePost#uploadedfileinput-object) | The community image formatted as base64 string.                                                                                                                                                                                                  | —       |

<CodeGroup>
  ```filename GraphQL theme={null}
    mutation createCommunity {
      createCommunity(data: {
        title: "Example community",
        description: "<p>This is an example of the communtiy creation with the Opigno Enterprise API.</p>",
        visibility: PUBLIC,
        postNotificationEnabled: false,
        imageBase64: {
          filename: "Opigno_logo.png",
          contentBase64: "iVBORw0KGgoAAAANSUhEUgAAAfQAAAB0CAYAAABzEcD[...]ggYAoaAIdBEBP4PcmKcThyYmiAAAAAASUVORK5CYII="
        }
      }) {
        errors
        response {
          id
          created
          description
          membersNumber
          postNotificationEnabled
          title
          visibility
          ownerUserContext {
            displayName
            id
            uuid
          }
          lastPostTime
          image {
            url
          }
          cta {
            actionId
            title
            arguments {
              key
              value
            }
          }
        }
      }
    }
  ```

  ```File Query result [expandable] theme={null}
  {
    "data": {
      "createCommunity": {
        "errors": [],
        "response": {
          "id": "2",
          "created": 1757139550,
          "description": "<p>This is an example of the communtiy creation with the Opigno Enterprise API.</p>\n",
          "membersNumber": 0,
          "postNotificationEnabled": false,
          "title": "Example community",
          "visibility": "PUBLIC",
          "ownerUserContext": {
            "displayName": "John Doe",
            "id": "1",
            "uuid": "b004e1a8-ec3d-40ec-bf05-8b53a58843a1"
          },
          "lastPostTime": null,
          "image": {
            "url": "http://opigno-enterprise.docksal.site/sites/default/files/2025-09/Opigno_logo.png"
          },
          "cta": [
            {
              "actionId": "EDIT_COMMUNITY",
              "title": "Edit",
              "arguments": [
                {
                  "key": "communityId",
                  "value": "2"
                }
              ]
            },
            {
              "actionId": "VIEW_MEMBERS",
              "title": "Members",
              "arguments": [
                {
                  "key": "communityId",
                  "value": "2"
                }
              ]
            },
            {
              "actionId": "VIEW_SENT_INVITATIONS",
              "title": "Invitations sent",
              "arguments": [
                {
                  "key": "communityId",
                  "value": "2"
                }
              ]
            },
            {
              "actionId": "DELETE_COMMUNITY",
              "title": "Delete the community",
              "arguments": [
                {
                  "key": "communityId",
                  "value": "2"
                }
              ]
            },
            {
              "actionId": "INVITE_TO_COMMUNITY",
              "title": "Invite",
              "arguments": [
                {
                  "key": "communityId",
                  "value": "2"
                }
              ]
            },
            {
              "actionId": "CREATE_POST",
              "title": "Create post",
              "arguments": [
                {
                  "key": "communityId",
                  "value": "2"
                }
              ]
            }
          ]
        }
      }
    }
  }
  ```
</CodeGroup>

The mutation returns a `Community` object. Detailed description and the full list of available properties can be found [here](/OpignoEnterpriseAPI/GetCommunity).
