Skip to main content
PATCH
/
forum_posts
/
{id}
JavaScript
import Whop from '@whop/sdk';

const client = new Whop({
  apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});

const forumPost = await client.forumPosts.update('id');

console.log(forumPost.id);
{
  "id": "<string>",
  "title": "Weekly Market Analysis - February 2025",
  "content": "## My Strategy\n\nHere are the key steps...",
  "created_at": "2023-12-01T05:00:00.401Z",
  "updated_at": "2023-12-01T05:00:00.401Z",
  "is_edited": true,
  "is_poster_admin": true,
  "is_pinned": true,
  "parent_id": "<string>",
  "user": {
    "id": "user_xxxxxxxxxxxxx",
    "username": "johndoe42",
    "name": "John Doe"
  },
  "view_count": 42,
  "like_count": 42,
  "comment_count": 42
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Path Parameters

id
string
required

The unique identifier of the forum post to update.

Body

application/json

Parameters for UpdateForumPost

attachments
FileInputWithId · object[] | null

A replacement list of file attachments for this post, such as images or videos.

content
string | null

The updated body of the post in Markdown format. For example, 'Check out this update'. Hidden if the post is paywalled and the viewer has not purchased access.

is_pinned
boolean | null

Whether this post should be pinned to the top of the forum. Only top-level posts can be pinned, not comments.

title
string | null

The updated title of the post, displayed prominently at the top. Required for paywalled posts as it remains visible to non-purchasers.

visibility
enum<string> | null

Controls who can see this forum post, such as members only or public.

Available options:
members_only,
globally_visible

Response

A successful response

A post or comment in a forum feed, supporting rich text, attachments, polls, and reactions.

id
string
required

Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID.

title
string | null
required

The headline of the forum post. Null if the post has no title.

Example:

"Weekly Market Analysis - February 2025"

content
string | null
required

The body of the forum post in Markdown format. Null if the post is paywalled and the current user does not have access.

Example:

"## My Strategy\n\nHere are the key steps..."

created_at
string<date-time>
required

The time this post was created, as a Unix timestamp.

Example:

"2023-12-01T05:00:00.401Z"

updated_at
string<date-time>
required

The time this post was last updated, as a Unix timestamp.

Example:

"2023-12-01T05:00:00.401Z"

is_edited
boolean
required

Whether this post has been edited after its initial creation.

is_poster_admin
boolean
required

Whether the author of this post is an admin of the company that owns the forum.

is_pinned
boolean
required

Whether this post is pinned to the top of the forum feed.

parent_id
string | null
required

The unique identifier of the parent post. Null if this is a top-level post.

user
object
required

The user who authored this forum post.

view_count
integer | null
required

The total number of times this post has been viewed by users.

Example:

42

like_count
integer | null
required

The total number of like reactions this post has received.

Example:

42

comment_count
integer
required

The total number of direct comments on this post.

Example:

42