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

# Update Community

> Update community profile, visibility, categories, moderation, story, and metadata settings with the SDK.

Use the update API for your platform to change a community's display name, description, avatar, category IDs, privacy mode, post moderation setting, story settings, or custom metadata. TypeScript and Flutter use `updateCommunity()`, while iOS and Android use `editCommunity`.

<Warning>
  The backend enforces who can update a community. In your UI, expose these controls only to users who can manage community settings, such as creators, moderators, or administrators in your product model.
</Warning>

## Parameters

Community updates modify the community record while preserving the same `communityId`. Use them for profile changes, visibility changes, category changes, and moderation-setting changes.

| Setting                          | Platforms                          | Description                                         |
| -------------------------------- | ---------------------------------- | --------------------------------------------------- |
| `communityId`                    | TypeScript, iOS, Android, Flutter  | Required community ID                               |
| `displayName`                    | TypeScript, iOS, Android, Flutter  | Updated display name                                |
| `description`                    | TypeScript, iOS, Android, Flutter  | Updated description                                 |
| `isPublic`                       | TypeScript, iOS, Android, Flutter  | Updated public/private visibility                   |
| `avatarFileId` / `avatar`        | TypeScript / iOS, Android, Flutter | Updated avatar file ID or uploaded SDK image object |
| `categoryIds`                    | TypeScript, iOS, Android, Flutter  | Updated category IDs                                |
| `postSetting` / `postSettings`   | TypeScript, iOS, Android, Flutter  | Updated post creation and review setting            |
| `storySetting` / `storySettings` | TypeScript, iOS, Android, Flutter  | Updated story comment setting                       |
| `metadata`                       | TypeScript, iOS, Android, Flutter  | Updated custom metadata object                      |
| `tags`                           | TypeScript, Android, Flutter       | Updated search/filter tags                          |
| `isDiscoverable`                 | TypeScript, iOS, Android           | Updated discoverability setting                     |
| `requiresJoinApproval`           | TypeScript, iOS, Android           | Updated join approval setting                       |

## Permission Requirements

Do not treat client-side role checks as the source of truth. They are useful for hiding or showing controls, but the SDK call still depends on the permissions enforced by your social.plus backend configuration.

## Update a Community

Use this method for profile, visibility, category, moderation, story, tag, and metadata changes after a community has already been created.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { CommunityPostSettings, CommunityRepository } from '@amityco/ts-sdk';

  async function updateCommunity() {
    const updatedCommunity: Parameters<typeof CommunityRepository.updateCommunity>[1] = {
      avatarFileId: 'fileId',
      description: 'Updated community description',
      displayName: 'Updated community name',
      isPublic: true,
      categoryIds: ['news'],
      tags: ['product'],
      metadata: { topic: 'product' },
      postSetting: CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED,
      storySetting: { enableComment: true },
      isDiscoverable: true,
      requiresJoinApproval: false,
    };

    const { data: community } = await CommunityRepository.updateCommunity(
      'communityId',
      updatedCommunity,
    );

    return community;
  }
  ```

  ```swift iOS theme={null}
  let updateOptions = AmityCommunityUpdateOptions()
  updateOptions.setDisplayName("updated-name")
  updateOptions.setCommunityDescription("updated-description")
  updateOptions.setIsPublic(false)
  updateOptions.setCategoryIds(["categoryId"])
  updateOptions.setPostSettings(.adminReviewPostRequired)
  updateOptions.setStorySettings(allowComment: true)
  updateOptions.setIsDiscoverable(true)
  updateOptions.setRequiresJoinApproval(false)
  updateOptions.setMetadata(["topic": "product"])

  let community = try await communityRepository.editCommunity(withId: "community-id", options: updateOptions)
  ```

  ```kotlin Android theme={null}
  fun editCommunity() {
      val metadata = JsonObject().apply {
          addProperty("topic", "product")
      }

      AmitySocialClient.newCommunityRepository()
          .editCommunity(
              communityId = "communityId1",
              isDiscoverable = true,
              requiresJoinApproval = false
          )
          .displayName("Updated community name")
          .isPublic(isPublic = true)
          .description(description = "Updated community description")
          .categoryIds(categoryIds = listOf("categoryId1", "categoryId2"))
          .tags(tags = listOf("product"))
          .metadata(metadata)
          .postSettings(AmityCommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED)
          .storySettings(AmityCommunityStorySettings(allowComment = true))
          .build()
          .apply()
          .doOnSuccess { community: AmityCommunity ->
              // Community updated.
          }
          .doOnError { error ->
              // Handle error.
          }
          .subscribe()
  }
  ```

  ```dart Flutter theme={null}
  void updateCommunity(String communityId, AmityImage updatingAvatar) {
    AmitySocialClient.newCommunityRepository()
        .updateCommunity(communityId)
        .avatar(updatingAvatar)
        .displayName('Updated community name')
        .description('Updated community description')
        .tags(['product'])
        .categoryIds(['categoryId1', 'categoryId2'])
        .isPublic(false)
        .postSetting(AmityCommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED)
        .storySettings(AmityCommunityStorySettings(allowComment: true))
        .metadata({'topic': 'product'})
        .update()
        .then((AmityCommunity community) {
          // Community updated.
        })
        .onError((error, stackTrace) {
          // Handle error.
        });
  }
  ```
</CodeGroup>

## Privacy and Visibility Updates

### Public to Private Changes

Changing a public community to private affects how users discover and join it:

Changing visibility affects discovery and join flows. Check the resulting community state and update your UI accordingly.

### Private to Public Changes

Changing a private community to public can affect discovery and new membership flows:

Making a community public can make it available to a wider audience, depending on your discovery query and backend configuration.

## Best Practices

<Tip>
  Notify community members about significant updates, such as privacy changes or moderation policy updates, to maintain transparency and community trust.
</Tip>

### Update Guidelines

1. Make small, focused updates rather than large batch changes.
2. Inform members about policy or privacy changes.
3. Preserve important metadata when updating.
4. Validate changes before applying to prevent errors.
5. Test updates in staging environments when possible.

## Related Topics

<CardGroup cols={2}>
  <Card title="Create Community" href="./create-community" icon="plus">
    Learn about initial community creation and setup
  </Card>

  <Card title="Delete Community" href="./delete-community" icon="trash">
    Delete a community and handle client-side cleanup
  </Card>

  <Card title="Community Moderation" href="../organization/community-moderation" icon="shield-check">
    Advanced moderation features and member management
  </Card>

  <Card title="Community Categories" href="../organization/community-categories" icon="folder">
    Organize communities with category management
  </Card>
</CardGroup>
