> ## Documentation Index
> Fetch the complete documentation index at: https://social-b97141fb-feat-user-history-moderation-detail.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. A room post has a text parent and a child room post; product tagging is attached to that post child, not to the room entity itself.

> [!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`.

## Parameters

| Parameter | Required | Platforms | Description |
| - | - | - | - |
| `roomId` | Yes | TypeScript, iOS, Android | ID of the room to attach to the post |
| `text` | No | TypeScript, iOS, Android | Caption text shown on the parent post |
| `title` | No | TypeScript, iOS, Android | Optional title stored in the room child post data |
| `targetType` | Yes | TypeScript, iOS, Android | Feed target, usually `community` or `user` |
| `targetId` | Yes | TypeScript, iOS, Android | Community ID or user ID for the target feed |
| `metadata` | No | TypeScript, iOS, Android | Custom metadata stored with the post where supported |
| `productTags` | No | TypeScript, iOS, Android | Media products available on the child room post; each tag carries `productId` only |
| `pinnedProductId` | No | TypeScript, iOS, Android | Product featured on the child at creation. Must also appear in `productTags` |

> [!NOTE]
>
> **Product tags (SDK API).** Room posts take **media** product tags, which carry a `productId` and nothing else. The positional fields `text`, `index`, and `length` belong to text product tags and do not apply here. `createRoomPost` returns the parent post; pinning, unpinning, and later tag updates target its **child** room post. These are SDK capabilities; UIKit's product-tag UI is a separate surface and may support fewer post types. See [UIKit Product Tagging](/uikit/components/social/product-tagging) for UI coverage and [Livestream Product Tagging](/social-plus-sdk/video-new/broadcasting/product-tagging) for the lifecycle operations.

## 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.

```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",
  },
  productTags: [{ productId: "prod_001" }],
  pinnedProductId: "prod_001",
});
```

```kotlin Android theme={null}
import com.amity.socialcloud.sdk.model.core.producttag.AmityProductTag

fun createRoomPost(roomId: String, communityId: String) {
    postRepository.createRoomPost(
        targetType = AmityPost.TargetType.COMMUNITY,
        targetId = communityId,
        roomId = roomId,
        text = "Join this live room",
        title = "Live room",
        productTags = listOf(AmityProductTag.Media(productId = "prod_001")),
        pinnedProductId = "prod_001"
    )
        .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,
        productTags: [AmityMediaProductTag(productId: "prod_001")],
        pinnedProductId: "prod_001"
    )
}
```

> [!NOTE]
>
> 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.

## 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

> **[Live Stream Posts](./live-stream-post)**
>
> Review the deprecated legacy live stream post path.

> **[Video Posts](./video-post)**
>
> Create posts from uploaded video files.

> **[Content Management](/social-plus-sdk/social/content-management/overview)**
>
> Review posts, comments, reactions, and sharing concepts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.