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

const client = new Whop({
  appID: 'app_xxxxxxxxxxxxxx',
  apiKey: 'My API Key',
});

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

console.log(forumPost.id);
{
  "id": "<string>",
  "title": "<string>",
  "content": "<string>",
  "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": "<string>",
    "name": "<string>"
  },
  "view_count": 42,
  "like_count": 42,
  "comment_count": 42
}

Authorizations

Authorization
string
header
required

The app API key from an app from the /dashboard/developer page

Path Parameters

id
string
required

Body

application/json

Parameters for UpdateForumPost

attachments
object[] | null

The attachments for this post

content
string | null

This is the main body of the post in Markdown format. Hidden if paywalled and user hasn't purchased access to it.

is_pinned
boolean | null

Whether the post is pinned. You can only pin a top level posts (not comments).

title
string | null

The title of the post. Only visible if paywalled.

Response

A successful response

Represents a post in forum

id
string
required

The unique identifier for the entity

title
string | null
required

The title of the forum post

content
string | null
required

The content of the forum post in Markdown format

created_at
string<date-time>
required

The timestamp when the post was created

Example:

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

updated_at
string<date-time>
required

The timestamp when the post was last updated

Example:

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

is_edited
boolean
required

Whether the forum post has been edited

is_poster_admin
boolean
required

Whether the user that sent the post is an admin of the company

is_pinned
boolean
required

Whether this forum post is pinned

parent_id
string | null
required

The ID of the parent forum post, if applicable

user
object
required

The user who created this forum post

view_count
integer | null
required

The number of times this message has been viewed

Example:

42

like_count
integer | null
required

The number of likes this post has received

Example:

42

comment_count
integer
required

The amount of comments on this post

Example:

42