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

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# 포럼

> 모든 Whop 커뮤니티에서 포럼 게시물을 작성하고, 스레드를 가져오고, 댓글이나 반응을 추가하세요.

Forums API를 사용해 Whop 커뮤니티의 포럼 경험 안에서 게시물을 게시하고, 기존 스레드에 댓글을 달고, 게시물에 반응하세요. `experience_id`가 포럼 콘텐츠의 범위를 지정하므로, 커뮤니티 사이드바의 각 포럼 타일은 별도의 경험입니다.

## SDK 초기화하기

```typescript TypeScript theme={null}
import { WhopClient } from "@whop/sdk";

const client = new WhopClient({
  token: process.env.WHOP_API_KEY,
});
```

```python Python theme={null}
import os
from whop_sdk import Whop

client = Whop(
    token=os.environ["WHOP_API_KEY"],
)
```

```rust Rust theme={null}
use whop_sdk::prelude::*;

let config = ClientConfig {
    token: Some(std::env::var("WHOP_API_KEY").unwrap()),
    ..Default::default()
};
let client = Whop::new(config).expect("Failed to build client");
```

```go Go theme={null}
import (
    "os"

    "github.com/whopio/whopsdk-go/v2/client"
    "github.com/whopio/whopsdk-go/v2/option"
)

client := client.NewWhop(option.WithToken(os.Getenv("WHOP_API_KEY")))
```

## 게시물 작성하기

게시물은 Markdown을 지원합니다. 선택적 필드를 사용해 게시물을 고정하거나, 유료로 설정하거나, 멘션으로 표시할 수 있습니다.

```typescript TypeScript theme={null}
const post = await client.forumPosts.create({
  experience_id: "exp_xxxxxxxxxxxxx",
  content: "This is the post body in **Markdown**.",
  title: "Optional title for paywalled posts",
  pinned: false,
  is_mention: false,
  paywall_amount: 0, // cents; 500 = $5.00
});
```

```python Python theme={null}
post = client.forum_posts.create(
    experience_id="exp_xxxxxxxxxxxxx",
    content="This is the post body in **Markdown**.",
    title="Optional title for paywalled posts",
    pinned=False,
    is_mention=False,
    paywall_amount=0,
)
```

```rust Rust theme={null}
let post = client
    .forum_posts
    .create(
        &CreateForumPostsRequest {
            experience_id: "exp_xxxxxxxxxxxxx".to_string(),
            content: Some("This is the post body in **Markdown**.".to_string()),
            title: Some("Optional title for paywalled posts".to_string()),
            pinned: Some(false),
            is_mention: Some(false),
            paywall_amount: Some(0.0), // cents; 500 = $5.00
            ..Default::default()
        },
        None,
    )
    .await?;
```

```go Go theme={null}
post, err := client.ForumPosts.Create(context.TODO(), &whopsdk.CreateForumPostsRequest{
    ExperienceID:  "exp_xxxxxxxxxxxxx",
    Content:       whopsdk.String("This is the post body in **Markdown**."),
    Title:         whopsdk.String("Optional title for paywalled posts"),
    Pinned:        whopsdk.Bool(false),
    IsMention:     whopsdk.Bool(false),
    PaywallAmount: whopsdk.Float64(0), // cents; 500 = $5.00
})
if err != nil {
    log.Fatal(err)
}
_ = post
```

## 게시물 읽기

목록 작업은 자동으로 페이지를 나눕니다.

```typescript TypeScript theme={null}
const posts = await client.forumPosts.list({
  experience_id: "exp_xxxxxxxxxxxxx",
  first: 10,
});

for await (const item of posts) {
  console.log(item);
}

const post = await client.forumPosts.retrieve({ id: "post_xxxxxxxxxxxxx" });
```

```python Python theme={null}
for item in client.forum_posts.list(
    experience_id="exp_xxxxxxxxxxxxx",
    first=10,
):
    print(item)

post = client.forum_posts.retrieve("post_xxxxxxxxxxxxx")
```

```rust Rust theme={null}
let posts = client
    .forum_posts
    .list(
        &ForumPostsListQueryRequest {
            experience_id: "exp_xxxxxxxxxxxxx".to_string(),
            first: Some(10),
            ..Default::default()
        },
        None,
    )
    .await?;

for item in posts.data {
    println!("{item:?}");
}

let post = client
    .forum_posts
    .retrieve(&"post_xxxxxxxxxxxxx".to_string(), None)
    .await?;
```

```go Go theme={null}
page, err := client.ForumPosts.List(context.TODO(), &whopsdk.ListForumPostsRequest{
    ExperienceID: "exp_xxxxxxxxxxxxx",
    First:        whopsdk.Int(10),
})
if err != nil {
    log.Fatal(err)
}

iter := page.Iterator()
for iter.Next(context.TODO()) {
    fmt.Println(iter.Current())
}
if err := iter.Err(); err != nil {
    log.Fatal(err)
}

post, err := client.ForumPosts.Retrieve(context.TODO(), &whopsdk.RetrieveForumPostsRequest{
    ID: "post_xxxxxxxxxxxxx",
})
if err != nil {
    log.Fatal(err)
}
_ = post
```

## 게시물에 댓글 달기

댓글은 `parent_id`가 있는 게시물입니다. 상위 게시물의 ID를 `list`에 전달하여 댓글을 가져오세요.

```typescript TypeScript theme={null}
const comment = await client.forumPosts.create({
  experience_id: "exp_xxxxxxxxxxxxx",
  content: "Great post!",
  parent_id: "post_xxxxxxxxxxxxx",
});

const comments = await client.forumPosts.list({
  experience_id: "exp_xxxxxxxxxxxxx",
  parent_id: "post_xxxxxxxxxxxxx",
  first: 10,
});

for await (const item of comments) {
  console.log(item);
}
```

```python Python theme={null}
comment = client.forum_posts.create(
    experience_id="exp_xxxxxxxxxxxxx",
    content="Great post!",
    parent_id="post_xxxxxxxxxxxxx",
)

for item in client.forum_posts.list(
    experience_id="exp_xxxxxxxxxxxxx",
    parent_id="post_xxxxxxxxxxxxx",
    first=10,
):
    print(item)
```

```rust Rust theme={null}
let comment = client
    .forum_posts
    .create(
        &CreateForumPostsRequest {
            experience_id: "exp_xxxxxxxxxxxxx".to_string(),
            content: Some("Great post!".to_string()),
            parent_id: Some("post_xxxxxxxxxxxxx".to_string()),
            ..Default::default()
        },
        None,
    )
    .await?;

let comments = client
    .forum_posts
    .list(
        &ForumPostsListQueryRequest {
            experience_id: "exp_xxxxxxxxxxxxx".to_string(),
            parent_id: Some("post_xxxxxxxxxxxxx".to_string()),
            first: Some(10),
            ..Default::default()
        },
        None,
    )
    .await?;

for item in comments.data {
    println!("{item:?}");
}
```

```go Go theme={null}
comment, err := client.ForumPosts.Create(context.TODO(), &whopsdk.CreateForumPostsRequest{
    ExperienceID: "exp_xxxxxxxxxxxxx",
    Content:      whopsdk.String("Great post!"),
    ParentID:     whopsdk.String("post_xxxxxxxxxxxxx"),
})
if err != nil {
    log.Fatal(err)
}
_ = comment

page, err := client.ForumPosts.List(context.TODO(), &whopsdk.ListForumPostsRequest{
    ExperienceID: "exp_xxxxxxxxxxxxx",
    ParentID:     whopsdk.String("post_xxxxxxxxxxxxx"),
    First:        whopsdk.Int(10),
})
if err != nil {
    log.Fatal(err)
}

iter := page.Iterator()
for iter.Next(context.TODO()) {
    fmt.Println(iter.Current())
}
if err := iter.Err(); err != nil {
    log.Fatal(err)
}
```

## 게시물 좋아요

> [!NOTE]
>
> 포럼 반응은 항상 `:heart:`입니다. 채팅 메시지는 모든 이모지를 허용하지만, 포럼 반응은 다른 값을 무시합니다.

```typescript TypeScript theme={null}
await client.reactions.create({
  resource_id: "post_xxxxxxxxxxxxx",
  emoji: ":heart:",
});
```

```python Python theme={null}
client.reactions.create(
    resource_id="post_xxxxxxxxxxxxx",
    emoji=":heart:",
)
```

```rust Rust theme={null}
client
    .reactions
    .create(
        &CreateReactionsRequest {
            resource_id: "post_xxxxxxxxxxxxx".to_string(),
            emoji: Some(":heart:".to_string()),
            ..Default::default()
        },
        None,
    )
    .await?;
```

```go Go theme={null}
_, err := client.Reactions.Create(context.TODO(), &whopsdk.CreateReactionsRequest{
    ResourceID: "post_xxxxxxxxxxxxx",
    Emoji:      whopsdk.String(":heart:"),
})
if err != nil {
    log.Fatal(err)
}
```

## 고급 기능

### 고정 게시물

고정 게시물은 피드 상단에 표시됩니다. 게시물을 작성할 때 `pinned: true`를 사용하세요.

```typescript TypeScript theme={null}
await client.forumPosts.create({
  experience_id: "exp_xxxxxxxxxxxxx",
  content: "Important announcement!",
  pinned: true,
});
```

```python Python theme={null}
client.forum_posts.create(
    experience_id="exp_xxxxxxxxxxxxx",
    content="Important announcement!",
    pinned=True,
)
```

```rust Rust theme={null}
client
    .forum_posts
    .create(
        &CreateForumPostsRequest {
            experience_id: "exp_xxxxxxxxxxxxx".to_string(),
            content: Some("Important announcement!".to_string()),
            pinned: Some(true),
            ..Default::default()
        },
        None,
    )
    .await?;
```

```go Go theme={null}
_, err := client.ForumPosts.Create(context.TODO(), &whopsdk.CreateForumPostsRequest{
    ExperienceID: "exp_xxxxxxxxxxxxx",
    Content:      whopsdk.String("Important announcement!"),
    Pinned:       whopsdk.Bool(true),
})
if err != nil {
    log.Fatal(err)
}
```

### 사용자 멘션하기

본문에 `<@username>`을 사용하세요. 멘션된 사용자는 알림을 받습니다.

```typescript TypeScript theme={null}
await client.forumPosts.create({
  experience_id: "exp_xxxxxxxxxxxxx",
  content: "Hey <@username> check this out!",
});
```

```python Python theme={null}
client.forum_posts.create(
    experience_id="exp_xxxxxxxxxxxxx",
    content="Hey <@username> check this out!",
)
```

```rust Rust theme={null}
client
    .forum_posts
    .create(
        &CreateForumPostsRequest {
            experience_id: "exp_xxxxxxxxxxxxx".to_string(),
            content: Some("Hey <@username> check this out!".to_string()),
            ..Default::default()
        },
        None,
    )
    .await?;
```

```go Go theme={null}
_, err := client.ForumPosts.Create(context.TODO(), &whopsdk.CreateForumPostsRequest{
    ExperienceID: "exp_xxxxxxxxxxxxx",
    Content:      whopsdk.String("Hey <@username> check this out!"),
})
if err != nil {
    log.Fatal(err)
}
```

### 유료 게시물

`paywall_amount`는 센트 단위입니다. 독자는 전체 콘텐츠를 보려면 결제해야 합니다.

```typescript TypeScript theme={null}
await client.forumPosts.create({
  experience_id: "exp_xxxxxxxxxxxxx",
  title: "Premium post",
  content: "Exclusive content here",
  paywall_amount: 500, // $5.00
});
```

```python Python theme={null}
client.forum_posts.create(
    experience_id="exp_xxxxxxxxxxxxx",
    title="Premium post",
    content="Exclusive content here",
    paywall_amount=500,
)
```

```rust Rust theme={null}
client
    .forum_posts
    .create(
        &CreateForumPostsRequest {
            experience_id: "exp_xxxxxxxxxxxxx".to_string(),
            title: Some("Premium post".to_string()),
            content: Some("Exclusive content here".to_string()),
            paywall_amount: Some(500.0), // $5.00
            ..Default::default()
        },
        None,
    )
    .await?;
```

```go Go theme={null}
_, err := client.ForumPosts.Create(context.TODO(), &whopsdk.CreateForumPostsRequest{
    ExperienceID:  "exp_xxxxxxxxxxxxx",
    Title:         whopsdk.String("Premium post"),
    Content:       whopsdk.String("Exclusive content here"),
    PaywallAmount: whopsdk.Float64(500), // $5.00
})
if err != nil {
    log.Fatal(err)
}
```

### 커서를 사용한 페이지네이션

자동 페이지네이션 외에도, 응답의 `page_info`에 있는 `end_cursor`를 사용해 페이지를 수동으로 넘길 수 있습니다.

```typescript TypeScript theme={null}
const firstPage = await client.forumPosts.list({
  experience_id: "exp_xxxxxxxxxxxxx",
  first: 10,
});

const next = await client.forumPosts.list({
  experience_id: "exp_xxxxxxxxxxxxx",
  first: 10,
  after: firstPage.response.page_info.end_cursor ?? undefined,
});
```

```python Python theme={null}
first = client.forum_posts.list(
    experience_id="exp_xxxxxxxxxxxxx",
    first=10,
)

next_page = client.forum_posts.list(
    experience_id="exp_xxxxxxxxxxxxx",
    first=10,
    after=first.response.page_info.end_cursor,
)
```

```rust Rust theme={null}
let first_page = client
    .forum_posts
    .list(
        &ForumPostsListQueryRequest {
            experience_id: "exp_xxxxxxxxxxxxx".to_string(),
            first: Some(10),
            ..Default::default()
        },
        None,
    )
    .await?;

let next = client
    .forum_posts
    .list(
        &ForumPostsListQueryRequest {
            experience_id: "exp_xxxxxxxxxxxxx".to_string(),
            first: Some(10),
            after: first_page.page_info.end_cursor.clone(),
            ..Default::default()
        },
        None,
    )
    .await?;

for item in next.data {
    println!("{item:?}");
}
```

```go Go theme={null}
firstPage, err := client.ForumPosts.List(context.TODO(), &whopsdk.ListForumPostsRequest{
    ExperienceID: "exp_xxxxxxxxxxxxx",
    First:        whopsdk.Int(10),
})
if err != nil {
    log.Fatal(err)
}

// Step to the next page manually
nextPage, err := firstPage.GetNextPage(context.TODO())
if err != nil {
    log.Fatal(err)
}
_ = nextPage
```

## 필요한 권한

게시하기 전에 [권한 가이드](https://docs.whop.com/ko/developer/guides/permissions.md)를 참고하여 앱의 권한 목록에 다음 항목을 추가하세요.

| 권한 | 필요한 작업 |
| - | - |
| `forum:read` | 게시물 및 댓글 읽기 |
| `forum:post:create` | 게시물 및 댓글 작성 |
| `chat:read` | 반응 생성 및 읽기 |

> [accordion] 게시물 객체 구조
>
> ```typescript theme={null}
> {
>   id: string;
>   comment_count: number;
>   content: string | null;
>   is_edited: boolean;
>   is_pinned: boolean;
>   is_poster_admin: boolean;
>   like_count: number | null;
>   parent_id: string | null; // null = top-level, set = comment
>   title: string | null;
>   view_count: number | null;
>   user: { id: string; name: string | null; username: string };
> }
> ```
>
> 전체 스키마: [포럼 게시물 API 레퍼런스](https://docs.whop.com/ko/api-reference/legacy/forum-posts/forum-post.md)를 참고하세요.

## 다음 단계

> [card] [챗봇 만들기](https://docs.whop.com/ko/developer/guides/chat.md)
>
> 같은 커뮤니티에서 포럼 게시물과 실시간 채팅 메시지를 함께 사용하세요.

> [card] [웹훅으로 이벤트 수신하기](https://docs.whop.com/ko/developer/guides/webhooks.md)
>
> 서버에서 포럼 게시물과 댓글에 실시간으로 대응하세요.

> [card] [알림 보내기](https://docs.whop.com/ko/developer/guides/notifications.md)
>
> 새로운 소식이 있을 때 사용자를 포럼으로 다시 불러오세요.

> [card] [파일 업로드하기](https://docs.whop.com/ko/developer/guides/upload-files.md)
>
> 게시물에 이미지와 동영상을 첨부하세요.


## Related topics

- [이전 버전에서 마이그레이션하기](https://docs.whop.com/ko/developer/api/migrate-from-previous-versions.md)
- [커뮤니티 & 채팅](https://docs.whop.com/ko/developer/communities/overview.md)
- [Forum](https://docs.whop.com/ko/api-reference/legacy/forums/forum.md)
