> ## Documentation Index
> Fetch the complete documentation index at: https://social-b97141fb-auto-generate-llmstxt.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Room Posts

> Create feed posts that reference an existing live room.

Room posts publish an existing room into a user or community feed. Create the room first through the room or video APIs, then pass its `roomId` to the post creation API.

<Note>
  Room posts are the current path for new live and co-host room experiences. This page focuses only on creating the feed post from an existing `roomId`.
</Note>

## Parameters

| Parameter    | Required | Description                                          |
| ------------ | -------- | ---------------------------------------------------- |
| `roomId`     | Yes      | ID of the room to attach to the post                 |
| `text`       | No       | Caption text shown with the post                     |
| `title`      | No       | Optional title stored in the room post data          |
| `targetType` | Yes      | Feed target, usually `community` or `user`           |
| `targetId`   | Yes      | Community ID or user ID for the target feed          |
| `metadata`   | No       | Custom metadata stored with the post where supported |

## Create a Room Post

Create a room post after the room already exists, then use the returned post in the target user or community feed.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { PostRepository } from "@amityco/ts-sdk";

  const { data: post } = await PostRepository.createRoomPost({
    targetType: "community",
    targetId: communityId,
    data: {
      roomId,
      text: "Join this live room",
      title: "Live room",
    },
  });
  ```

  ```kotlin Android theme={null}
  fun createRoomPost(roomId: String, communityId: String) {
      postRepository.createRoomPost(
          targetType = AmityPost.TargetType.COMMUNITY,
          targetId = communityId,
          roomId = roomId,
          text = "Join this live room",
          title = "Live room"
      )
          .subscribe(
              { post -> showSuccessMessage(post.getPostId()) },
              { error -> handleGeneralError(error) }
          )
  }
  ```

  ```swift iOS theme={null}
  func createRoomPost(roomId: String, communityId: String) async throws -> AmityPost {
      let postRepository = AmityPostRepository()
      let builder = AmityRoomPostBuilder(
          roomId: roomId,
          text: "Join this live room"
      )
      builder.setTitle("Live room")

      return try await postRepository.createRoomPost(
          builder,
          targetId: communityId,
          targetType: .community,
          metadata: nil,
          mentionees: nil
      )
  }
  ```
</CodeGroup>

<Info>
  The current Flutter public post creation builder does not expose a room post creator. Use another supported SDK or backend flow when your product needs to publish room posts from Flutter.
</Info>

## Platform Notes

* TypeScript exposes `PostRepository.createRoomPost()`.
* Android exposes `AmityPostRepository.createRoomPost()`.
* iOS exposes `AmityPostRepository.createRoomPost()` with `AmityRoomPostBuilder`.
* Flutter does not currently expose a public room post creation method.

## Related Topics

<CardGroup cols={3}>
  <Card title="Live Stream Posts" icon="circle-video" href="./live-stream-post">
    Review the deprecated legacy live stream post path.
  </Card>

  <Card title="Video Posts" icon="film" href="./video-post">
    Create posts from uploaded video files.
  </Card>

  <Card title="Content Management" icon="newspaper" href="/social-plus-sdk/social/content-management/overview">
    Review posts, comments, reactions, and sharing concepts.
  </Card>
</CardGroup>
