FastComments.com

FastComments JavaScript/TypeScript SDK

This is the official JavaScript/TypeScript SDK for FastComments.

Manage comments, users, SSO, and moderation from Node.js or the browser.

Repository

View on GitHub

Installation Internal Link

npm install fastcomments-sdk

API Documentation Internal Link

Full API reference: docs/api/README.md

Browser vs Server Compatibility Internal Link

This SDK uses dual entry points to ensure optimal compatibility and prevent runtime errors:

  • fastcomments-sdk/browser - Browser-safe version with native fetch
  • fastcomments-sdk/server - Full Node.js version with SSO support
  • fastcomments-sdk (default) - Types only, safe to import anywhere

Public vs Secured APIs Internal Link

The SDK provides three main API classes:

  • DefaultApi - Secured endpoints that require your API key for authentication. Use these for server-side operations.
  • PublicApi - Public endpoints that can be accessed without an API key. These can be called directly from browsers/mobile devices/etc.
  • HiddenApi - Internal/admin endpoints for advanced use cases.

Example: Using Public API (browser-safe)

import { PublicApi } from 'fastcomments-sdk/browser';

const publicApi = new PublicApi();

// Get comments for a page (no API key required)
const response = await publicApi.getCommentsPublic({
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id'
});

Example: Using Default API (server-side only)

import { DefaultApi, Configuration } from 'fastcomments-sdk/server';

const config = new Configuration({
  apiKey: 'your-api-key' // Keep this secret!
});
const defaultApi = new DefaultApi(config);

// Get comments with full admin access
const response = await defaultApi.getComments({
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id'
});

SSO (Single Sign-On) Integration Internal Link

FastComments supports SSO to integrate with your existing user authentication system. SSO functionality is only available in the server export since it requires Node.js crypto features.

Simple SSO (Server-Side Only)

Simple SSO should be generated server-side and sent to the client:

// Server-side code (Node.js/backend)
import { FastCommentsSSO, PublicApi } from 'fastcomments-sdk/server';

// Create simple SSO using the built-in helper  
const userData = {
  username: 'john_doe',
  email: 'john@example.com',
  displayName: 'John Doe',
  avatar: 'https://example.com/avatar.jpg'
};

const sso = FastCommentsSSO.createSimple(userData, {
  loginURL: '/login',
  logoutURL: '/logout'
});

const ssoToken = sso.createToken();

// Send ssoToken to your client-side code
// Client-side code can then use this token with the browser SDK

Secure SSO should be implemented server-side and provides better security:

// Server-side code (Node.js/backend)
import { FastCommentsSSO, PublicApi } from 'fastcomments-sdk/server';

// Create secure SSO using the built-in helper
const userData = {
  id: 'user-123',
  email: 'john@example.com',
  username: 'john_doe',
  displayName: 'John Doe',
  avatar: 'https://example.com/avatar.jpg',
  isAdmin: false,
  isModerator: false
};

const sso = FastCommentsSSO.createSecure('your-api-key', userData, {
  loginURL: '/login',
  logoutURL: '/logout'
});

const ssoConfig = sso.prepareToSend();

// Use with API calls on the server
const publicApi = new PublicApi();
const response = await publicApi.getCommentsPublic({
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id',
  sso: JSON.stringify(ssoConfig)
});

// Or send ssoConfig to client for browser usage

Using SSO from Browser (with Server-Generated Token)

// Client-side code (browser)
import { PublicApi } from 'fastcomments-sdk/browser';

// Get SSO token from your server endpoint
const ssoToken = await fetch('/api/sso-token').then(r => r.json());

const publicApi = new PublicApi();
const response = await publicApi.getCommentsPublic({
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id',
  sso: ssoToken // Use the server-generated SSO token
});

SSO with Comment Creation

// Server-side: Create SSO and comment
import { FastCommentsSSO, PublicApi } from 'fastcomments-sdk/server';

const sso = FastCommentsSSO.createSecure('your-api-key', userData);
const ssoConfig = sso.prepareToSend();

const response = await publicApi.createCommentPublic({
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id',
  broadcastId: 'unique-broadcast-id',
  commentData: {
    comment: 'This is my comment',
    date: Date.now(),
    commenterName: 'John Doe',
    url: 'https://example.com/page',
    urlId: 'page-url-id'
  },
  sso: JSON.stringify(ssoConfig)
});

Common Use Cases Internal Link

Getting Comments for a Page

const comments = await sdk.publicApi.getCommentsPublic({
  tenantId: 'your-tenant-id',
  urlId: 'article-123'
});

Creating a Comment

const newComment = await sdk.publicApi.createCommentPublic({
  createCommentParams: {
    tenantId: 'your-tenant-id',
    urlId: 'article-123',
    comment: 'Great article!',
    commenterName: 'John Doe',
    commenterEmail: 'john@example.com'
  }
});

Voting on a Comment

const voteResponse = await sdk.publicApi.voteComment({
  voteBodyParams: {
    commentId: 'comment-id',
    direction: 1 // 1 for upvote, -1 for downvote
  }
});

User Management (Requires API Key)

// Search for users (requires DefaultApi)
const users = await sdk.defaultApi.searchUsers({
  tenantId: 'your-tenant-id',
  urlId: 'page-id',
  usernameStartsWith: 'john'
});

Live Events (Real-time Updates) Internal Link

Subscribe to live events to get real-time updates for comments, votes, and other activities.

Page-Level Events

Listen for live events on a specific page (comments, votes, etc.):

import { subscribeToChanges, LiveEvent, LiveEventType } from 'fastcomments-sdk/browser';

const config = {
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id',
};

// Subscribe to live events for a page
const subscription = subscribeToChanges(
  config,
  'your-tenant-id', // tenantIdWS
  'page-url-id',    // urlIdWS  
  'user-session-id', // userIdWS (get this from getComments response)
  (event: LiveEvent) => {
    console.log('Live event received:', event);

    switch (event.type) {
      case LiveEventType.new_comment:
        console.log('New comment:', event.comment);
        // Update your UI with the new comment
        break;
      case LiveEventType.new_vote:
        console.log('New vote:', event.vote);
        // Update vote counts in your UI
        break;
      case LiveEventType.updated_comment:
        console.log('Comment updated:', event.comment);
        break;
      default:
        console.log('Other event type:', event.type);
    }

    return true; // Return true if event was handled
  },
  (isConnected: boolean) => {
    console.log('Connection status:', isConnected ? 'Connected' : 'Disconnected');
  }
);

// Close the subscription when done
subscription.close();

Subscribe to User Events

Listen for user-specific events (notifications, mentions, etc.):

import { subscribeToUserFeed, LiveEvent, LiveEventType } from 'fastcomments-sdk/browser';

const userConfig = {
  userIdWS: 'user-session-id', // Get this from getComments response
};

// Subscribe to user's personal feed
const userSubscription = subscribeToUserFeed(
  userConfig,
  (event: LiveEvent) => {
    console.log('User event received:', event);

    switch (event.type) {
      case LiveEventType.notification:
        console.log('New notification:', event.notification);
        // Show notification in your UI
        break;
      case LiveEventType.notification_update:
        console.log('Notification updated:', event.notification);
        break;
      default:
        console.log('Other user event:', event.type);
    }

    return true;
  },
  (isConnected: boolean) => {
    console.log('User feed connection:', isConnected ? 'Connected' : 'Disconnected');
  }
);

// Close when done
userSubscription.close();

Getting userIdWS

The userIdWS parameter is required for live events and can be obtained from API responses:

const response = await sdk.publicApi.getCommentsPublic({
  tenantId: 'your-tenant-id',
  urlId: 'page-id'
});

// Extract userIdWS from the response
const userIdWS = response.data?.userSessionInfo?.userIdWS;

if (userIdWS) {
  // Now you can subscribe to live events
  const subscription = subscribeToChanges(config, tenantIdWS, urlIdWS, userIdWS, handleEvent);
}

Broadcast IDs Internal Link

You'll see you're supposed to pass a broadcastId in some API calls. When you receive events, you'll get this ID back, so you know to ignore the event if you plan to optimistically apply changes on the client (which you'll probably want to do since it offers the best experience). Pass a UUID here. The ID should be unique enough to not occur twice in a browser session.

import { v4 as uuidv4 } from 'uuid';

const response = await sdk.publicApi.createCommentPublic({
  createCommentParams: {
    tenantId: 'your-tenant-id',
    urlId: 'page-id',
    comment: 'My comment',
    broadcastId: uuidv4() // Unique ID for this operation
  }
});

Error Handling Internal Link

try {
  const comments = await sdk.publicApi.getCommentsPublic({
    tenantId: 'your-tenant-id',
    urlId: 'page-id'
  });
} catch (error) {
  if (error.response?.status === 404) {
    console.log('Page not found');
  } else {
    console.error('API Error:', error.message);
  }
}

aggregate Internal Link

Aggregates documents by grouping them (if groupBy is provided) and applying multiple operations. Different operations (e.g. sum, countDistinct, avg, etc.) are supported.

Parameters

Name Type Required Description
tenantId string Yes
aggregationRequest AggregationRequest Yes
parentTenantId string No
includeStats boolean No

Response

Returns: AggregationResponse

Example

aggregate Example
Copy Copy
1
2const tenantId: string = "tenant_42";
3const parentTenantId: string = "org_parent_7";
4const includeStats: boolean = true;
5const aggregationRequest: AggregationRequest = {
6 operation: { type: "COUNT", field: "commentId" },
7 groupBy: ["postId"],
8 filters: { predicates: [{ field: "status", operator: "EQ", value: { stringValue: "approved" } }] },
9 sort: [{ field: "count", direction: "DESC" }],
10 limit: 50
11};
12const result: AggregationResponse = await aggregate(tenantId, aggregationRequest, parentTenantId, includeStats);
13

getAuditLogs Internal Link

Parameters

Name Type Required Description
tenantId string Yes
limit number No
skip number No
order SORTDIR No
after number No
before number No

Response

Returns: GetAuditLogs200Response

Example

getAuditLogs Example
Copy Copy
1
2async function main(): Promise<void> {
3 const tenantId: string = 'tenant_9b8f6c';
4 const limit: number = 50;
5 const skip: number = 0;
6 const order: SORTDIR = 'desc';
7 const after: number = Date.now() - 7 * 24 * 60 * 60 * 1000;
8 const response: GetAuditLogs200Response = await getAuditLogs(tenantId, limit, skip, order, after);
9 console.log(response);
10}
11main();
12

blockFromCommentPublic Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
publicBlockFromCommentParams PublicBlockFromCommentParams Yes
sso string No

Response

Returns: BlockFromCommentPublic200Response

Example

blockFromCommentPublic Example
Copy Copy
1
2const tenantId: string = "site_7f9b2e";
3const commentId: string = "comment_2026-03-25_001";
4const publicBlockFromCommentParams: PublicBlockFromCommentParams = {
5 reason: "Repeated harassment and targeted abuse",
6 blockDurationDays: 90,
7 includeHistory: true,
8 notifyModeratorTeam: true
9};
10const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.fakePayload.signature";
11const result: BlockFromCommentPublic200Response = await blockFromCommentPublic(tenantId, commentId, publicBlockFromCommentParams, sso);
12

unBlockCommentPublic Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
publicBlockFromCommentParams PublicBlockFromCommentParams Yes
sso string No

Response

Returns: UnBlockCommentPublic200Response

Example

unBlockCommentPublic Example
Copy Copy
1
2const tenantId: string = 'tenant_42e8a1';
3const commentId: string = 'cmt_9b3f2d';
4const publicBlockFromCommentParams: PublicBlockFromCommentParams = {
5 reason: 'abusive_language',
6 blockedByModeratorId: 'mod_17',
7 note: 'Targeted harassment; review complete',
8 unblockRequestedAt: new Date().toISOString()
9};
10const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.signature';
11const result: UnBlockCommentPublic200Response = await unBlockCommentPublic(tenantId, commentId, publicBlockFromCommentParams, sso);
12

checkedCommentsForBlocked Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentIds string Yes
sso string No

Response

Returns: CheckedCommentsForBlocked200Response

Example

checkedCommentsForBlocked Example
Copy Copy
1
2const tenantId: string = 'tenant_4f3b2a1e';
3const commentIds: string = 'c_1001,c_1002,c_1003';
4const ssoToken: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyMTIzIn0.Sf4ke7nQP3mZx9v2';
5
6const resultWithoutSSO: CheckedCommentsForBlocked200Response = await checkedCommentsForBlocked(tenantId, commentIds);
7const resultWithSSO: CheckedCommentsForBlocked200Response = await checkedCommentsForBlocked(tenantId, commentIds, ssoToken);
8

blockUserFromComment Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
blockFromCommentParams BlockFromCommentParams Yes
userId string No
anonUserId string No

Response

Returns: BlockFromCommentPublic200Response

Example

blockUserFromComment Example
Copy Copy
1
2const tenantId: string = "tenant_12345";
3const id: string = "comment_67890";
4const blockFromCommentParams: BlockFromCommentParams = {
5 reason: "Repeated abusive language",
6 blockDurationHours: 168,
7 blockReplies: true,
8 notifyAuthor: true
9};
10const userId: string = "user_abc123";
11const anonUserId: string = "anon_xyz789";
12const result: BlockFromCommentPublic200Response = await blockUserFromComment(tenantId, id, blockFromCommentParams, userId, anonUserId);
13

createCommentPublic Internal Link

Parameters

Name Type Required Description
tenantId string Yes
urlId string Yes
broadcastId string Yes
commentData CommentData Yes
sessionId string No
sso string No

Response

Returns: CreateCommentPublic200Response

Example

createCommentPublic Example
Copy Copy
1
2const tenantId: string = 'tenant_prod_42';
3const urlId: string = 'article-2026-03-25-tech-deep-dive';
4const broadcastId: string = 'live-broadcast-001';
5const sessionId: string = 'sess_9f8e7d6a3b';
6const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.signature';
7const commentData: CommentData = {
8 content: 'Great reporting — appreciated the depth on performance tradeoffs.',
9 authorName: 'Jordan M.',
10 language: 'en-US',
11 metadata: { client: 'web' }
12};
13const result: CreateCommentPublic200Response = await createCommentPublic(tenantId, urlId, broadcastId, commentData, sessionId, sso);
14

deleteComment Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
contextUserId string No
isLive boolean No

Response

Returns: DeleteComment200Response

Example

deleteComment Example
Copy Copy
1
2const tenantId: string = 'tenant_7b3f2a';
3const commentId: string = 'cmt_8a1f4d2b';
4const contextUserId: string = 'user_102';
5const isLive: boolean = true;
6const result: DeleteComment200Response = await deleteComment(tenantId, commentId, contextUserId, isLive);
7

deleteCommentPublic Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
broadcastId string Yes
editKey string No
sso string No

Response

Returns: DeleteCommentPublic200Response

Example

deleteCommentPublic Example
Copy Copy
1
2const tenantId: string = 'tenant_4f2c9b';
3const commentId: string = 'comment-7c3a9f2d';
4const broadcastId: string = 'article-2026-03-20';
5const editKey: string | undefined = 'ek_pub_abc12345';
6const sso: string | undefined = 'sso_eyJhbGciOiJIUzI1Ni';
7
8const result: DeleteCommentPublic200Response = await deleteCommentPublic(
9 tenantId,
10 commentId,
11 broadcastId,
12 editKey,
13 sso
14);
15

deleteCommentVote Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
voteId string Yes
urlId string Yes
broadcastId string Yes
editKey string No
sso string No

Response

Returns: DeleteCommentVote200Response

Example

deleteCommentVote Example
Copy Copy
1
2const tenantId: string = 'acme-tenant-87e4fd';
3const commentId: string = 'cmt-9a12b3f4';
4const voteId: string = 'vote-4f6d21b9';
5const urlId: string = 'https://www.acme.com/articles/2026/03/25/how-to-test';
6const broadcastId: string = 'broadcast-20260325-01';
7const editKey: string = 'editkey-6b7c8d9e';
8const sso: string = 'sso-jwt-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9';
9
10const response: DeleteCommentVote200Response = await deleteCommentVote(
11 tenantId,
12 commentId,
13 voteId,
14 urlId,
15 broadcastId,
16 editKey,
17 sso
18);
19

flagComment Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
userId string No
anonUserId string No

Response

Returns: FlagComment200Response

Example

flagComment Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_001';
3const id: string = 'comment_7f3a2b9e';
4const userId: string = 'user_jdoe_1001';
5const anonUserId: string = 'anon_3f2b_visitor';
6const result: FlagComment200Response = await flagComment(tenantId, id, userId, anonUserId);
7

getComment Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: GetComment200Response

Example

getComment Example
Copy Copy
1
2const tenantId: string = "acme-publishing-001";
3const commentId: string = "f3b2c1d0-9a8e-4b7c-8123-6d5f0a1e2b3c";
4const result: GetComment200Response = await getComment(tenantId, commentId);
5const wrapper: GetComment200Response & { comment?: APIComment } = result;
6const comment: APIComment | undefined = wrapper.comment;
7const authorBadge: CommentUserBadgeInfo | undefined = comment?.user?.badge;
8const userHashTags: CommentUserHashTagInfo[] | undefined = comment?.user?.hashTags
9

getComments Internal Link

Parameters

Name Type Required Description
tenantId string Yes
page number No
limit number No
skip number No
asTree boolean No
skipChildren number No
limitChildren number No
maxTreeDepth number No
urlId string No
userId string No
anonUserId string No
contextUserId string No
hashTag string No
parentId string No
direction SortDirections No

Response

Returns: GetComments200Response

Example

getComments Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_42';
3const response: GetComments200Response = await getComments(
4 tenantId,
5 1, // page
6 20, // limit
7 0, // skip
8 true, // asTree
9 1, // skipChildren
10 3, // limitChildren
11 4, // maxTreeDepth
12 'articles/2026/new-product-launch', // urlId
13 'user_7890', // userId
14 'anon_4f3b2', // anonUserId
15 undefined, // contextUserId
16 '#launch', // hashTag
17 undefined // parentId
18);
19

getCommentsPublic Internal Link

req tenantId urlId

Parameters

Name Type Required Description
tenantId string Yes
urlId string Yes
page number No
direction SortDirections No
sso string No
skip number No
skipChildren number No
limit number No
limitChildren number No
countChildren boolean No
fetchPageForCommentId string No
includeConfig boolean No
countAll boolean No
includei10n boolean No
locale string No
modules string No
isCrawler boolean No
includeNotificationCount boolean No
asTree boolean No
maxTreeDepth number No
useFullTranslationIds boolean No
parentId string No
searchText string No
hashTags Array No
userId string No
customConfigStr string No
afterCommentId string No
beforeCommentId string No

Response

Returns: GetCommentsPublic200Response

Example

getCommentsPublic Example
Copy Copy
1
2const tenantId: string = 'tenant_eu-west_01';
3const urlId: string = 'https://www.financialtimes.com/articles/2026/market-update-q1';
4const response: GetCommentsPublic200Response = await getCommentsPublic(
5 tenantId,
6 urlId,
7 2,
8 undefined,
9 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.tokenPayload.signature',
10 undefined,
11 0,
12 50,
13 5,
14 true,
15 undefined,
16 true,
17 false,
18 true,
19 'en-US',
20 'reactions,moderation',
21 false,
22 true,
23 true,
24 3,
25 false,
26 undefined,
27 'performance',
28 ['feature','fastcomments'],
29 'user_9876',
30 undefined,
31 undefined,
32 undefined
33);
34

getCommentText Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
editKey string No
sso string No

Response

Returns: GetCommentText200Response

Example

getCommentText Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_001';
3const commentId: string = 'cmt_7890b';
4const editKey: string = 'edit_4f2d9b7c';
5const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9';
6
7const result: GetCommentText200Response = await getCommentText(tenantId, commentId, editKey, sso);
8

getCommentVoteUserNames Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
dir number Yes
sso string No

Response

Returns: GetCommentVoteUserNames200Response

Example

getCommentVoteUserNames Example
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_4f2c1e';
4 const commentId: string = 'cmt_9a7b3d';
5 const dir: number = 1;
6 const resultUpvotes: GetCommentVoteUserNames200Response = await getCommentVoteUserNames(tenantId, commentId, dir);
7 const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.fakepayload.signature';
8 const dirDown: number = -1;
9 const resultDownvotes: GetCommentVoteUserNames200Response = await getCommentVoteUserNames(tenantId, commentId, dirDown, sso);
10 console.log(resultUpvotes, resultDownvotes);
11})();
12

lockComment Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
broadcastId string Yes
sso string No

Response

Returns: LockComment200Response

Example

lockComment Example
Copy Copy
1
2const tenantId: string = "tenant_prod_8f3a2b";
3const commentId: string = "cmt_5d7e9a92";
4const broadcastId: string = "broadcast_2026_03_25_1400";
5const ssoToken: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.signature";
6const resultWithSso: LockComment200Response = await lockComment(tenantId, commentId, broadcastId, ssoToken);
7const resultWithoutSso: LockComment200Response = await lockComment(tenantId, commentId, broadcastId);
8

pinComment Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
broadcastId string Yes
sso string No

Response

Returns: PinComment200Response

Example

pinComment Example
Copy Copy
1
2const tenantId: string = "tenant_4f2b9a";
3const commentId: string = "cmt_9f8e7d6c";
4const broadcastId: string = "brd_live_concert_2026-03-25";
5const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.sso_payload_signature";
6
7const result: PinComment200Response = await pinComment(tenantId, commentId, broadcastId, sso);
8

saveComment Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createCommentParams CreateCommentParams Yes
isLive boolean No
doSpamCheck boolean No
sendEmails boolean No
populateNotifications boolean No

Response

Returns: SaveComment200Response

Example

saveComment Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_001';
3const createCommentParams: CreateCommentParams = {
4 content: 'Great article — helped me fix a production issue in minutes.',
5 url: 'https://app.acme.com/blog/performance-tips',
6 author: { name: 'Maya Chen', email: 'maya.chen@acme.com' },
7 metadata: { locale: 'en-US', appVersion: '4.2.1' }
8} as CreateCommentParams;
9const isLive: boolean = true;
10const doSpamCheck: boolean = true;
11const sendEmails: boolean = false;
12const populateNotifications: boolean = true;
13const result: SaveComment200Response = await saveComment(tenantId, createCommentParams, isLive, doSpamCheck, sendEmails, populateNotifications);
14

saveCommentsBulk Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createCommentParams Array Yes
isLive boolean No
doSpamCheck boolean No
sendEmails boolean No
populateNotifications boolean No

Response

Returns: Array<SaveComment200Response

Example

saveCommentsBulk Example
Copy Copy
1
2const tenantId: string = 'acme-corp-01';
3const mentions1: CommentUserMentionInfo[] = [{ userId: 'user-123', displayName: 'Jane Doe' }];
4const hashtags1: CommentUserHashTagInfo[] = [{ tag: 'typescript' }];
5const createCommentParams: CreateCommentParams[] = [
6 {
7 content: 'Great insights on async/await patterns.',
8 authorName: 'John Smith',
9 authorEmail: 'john.smith@acme.com',
10 externalId: 'comment-001',
11 createdAt: '2026-03-25T10:15:00Z',
12 userMentions: mentions1,
13 userHashTags: hashtags1
14 },
15 {
16 content: 'I prefer using Promise.all for bulk ops.',
17 authorName: 'Emily Turner',
18 authorEmail: 'emily.turner@acme.com',
19 externalId: 'comment-002',
20 createdAt: '2026-03-25T10:20:00Z'
21 }
22];
23const result: SaveComment200Response[] = await saveCommentsBulk(tenantId, createCommentParams, true, true, false, true);
24

setCommentText Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
broadcastId string Yes
commentTextUpdateRequest CommentTextUpdateRequest Yes
editKey string No
sso string No

Response

Returns: SetCommentText200Response

Example

setCommentText Example
Copy Copy
1
2const tenantId: string = 'tenant_6721f4';
3const commentId: string = 'cmt_9a3b2d';
4const broadcastId: string = 'live_2026_03_25';
5const editKey: string = 'edit_k_4f7b9';
6const sso: string = 'sso_tok_eyJhbGciOiJIUzI1';
7const commentTextUpdateRequest: CommentTextUpdateRequest = {
8 text: 'Updated to clarify the timeline and link the relevant docs.',
9 mentions: [{ userId: 'user_102', displayName: 'Alex Rivera' }],
10 hashtags: [{ tag: 'product-update' }]
11};
12const result: SetCommentText200Response = await setCommentText(tenantId, commentId, broadcastId, commentTextUpdateRequest, editKey, sso);
13

unBlockUserFromComment Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
unBlockFromCommentParams UnBlockFromCommentParams Yes
userId string No
anonUserId string No

Response

Returns: UnBlockCommentPublic200Response

Example

unBlockUserFromComment Example
Copy Copy
1
2const tenantId: string = 'tenant_87f3e1';
3const id: string = 'comment_9b2a4f';
4const unBlockFromCommentParams: UnBlockFromCommentParams = {
5 reason: 'Reviewed by moderation team — reinstated',
6 moderatorId: 'mod_21',
7 unblockedAt: new Date().toISOString()
8};
9const userId: string = 'user_42';
10const anonUserId: string = 'anon_e7f9';
11const result: UnBlockCommentPublic200Response = await unBlockUserFromComment(tenantId, id, unBlockFromCommentParams, userId, anonUserId);
12

unFlagComment Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
userId string No
anonUserId string No

Response

Returns: FlagComment200Response

Example

unFlagComment Example
Copy Copy
1
2const tenantId: string = 'acme-tenant-001';
3const commentId: string = 'cmt_9f8e7d6c';
4const userId: string = 'user_72b4a1c9';
5const anonUserId: string = 'anon_3d2c1b0a';
6const response: FlagComment200Response = await unFlagComment(tenantId, commentId, userId, anonUserId);
7

unLockComment Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
broadcastId string Yes
sso string No

Response

Returns: LockComment200Response

Example

unLockComment Example
Copy Copy
1
2const tenantId: string = 'tenant_9d4f2b';
3const commentId: string = 'cmt_8a3e1f';
4const broadcastId: string = 'broadcast_2026_03_25';
5const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.signature';
6
7const result: LockComment200Response = await unLockComment(tenantId, commentId, broadcastId, sso);
8

unPinComment Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
broadcastId string Yes
sso string No

Response

Returns: PinComment200Response

Example

unPinComment Example
Copy Copy
1
2const tenantId: string = 'tenant_7f9d2a3b';
3const commentId: string = 'comment_842b9c1f';
4const broadcastId: string = 'bcast_frontpage_202603';
5const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.exampleSignature';
6
7const result: PinComment200Response = await unPinComment(tenantId, commentId, broadcastId, sso);
8

updateComment Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updatableCommentParams UpdatableCommentParams Yes
contextUserId string No
doSpamCheck boolean No
isLive boolean No

Response

Returns: FlagCommentPublic200Response

Example

updateComment Example
Copy Copy
1
2const tenantId: string = "tenant_acme_corp_01";
3const id: string = "comment_20260325_4592";
4const updatableCommentParams: UpdatableCommentParams = {
5 body: "Updated the response to include a link to the RFC and fixed a typo in the second paragraph.",
6 editedByUserId: "user_8721",
7 isVisible: true
8};
9const contextUserId: string = "user_8721";
10const doSpamCheck: boolean = true;
11const isLive: boolean = true;
12const result: FlagCommentPublic200Response = await updateComment(tenantId, id, updatableCommentParams, contextUserId, doSpamCheck, isLive);
13

voteComment Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
urlId string Yes
broadcastId string Yes
voteBodyParams VoteBodyParams Yes
sessionId string No
sso string No

Response

Returns: VoteComment200Response

Example

voteComment Example
Copy Copy
1
2const tenantId: string = 'tenant_9f8b7c';
3const commentId: string = 'cmt_42f3a1';
4const urlId: string = 'articles/ai-trends-2026';
5const broadcastId: string = 'web';
6const voteBodyParams: VoteBodyParams = { vote: 1, reason: 'Insightful and on-topic' };
7const sessionId: string = 'sess_6d2b4c9e';
8const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9';
9const result: VoteComment200Response = await voteComment(tenantId, commentId, urlId, broadcastId, voteBodyParams, sessionId, sso);
10

addDomainConfig Internal Link

Parameters

Name Type Required Description
tenantId string Yes
addDomainConfigParams AddDomainConfigParams Yes

Response

Returns: AddDomainConfig200Response

Example

addDomainConfig Example
Copy Copy
1
2const tenantId: string = 'tenant_6a9f8b2c';
3const params: AddDomainConfigParams = {
4 domain: 'comments.myproduct.io',
5 allowedOrigins: ['https://www.myproduct.io', 'https://app.myproduct.io'],
6 enforceHttps: true, // optional parameter
7 description: 'Comments subdomain for product site'
8};
9const response: AddDomainConfig200Response = await addDomainConfig(tenantId, params);
10

deleteDomainConfig Internal Link

Parameters

Name Type Required Description
tenantId string Yes
domain string Yes

Response

Returns: DeleteDomainConfig200Response

Example

deleteDomainConfig Example
Copy Copy
1
2const tenantId: string = 'tenant_8d3f2b4a9c';
3const domain: string = 'comments.myproduct.io';
4const response: DeleteDomainConfig200Response = await deleteDomainConfig(tenantId, domain);
5// Optional post-delete handler (demonstrates optional parameter usage)
6const onDeleted?: (res: DeleteDomainConfig200Response) => void = (res) => { /* notify admin, refresh UI */ };
7onDeleted?.(response);
8

getDomainConfig Internal Link

Parameters

Name Type Required Description
tenantId string Yes
domain string Yes

Response

Returns: GetDomainConfig200Response

Example

getDomainConfig Example
Copy Copy
1
2(async () => {
3 const tenantId: string = 'acme-tenant-93b2';
4 const domain: string = 'comments.acme.com';
5 const domainConfig: GetDomainConfig200Response = await getDomainConfig(tenantId, domain);
6 console.log(domainConfig);
7})();
8

getDomainConfigs Internal Link

Parameters

Name Type Required Description
tenantId string Yes

Response

Returns: GetDomainConfigs200Response

Example

getDomainConfigs Example
Copy Copy
1
2// getDomainConfigs only requires tenantId; there are no optional parameters for this call
3const tenantId: string = "acme-corp-001";
4const domainConfigs: GetDomainConfigs200Response = await getDomainConfigs(tenantId);
5

patchDomainConfig Internal Link

Parameters

Name Type Required Description
tenantId string Yes
domainToUpdate string Yes
patchDomainConfigParams PatchDomainConfigParams Yes

Response

Returns: GetDomainConfig200Response

Example

patchDomainConfig Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_42';
3const domainToUpdate: string = 'comments.acme-app.com';
4const patchDomainConfigParams: PatchDomainConfigParams = {
5 enableHttps: true,
6 allowedOrigins: ['https://www.acme-app.com', 'https://app.acme-app.com'], // optional list
7 redirectToPrimaryDomain: false // optional toggle
8} as PatchDomainConfigParams;
9const updatedConfig: GetDomainConfig200Response = await patchDomainConfig(tenantId, domainToUpdate, patchDomainConfigParams);
10

putDomainConfig Internal Link

Parameters

Name Type Required Description
tenantId string Yes
domainToUpdate string Yes
updateDomainConfigParams UpdateDomainConfigParams Yes

Response

Returns: GetDomainConfig200Response

Example

putDomainConfig Example
Copy Copy
1
2const tenantId: string = "tenant_92b4c1a7";
3const domainToUpdate: string = "blog.company-example.com";
4const updateDomainConfigParams: UpdateDomainConfigParams = {
5 enableComments: true,
6 moderationMode: "pre-moderation",
7 allowedOrigins: ["https://company-example.com", "https://studio.company-example.com"],
8 // optional parameter demonstrated by including redirectToCanonical (may be omitted)
9 redirectToCanonical: true
10};
11const response: GetDomainConfig200Response = await putDomainConfig(tenantId, domainToUpdate, updateDomainConfigParams);
12

createEmailTemplate Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createEmailTemplateBody CreateEmailTemplateBody Yes

Response

Returns: CreateEmailTemplate200Response

Example

createEmailTemplate Example
Copy Copy
1
2const tenantId: string = "tenant_7a9f3c2b";
3const customConfig: CustomConfigParameters = { smtpHost: "smtp.fastmail.com", smtpPort: 587, useTLS: true };
4const createEmailTemplateBody: CreateEmailTemplateBody = {
5 name: "Account Notification",
6 subject: "Your ACME account was updated",
7 fromEmail: "no-reply@acme-corp.com",
8 replyTo: "support@acme-corp.com",
9 html: "<p>Hi {{user.firstName}}, your account settings were changed.</p>",
10 text: "Hi {{user.firstName}}, your account settings were changed.",
11 isActive: true,
12 description: "Used for transactional account update emails",
13 customConfig
14};
15const result: CreateEmailTemplate200Response = await createEmailTemplate(tenantId, createEmailTemplateBody);
16

deleteEmailTemplate Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: FlagCommentPublic200Response

Example

deleteEmailTemplate Example
Copy Copy
1
2const tenantId: string = 'tenant_7f4c9d1e';
3const templateId: string = 'tmpl_welcome_2024-03';
4const notifyAdmin: boolean | undefined = true; // optional parameter example
5
6const result: FlagCommentPublic200Response = await deleteEmailTemplate(tenantId, templateId);
7

deleteEmailTemplateRenderError Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
errorId string Yes

Response

Returns: FlagCommentPublic200Response

Example

deleteEmailTemplateRenderError Example
Copy Copy
1
2const tenantId: string = 'tenant_7f3b4c2a';
3const templateEnvironment: string | undefined = 'production'; // optional environment selector
4const id: string = `emailTemplates/${templateEnvironment ?? 'staging'}/welcome_v2`;
5const errorId: string = 'err_5a9d2f1c';
6const result: FlagCommentPublic200Response = await deleteEmailTemplateRenderError(tenantId, id, errorId);
7console.log(result);
8

getEmailTemplate Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: GetEmailTemplate200Response

Example

getEmailTemplate Example
Copy Copy
1
2const tenantId: string = "acme-marketing-042";
3const templateId: string = "tpl_welcome_2026";
4const result: GetEmailTemplate200Response = await getEmailTemplate(tenantId, templateId);
5const template: CustomEmailTemplate | undefined = result.template;
6const subject: string | undefined = template?.subject;
7const customParams: CustomConfigParameters | undefined = template?.customConfigParameters;
8

getEmailTemplateDefinitions Internal Link

Parameters

Name Type Required Description
tenantId string Yes

Response

Returns: GetEmailTemplateDefinitions200Response

Example

getEmailTemplateDefinitions Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_eu_01';
3const templates: GetEmailTemplateDefinitions200Response = await getEmailTemplateDefinitions(tenantId);
4console.log('Email template definitions loaded for', tenantId, templates);
5

getEmailTemplateRenderErrors Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
skip number No

Response

Returns: GetEmailTemplateRenderErrors200Response

Example

getEmailTemplateRenderErrors Example
Copy Copy
1
2(async () => {
3 const tenantId: string = 'acme-tenant-42';
4 const id: string = 'tmpl_3fa85f64-5717-4562-b3fc-2c963f66afa6';
5 const skip: number = 20;
6 const result: GetEmailTemplateRenderErrors200Response = await getEmailTemplateRenderErrors(tenantId, id, skip);
7 console.log(result);
8})();
9

getEmailTemplates Internal Link

Parameters

Name Type Required Description
tenantId string Yes
skip number No

Response

Returns: GetEmailTemplates200Response

Example

getEmailTemplates Example
Copy Copy
1
2async function main(): Promise<void> {
3 const tenantId: string = 'tenant_5f3a9c2b';
4 const templates: GetEmailTemplates200Response = await getEmailTemplates(tenantId);
5 const skip: number = 20;
6 const pagedTemplates: GetEmailTemplates200Response = await getEmailTemplates(tenantId, skip);
7 console.log(templates, pagedTemplates);
8}
9main();
10

renderEmailTemplate Internal Link

Parameters

Name Type Required Description
tenantId string Yes
renderEmailTemplateBody RenderEmailTemplateBody Yes
locale string No

Response

Returns: RenderEmailTemplate200Response

Example

renderEmailTemplate Example
Copy Copy
1
2const tenantId: string = 'tenant_b6f3c2';
3const renderEmailTemplateBody: RenderEmailTemplateBody = {
4 templateId: 'comment-notification',
5 recipient: { name: 'Ava Thompson', email: 'ava.thompson@publisher.com' },
6 context: {
7 siteName: 'City Gazette',
8 commentText: 'Thanks for the in-depth coverage — very helpful.',
9 articleTitle: 'Downtown Redevelopment Plan Advances',
10 threadUrl: 'https://citygazette.example/articles/2026/redevelopment#comments'
11 }
12};
13const locale: string = 'en-US';
14const result: RenderEmailTemplate200Response = await renderEmailTemplate(tenantId, renderEmailTemplateBody, locale);
15

updateEmailTemplate Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updateEmailTemplateBody UpdateEmailTemplateBody Yes

Response

Returns: FlagCommentPublic200Response

Example

updateEmailTemplate Example
Copy Copy
1
2const tenantId: string = "tenant_76a4b2";
3const id: string = "template_9f3c1e";
4const updateEmailTemplateBody: UpdateEmailTemplateBody = {
5 name: "Comment Flag Notification",
6 subject: "A comment was flagged on your-site.com",
7 bodyHtml: "<p>Admin,</p><p>User {{commenterName}} flagged a comment: “{{commentText}}”</p>",
8 isEnabled: true,
9 description: "Email sent to moderators when a comment is flagged (optional field included)"
10};
11const result: FlagCommentPublic200Response = await updateEmailTemplate(tenantId, id, updateEmailTemplateBody);
12

getEventLog Internal Link

req tenantId urlId userIdWS

Parameters

Name Type Required Description
tenantId string Yes
urlId string Yes
userIdWS string Yes
startTime number Yes
endTime number Yes

Response

Returns: GetEventLog200Response

Example

getEventLog Example
Copy Copy
1
2const tenantId: string = 'fastcomments-tenant-01';
3const urlId: string = 'article-2026-03-25';
4const userIdWS: string | undefined = undefined; // optional upstream value
5const startTime: number = Date.parse('2026-03-01T00:00:00Z');
6const endTime: number = Date.parse('2026-03-25T23:59:59Z');
7
8const eventLogResponse: GetEventLog200Response = await getEventLog(
9 tenantId,
10 urlId,
11 userIdWS ?? 'ws_user_8b1f',
12 startTime,
13 endTime
14);
15

getGlobalEventLog Internal Link

req tenantId urlId userIdWS

Parameters

Name Type Required Description
tenantId string Yes
urlId string Yes
userIdWS string Yes
startTime number Yes
endTime number Yes

Response

Returns: GetEventLog200Response

Example

getGlobalEventLog Example
Copy Copy
1
2const tenantId: string = "tenant-84b2f1";
3const urlId: string = "article-6721";
4const userIdWS: string = "ws-conn-9a3c";
5const startTime: number = Date.now() - 7 * 24 * 60 * 60 * 1000; // 7 days ago
6const endTimeOptional: number | undefined = undefined; // optional timeframe end
7const endTime: number = endTimeOptional ?? Date.now();
8const eventLog: GetEventLog200Response = await getGlobalEventLog(tenantId, urlId, userIdWS, startTime, endTime);
9

createFeedPost Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createFeedPostParams CreateFeedPostParams Yes
broadcastId string No
isLive boolean No
doSpamCheck boolean No
skipDupCheck boolean No

Response

Returns: CreateFeedPost200Response

Example

createFeedPost Example
Copy Copy
1
2const tenantId: string = "tenant_7f3b9a";
3const createFeedPostParams: CreateFeedPostParams = {
4 title: "Weekly Product Update — March 2026",
5 body: "We've shipped performance improvements and bug fixes across the web client. See the release notes for details.",
6 authorId: "user_86fa2b",
7 allowComments: true,
8 media: [
9 {
10 url: "https://cdn.example.com/images/update-march.png",
11 mimeType: "image/png",
12 caption: "Performance graph",
13 assets: [{ url: "https://cdn.example.com/images/update-march@2x.png", width: 1600, height: 900 }]
14 }
15 ],
16 links: [{ url: "https://www.example.com/release-notes/march-2026", title: "Release notes" }]
17};
18const broadcastId: string = "broadcast_prod_updates_202603";
19const isLive: boolean = false;
20const doSpamCheck: boolean = true;
21const skipDupCheck: boolean = false;
22const result: CreateFeedPost200Response = await createFeedPost(tenantId, createFeedPostParams, broadcastId, isLive, doSpamCheck, skipDupCheck);
23

createFeedPostPublic Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createFeedPostParams CreateFeedPostParams Yes
broadcastId string No
sso string No

Response

Returns: CreateFeedPostPublic200Response

Example

createFeedPostPublic Example
Copy Copy
1
2const tenantId: string = "tenant_987654321";
3const asset: FeedPostMediaItemAsset = { url: "https://cdn.fastcomments.com/uploads/team-photo.jpg", mimeType: "image/jpeg", sizeBytes: 324512 };
4const mediaItem: FeedPostMediaItem = { type: "image", assets: [asset], caption: "Team launch day" };
5const link: FeedPostLink = { url: "https://www.example.com/blog/product-update-march-2026", title: "Product update — March 2026" };
6const createFeedPostParams: CreateFeedPostParams = {
7 title: "Product update — March 2026",
8 content: "<p>We shipped performance improvements and two new integrations.</p>",
9 media: [mediaItem],
10 link,
11 visibility: "public",
12 tags: ["product","release","march-2026"],
13 customConfig: { allowComments: true, requireTOS: false }
14};
15const broadcastId: string = "broadcast_2026_03_25_live";
16const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NSIsImlhdCI6MTY5MDI0MDB9.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
17const result: CreateFeedPostPublic200Response = await createFeedPostPublic(tenantId, createFeedPostParams, broadcastId, sso);
18

deleteFeedPostPublic Internal Link

Parameters

Name Type Required Description
tenantId string Yes
postId string Yes
broadcastId string No
sso string No

Response

Returns: DeleteFeedPostPublic200Response

Example

deleteFeedPostPublic Example
Copy Copy
1
2const tenantId: string = "tenant_5f8a9b3c";
3const postId: string = "post_a1b2c3d4";
4const broadcastId: string = "broadcast_2026-03-25T10:00:00Z";
5const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyMTIzIiwiaWF0IjoxNjE5MjM5MjAwfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
6
7const resultWithOptional: DeleteFeedPostPublic200Response = await deleteFeedPostPublic(tenantId, postId, broadcastId, sso);
8const resultRequiredOnly: DeleteFeedPostPublic200Response = await deleteFeedPostPublic(tenantId, postId);
9

getFeedPosts Internal Link

req tenantId afterId

Parameters

Name Type Required Description
tenantId string Yes
afterId string No
limit number No
tags Array No

Response

Returns: GetFeedPosts200Response

Example

getFeedPosts Example
Copy Copy
1
2const initialPage: GetFeedPosts200Response = await getFeedPosts('tenant_9f1b3d', undefined, 20, ['sports', 'local']);
3const nextPage: GetFeedPosts200Response = await getFeedPosts('tenant_9f1b3d', 'post_abc123', 20, ['sports', 'local']);
4

getFeedPostsPublic Internal Link

req tenantId afterId

Parameters

Name Type Required Description
tenantId string Yes
afterId string No
limit number No
tags Array No
sso string No
isCrawler boolean No
includeUserInfo boolean No

Response

Returns: GetFeedPostsPublic200Response

Example

getFeedPostsPublic Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_01';
3const afterId: string = 'fp_20260301_042';
4const limit: number = 25;
5const tags: Array<string> = ['technology', 'announcement'];
6const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiamRvZSJ9.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';
7const isCrawler: boolean = false;
8const includeUserInfo: boolean = true;
9const response: GetFeedPostsPublic200Response = await getFeedPostsPublic(tenantId, afterId, limit, tags, sso, isCrawler, includeUserInfo);
10

getFeedPostsStats Internal Link

Parameters

Name Type Required Description
tenantId string Yes
postIds Array Yes
sso string No

Response

Returns: GetFeedPostsStats200Response

Example

getFeedPostsStats Example
Copy Copy
1
2const tenantId: string = 'tenant_9b2f1c4a';
3const postIds: Array<string> = [
4 '8f14e45f-ea82-4c7a-b6b2-1a2b3c4d5e6f',
5 'd0e1f2a3-b4c5-6d7e-8f90-1234567890ab'
6];
7const sso: string = 'sso_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.signature';
8const statsWithoutSSO: GetFeedPostsStats200Response = await getFeedPostsStats(tenantId, postIds);
9const statsWithSSO: GetFeedPostsStats200Response = await getFeedPostsStats(tenantId, postIds, sso);
10

getUserReactsPublic Internal Link

Parameters

Name Type Required Description
tenantId string Yes
postIds Array No
sso string No

Response

Returns: GetUserReactsPublic200Response

Example

getUserReactsPublic Example
Copy Copy
1
2const tenantId: string = "acme-tenant-8a4d2c";
3const postIds: string[] = ["post-645a2f", "post-645a30"];
4const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzEyMyIsImlhdCI6MTY2MTYwMDAwMH0.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
5const result: GetUserReactsPublic200Response = await getUserReactsPublic(tenantId, postIds, sso);
6

reactFeedPostPublic Internal Link

Parameters

Name Type Required Description
tenantId string Yes
postId string Yes
reactBodyParams ReactBodyParams Yes
isUndo boolean No
broadcastId string No
sso string No

Response

Returns: ReactFeedPostPublic200Response

Example

reactFeedPostPublic Example
Copy Copy
1
2const tenantId: string = 'd290f1ee-6c54-4b01-90e6-d701748f0851';
3const postId: string = 'c1a2b3d4-5678-90ab-cdef-1234567890ab';
4const reactBodyParams: ReactBodyParams = { reaction: 'like', emoji: '👍', source: 'web' };
5const isUndo: boolean = false;
6const broadcastId: string = 'broadcast-2026-03-25-001';
7const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyMTIzIn0.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';
8const result: ReactFeedPostPublic200Response = await reactFeedPostPublic(tenantId, postId, reactBodyParams, isUndo, broadcastId, sso);
9

updateFeedPost Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
feedPost FeedPost Yes

Response

Returns: FlagCommentPublic200Response

Example

updateFeedPost Example
Copy Copy
1
2const tenantId: string = 'acme-global-tenant-42';
3const id: string = 'f47ac10b-58cc-4372-a567-0e02b2c3d479';
4
5const asset: FeedPostMediaItemAsset = {
6 url: 'https://cdn.acme.com/images/product-launch.jpg',
7 mimeType: 'image/jpeg',
8 width: 1200,
9 height: 630
10};
11
12const mediaItem: FeedPostMediaItem = {
13 id: 'media-001',
14 type: 'image',
15 asset
16};
17
18const link: FeedPostLink = {
19 url: 'https://acme.com/blog/product-launch',
20 title: 'Product Launch Details'
21};
22
23const feedPost: FeedPost = {
24 title: 'Introducing the Q3 Product Suite',
25 body: 'We are excited to unveil our new lineup for Q3, focusing on performance and security improvements.',
26 media: [mediaItem], // optional array included
27 links: [link], // optional links included
28 isPublished: true // optional publish flag used here
29};
30
31const result: FlagCommentPublic200Response = await updateFeedPost(tenantId, id, feedPost);
32

updateFeedPostPublic Internal Link

Parameters

Name Type Required Description
tenantId string Yes
postId string Yes
updateFeedPostParams UpdateFeedPostParams Yes
broadcastId string No
sso string No

Response

Returns: CreateFeedPostPublic200Response

Example

updateFeedPostPublic Example
Copy Copy
1
2const tenantId: string = "tenant_9f4b2";
3const postId: string = "post_21a8e";
4const updateFeedPostParams: UpdateFeedPostParams = {
5 title: "Quarterly product update",
6 body: "Major performance improvements and bug fixes deployed today. See release notes and schedule.",
7 links: [{ url: "https://status.example.com/release-notes", title: "Release notes" }],
8 media: [
9 {
10 type: "image",
11 assets: [{ url: "https://cdn.example.com/updates/q2.png", mimeType: "image/png", width: 1200, height: 628 }]
12 }
13 ]
14};
15const broadcastId: string = "broadcast_live_202603";
16const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.signature";
17const result: CreateFeedPostPublic200Response = await updateFeedPostPublic(tenantId, postId, updateFeedPostParams, broadcastId, sso);
18

flagCommentPublic Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
isFlagged boolean Yes
sso string No

Response

Returns: FlagCommentPublic200Response

Example

flagCommentPublic Example
Copy Copy
1
2const tenantId: string = "tenant_9f8b3c";
3const commentId: string = "comment_72a1d4";
4const isFlagged: boolean = true;
5const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1Njc4OSJ9.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
6const result: FlagCommentPublic200Response = await flagCommentPublic(tenantId, commentId, isFlagged, sso);
7

addHashTag Internal Link

Parameters

Name Type Required Description
tenantId string No
createHashTagBody CreateHashTagBody No

Response

Returns: AddHashTag200Response

Example

addHashTag Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_01';
3const createHashTagBody: CreateHashTagBody = {
4 name: 'feature-request',
5 label: 'Feature Request',
6 color: '#FF5722',
7 enabled: true
8};
9const response: AddHashTag200Response = await addHashTag(tenantId, createHashTagBody);
10const responseWithoutTenant: AddHashTag200Response = await addHashTag(undefined, createHashTagBody);
11

addHashTagsBulk Internal Link

Parameters

Name Type Required Description
tenantId string No
bulkCreateHashTagsBody BulkCreateHashTagsBody No

Response

Returns: AddHashTagsBulk200Response

Example

addHashTagsBulk Example
Copy Copy
1
2// Create tenant identifier (optional parameter)
3const tenantId: string = "tenant_9f8c2b7a";
4
5// Prepare individual tag entries
6const tag1: BulkCreateHashTagsBodyTagsInner = {
7 name: "product-feedback",
8 label: "Product Feedback",
9 color: "#1f8a70",
10 description: "User suggestions and enhancement requests",
11 isActive: true
12};
13
14const tag2: BulkCreateHashTagsBodyTagsInner = {
15 name: "bug-report",
16 label: "Bug Report",
17 color: "#d64545",
18 description: "User-reported defects and issues",
19 isActive: true
20};
21
22// Bulk create body (optional parameter)
23const bulkCreateHashTagsBody: BulkCreateHashTagsBody = {
24 tags: [tag1, tag2]
25};
26
27// Call the global async function and assign typed result
28const result: AddHashTagsBulk200Response = await addHashTagsBulk(tenantId, bulkCreateHashTagsBody);
29

deleteHashTag Internal Link

Parameters

Name Type Required Description
tag string Yes
tenantId string No
deleteHashTagRequest DeleteHashTagRequest No

Response

Returns: FlagCommentPublic200Response

Example

deleteHashTag Example
Copy Copy
1
2const tag: string = "breaking-news";
3const tenantId: string = "tenant_12345";
4const deleteRequest: DeleteHashTagRequest = { initiatedBy: "moderator@newsorg.com", purgeAllOccurrences: true };
5const result: FlagCommentPublic200Response = await deleteHashTag(tag, tenantId, deleteRequest);
6

getHashTags Internal Link

Parameters

Name Type Required Description
tenantId string Yes
page number No

Response

Returns: GetHashTags200Response

Example

getHashTags Example
Copy Copy
1
2const tenantId: string = 'acme-tenant-42';
3const pageNumber: number = 2;
4const responseWithPage: GetHashTags200Response = await getHashTags(tenantId, pageNumber);
5const responseWithoutPage: GetHashTags200Response = await getHashTags(tenantId);
6

patchHashTag Internal Link

Parameters

Name Type Required Description
tag string Yes
tenantId string No
updateHashTagBody UpdateHashTagBody No

Response

Returns: PatchHashTag200Response

Example

patchHashTag Example
Copy Copy
1
2const tag: string = "feature-ux-refresh";
3const tenantId: string = "tenant_4f92c1";
4const updateHashTagBody: UpdateHashTagBody = {
5 label: "UX Refresh",
6 description: "Track comments related to the 2026 UX redesign",
7 isActive: true,
8 metadata: { owner: "product-design", rolloutPhase: "phase-2" }
9};
10const response: PatchHashTag200Response = await patchHashTag(tag, tenantId, updateHashTagBody);
11

createModerator Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createModeratorBody CreateModeratorBody Yes

Response

Returns: CreateModerator200Response

Example

createModerator Example
Copy Copy
1
2const tenantId: string = 'tenant_7d9f2b4a';
3const customConfig: CustomConfigParameters = { timezone: 'UTC', moderationQueueEnabled: true };
4const createModeratorBody: CreateModeratorBody = {
5 email: 'jane.martin@publisher.com',
6 displayName: 'Jane Martin',
7 roles: ['moderator'],
8 sendWelcomeEmail: true,
9 customConfig
10};
11const response: CreateModerator200Response = await createModerator(tenantId, createModeratorBody);
12

deleteModerator Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
sendEmail string No

Response

Returns: FlagCommentPublic200Response

Example

deleteModerator Example
Copy Copy
1
2const tenantId: string = 'tenant_9f3b2d4a6c';
3const moderatorId: string = 'moderator_84a1b9c2';
4const sendEmail: string = 'true';
5const result: FlagCommentPublic200Response = await deleteModerator(tenantId, moderatorId, sendEmail);
6

getModerator Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: GetModerator200Response

Example

getModerator Example
Copy Copy
1
2const tenantId: string = 'acme-corp-tenant-123';
3const id: string = 'mod-987654321';
4const moderatorResponse: GetModerator200Response = await getModerator(tenantId, id);
5

getModerators Internal Link

Parameters

Name Type Required Description
tenantId string Yes
skip number No

Response

Returns: GetModerators200Response

Example

getModerators Example
Copy Copy
1
2const tenantId: string = 'tenant-12345-prod';
3const moderatorsPage1: GetModerators200Response = await getModerators(tenantId);
4const moderatorsPage2: GetModerators200Response = await getModerators(tenantId, 50);
5

sendInvite Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
fromName string Yes

Response

Returns: FlagCommentPublic200Response

Example

sendInvite Example
Copy Copy
1
2const tenantId: string = 'tenant_acme-42';
3const id: string = 'comment_8f3b21a7';
4const fromName: string = 'Elena Morales';
5const replyToEmail: string | undefined = undefined;
6
7const result: FlagCommentPublic200Response = await sendInvite(tenantId, id, fromName, replyToEmail);
8

updateModerator Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updateModeratorBody UpdateModeratorBody Yes

Response

Returns: FlagCommentPublic200Response

Example

updateModerator Example
Copy Copy
1
2const tenantId: string = "acme-enterprises-42";
3const id: string = "moderator_517";
4const updateModeratorBody: UpdateModeratorBody = {
5 displayName: "Sofia Martinez",
6 email: "sofia.martinez@acme.com",
7 permissions: ["approve_comments", "flag_spam", "suspend_users"],
8 active: true,
9 avatarUrl: "https://cdn.acme.com/avatars/sofia.jpg" // optional field demonstrated
10};
11const result: FlagCommentPublic200Response = await updateModerator(tenantId, id, updateModeratorBody);
12

deleteNotificationCount Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: FlagCommentPublic200Response

Example

deleteNotificationCount Example
Copy Copy
1
2const tenantSuffix: string | undefined = undefined;
3const tenantId: string = tenantSuffix ? `tenant-${tenantSuffix}` : 'tenant-9142a7';
4const id: string = '3f9b2a44-1c2e-4d3b-9f6a-8e7c6d5b2a1f';
5const result: FlagCommentPublic200Response = await deleteNotificationCount(tenantId, id);
6console.log(result);
7

getCachedNotificationCount Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: GetCachedNotificationCount200Response

Example

getCachedNotificationCount Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_42';
3const id: string = 'user_00012345';
4const includeUnreadOnly: boolean | undefined = true; // optional parameter flag (demonstrated)
5const result: GetCachedNotificationCount200Response = await getCachedNotificationCount(tenantId, id);
6

getNotificationCount Internal Link

Parameters

Name Type Required Description
tenantId string Yes
userId string No
urlId string No
fromCommentId string No
viewed boolean No
type string No

Response

Returns: GetNotificationCount200Response

Example

getNotificationCount Example
Copy Copy
1
2const tenantId: string = 'tenant_abc123';
3const userId: string = 'user_987654321';
4const urlId: string = 'https://example.com/news/2026/new-features';
5const viewed: boolean = false;
6const type: string = 'reply';
7const notificationCountResponse: GetNotificationCount200Response = await getNotificationCount(tenantId, userId, urlId, undefined, viewed, type);
8

getNotifications Internal Link

Parameters

Name Type Required Description
tenantId string Yes
userId string No
urlId string No
fromCommentId string No
viewed boolean No
type string No
skip number No

Response

Returns: GetNotifications200Response

Example

getNotifications Example
Copy Copy
1
2const tenantId: string = "tenant_84b3f2";
3const userId: string = "user_1279";
4const urlId: string = "https://www.example.com/articles/2026/03/25/new-feature";
5const fromCommentId: string = "cmt_5421";
6const viewed: boolean = false;
7const type: string = "mention";
8const skip: number = 0;
9const notifications: GetNotifications200Response = await getNotifications(tenantId, userId, urlId, fromCommentId, viewed, type, skip);
10

updateNotification Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updateNotificationBody UpdateNotificationBody Yes
userId string No

Response

Returns: FlagCommentPublic200Response

Example

updateNotification Example
Copy Copy
1
2const tenantId: string = 'tenant_prod_8f4b2c';
3const id: string = 'notification_61a2e9';
4const userId: string = 'moderator_107';
5const updateNotificationBody: UpdateNotificationBody = {
6 name: 'Flagged Comment Notification',
7 enabled: true,
8 channels: ['email', 'inbox'],
9 templateId: 'tmpl_mod_alerts_01',
10 severity: 'high'
11};
12const result: FlagCommentPublic200Response = await updateNotification(tenantId, id, updateNotificationBody, userId);
13

addPage Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createAPIPageData CreateAPIPageData Yes

Response

Returns: AddPageAPIResponse

Example

addPage Example
Copy Copy
1
2const tenantId: string = "acme-corp-prod-01";
3const createData: CreateAPIPageData = {
4 url: "/docs/2026/comment-moderation",
5 title: "Comment Moderation Guide",
6 description: "Step-by-step instructions to configure moderation workflows for community posts.",
7 language: "en-US", // optional field
8 metadata: { productArea: "support", owner: "platform-team" } // optional field
9};
10const result: AddPageAPIResponse = await addPage(tenantId, createData);
11

deletePage Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: DeletePageAPIResponse

Example

deletePage Example
Copy Copy
1
2const tenantId: string = 'tenant_7c1ab2ef';
3const id: string = 'b5f9c3d0-12ab-4e6f-9a2c-3d4b5a6e7f8a';
4const response: DeletePageAPIResponse = await deletePage(tenantId, id);
5

getPageByURLId Internal Link

Parameters

Name Type Required Description
tenantId string Yes
urlId string Yes

Response

Returns: GetPageByURLIdAPIResponse

Example

getPageByURLId Example
Copy Copy
1
2const tenantId: string = 'acme-corp-742';
3const urlId: string = 'blog-article-9f4b2c';
4const response: GetPageByURLIdAPIResponse = await getPageByURLId(tenantId, urlId);
5const page: APIPage | undefined = response.page;
6const pageId: string | undefined = page?.id
7

getPages Internal Link

Parameters

Name Type Required Description
tenantId string Yes

Response

Returns: GetPagesAPIResponse

Example

getPages Example
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_8a7b3d2f';
4 const result: GetPagesAPIResponse = await getPages(tenantId);
5 const pages: APIPage[] = result.pages ?? [];
6 const firstPageId: string | undefined = pages[0]?.id;
7 console.log(`Tenant ${tenantId} has ${pages.length} pages; first page id: ${firstPageId}`);
8})();
9

patchPage Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updateAPIPageData UpdateAPIPageData Yes

Response

Returns: PatchPageAPIResponse

Example

patchPage Example
Copy Copy
1
2const tenantId: string = 'tenant_7f3b2a4c';
3const pageId: string = 'page_9c1d8f7';
4const updateAPIPageData: UpdateAPIPageData = {
5 title: 'How to use FastComments with TypeScript',
6 path: '/guides/fastcomments-typescript',
7 isPublished: true,
8 metadata: { author: 'Alex Martinez', tags: ['comments', 'typescript'] } // optional field included
9};
10const result: PatchPageAPIResponse = await patchPage(tenantId, pageId, updateAPIPageData);
11

deletePendingWebhookEvent Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: FlagCommentPublic200Response

Example

deletePendingWebhookEvent Example
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_42f7c9b1';
4 const id: string = 'pending_webhook_ev_8f3b9a2d';
5 const reason?: string = undefined; // optional parameter example (not required by the function)
6 const result: FlagCommentPublic200Response = await deletePendingWebhookEvent(tenantId, id);
7 console.log(result);
8})();
9

getPendingWebhookEventCount Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string No
externalId string No
eventType string No
type string No
domain string No
attemptCountGT number No

Response

Returns: GetPendingWebhookEventCount200Response

Example

getPendingWebhookEventCount Example
Copy Copy
1
2const tenantId: string = "tenant_8d3b7a2f";
3const commentId: string | undefined = "comment_79a2b";
4const eventType: string | undefined = "comment.created";
5const domain: string | undefined = "forum.acme-corp.com";
6const attemptCountGT: number | undefined = 1;
7const result: GetPendingWebhookEventCount200Response = await getPendingWebhookEventCount(
8 tenantId,
9 commentId,
10 undefined,
11 eventType,
12 undefined,
13 domain,
14 attemptCountGT
15);
16

getPendingWebhookEvents Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string No
externalId string No
eventType string No
type string No
domain string No
attemptCountGT number No
skip number No

Response

Returns: GetPendingWebhookEvents200Response

Example

getPendingWebhookEvents Example
Copy Copy
1
2const tenantId: string = 'tenant_9b3f7c';
3const commentId: string | undefined = undefined;
4const externalId: string | undefined = 'external-572a';
5const eventType: string | undefined = 'comment.updated';
6const type: string | undefined = 'outbound';
7const domain: string | undefined = 'reviews.example.com';
8const attemptCountGT: number | undefined = 1;
9const skip: number | undefined = 20;
10
11const result: GetPendingWebhookEvents200Response = await getPendingWebhookEvents(
12 tenantId,
13 commentId,
14 externalId,
15 eventType,
16 type,
17 domain,
18 attemptCountGT,
19 skip
20);
21

createQuestionConfig Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createQuestionConfigBody CreateQuestionConfigBody Yes

Response

Returns: CreateQuestionConfig200Response

Example

createQuestionConfig Example
Copy Copy
1
2const tenantId: string = "tenant_9f8b2c";
3const option: QuestionConfigCustomOptionsInner = { id: "opt_yes", label: "Yes, helpful", value: "yes" };
4const createQuestionConfigBody: CreateQuestionConfigBody = {
5 title: "Article usefulness",
6 prompt: "Was this article helpful?",
7 type: "singleChoice",
8 required: false, // optional parameter demonstrated
9 options: [option],
10 saveBehavior: "immediate"
11};
12const result: CreateQuestionConfig200Response = await createQuestionConfig(tenantId, createQuestionConfigBody);
13

deleteQuestionConfig Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: FlagCommentPublic200Response

Example

deleteQuestionConfig Example
Copy Copy
1
2const tenantId: string = "acme-enterprises-01";
3const idOptional: string | undefined = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
4const id: string = idOptional ?? "11111111-1111-1111-1111-111111111111";
5const response: FlagCommentPublic200Response = await deleteQuestionConfig(tenantId, id);
6

getQuestionConfig Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: GetQuestionConfig200Response

Example

getQuestionConfig Example
Copy Copy
1
2const tenantId: string = 'acme-tenant-92';
3const id: string = 'question-2026-07-42';
4const response: GetQuestionConfig200Response = await getQuestionConfig(tenantId, id);
5
6function summarize(cfg: GetQuestionConfig200Response, includeDetails?: boolean): string {
7 return includeDetails ? 'Question config (detailed)' : 'Question config (summary)';
8}
9
10const summary: string = summarize(response);
11

getQuestionConfigs Internal Link

Parameters

Name Type Required Description
tenantId string Yes
skip number No

Response

Returns: GetQuestionConfigs200Response

Example

getQuestionConfigs Example
Copy Copy
1
2const tenantId: string = "tenant_acme_9876";
3const configsWithoutSkip: GetQuestionConfigs200Response = await getQuestionConfigs(tenantId);
4const configsWithSkip: GetQuestionConfigs200Response = await getQuestionConfigs(tenantId, 20);
5

updateQuestionConfig Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updateQuestionConfigBody UpdateQuestionConfigBody Yes

Response

Returns: FlagCommentPublic200Response

Example

updateQuestionConfig Example
Copy Copy
1
2const tenantId: string = 'tenant_42e8b';
3const id: string = 'question_9f4a2';
4const updateQuestionConfigBody: UpdateQuestionConfigBody = {
5 questionText: 'How helpful was this article?',
6 description: 'Shown to users below the question (optional)',
7 required: true,
8 renderingType: 'Likert' as QuestionRenderingType,
9 customOptions: [
10 { label: 'Very helpful', value: '5' } as QuestionConfigCustomOptionsInner,
11 { label: 'Somewhat helpful', value: '3' } as QuestionConfigCustomOptionsInner,
12 { label: 'Not helpful', value: '1' } as QuestionConfigCustomOptionsInner
13 ],
14 whenSave: 'notify' as QuestionWhenSave
15};
16const result: FlagCommentPublic200Response = await updateQuestionConfig(tenantId, id, updateQuestionConfigBody);
17

createQuestionResult Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createQuestionResultBody CreateQuestionResultBody Yes

Response

Returns: CreateQuestionResult200Response

Example

createQuestionResult Example
Copy Copy
1
2const tenantId: string = "tenant-72b1f4";
3const meta: MetaItem[] = [{ key: "platform", value: "web" }];
4const createQuestionResultBody: CreateQuestionResultBody = {
5 questionId: "question-83472",
6 commenterId: "user-5521",
7 answers: [{ subQuestionId: "sq-1", value: "Yes" }],
8 meta, // optional metadata
9 note: "Follow-up requested" // optional parameter demonstrated
10};
11const result: CreateQuestionResult200Response = await createQuestionResult(tenantId, createQuestionResultBody);
12

deleteQuestionResult Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: FlagCommentPublic200Response

Example

deleteQuestionResult Example
Copy Copy
1
2const tenantId: string = "org-82479";
3const questionId: string = "q-6a3d2e1f";
4const includeArchived?: boolean = false; // optional parameter demonstrating alternate target selection
5const targetId: string = includeArchived ? "q-archived-112233" : questionId;
6const result: FlagCommentPublic200Response = await deleteQuestionResult(tenantId, targetId);
7

getQuestionResult Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: GetQuestionResult200Response

Example

getQuestionResult Example
Copy Copy
1
2const post: { title: string; questionId?: string } = { title: 'Product feedback' };
3const tenantId: string = 'acme-corp-tenant-01';
4const id: string = post.questionId ?? 'q-8f3a7b2c4d9e';
5const result: GetQuestionResult200Response = await getQuestionResult(tenantId, id);
6

getQuestionResults Internal Link

Parameters

Name Type Required Description
tenantId string Yes
urlId string No
userId string No
startDate string No
questionId string No
questionIds string No
skip number No

Response

Returns: GetQuestionResults200Response

Example

getQuestionResults Example
Copy Copy
1
2const tenantId: string = "tenant_acme_001";
3const urlId: string = "articles/product-launch-2026";
4const userId: string = "user_2048";
5const startDate: string = "2026-03-01T00:00:00Z";
6const questionId: string | undefined = undefined;
7const questionIds: string | undefined = "q_101,q_102";
8const skip: number | undefined = 0;
9
10const result: GetQuestionResults200Response = await getQuestionResults(tenantId, urlId, userId, startDate, questionId, questionIds, skip);
11

updateQuestionResult Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updateQuestionResultBody UpdateQuestionResultBody Yes

Response

Returns: FlagCommentPublic200Response

Example

updateQuestionResult Example
Copy Copy
1
2const tenantId: string = 'tenant_7f8b3c';
3const id: string = 'questionResult_4621';
4const updateQuestionResultBody: UpdateQuestionResultBody = {
5 questionId: 'q_1024',
6 result: 'flagged',
7 score: 0.92,
8 notes: 'Automated moderation flagged for review',
9 meta: [{ key: 'source', value: 'ai-moderator' }] as MetaItem[], // optional metadata
10 status: { code: 'review_pending' } as APIStatus
11} as UpdateQuestionResultBody;
12const result: FlagCommentPublic200Response = await updateQuestionResult(tenantId, id, updateQuestionResultBody);
13

aggregateQuestionResults Internal Link

Parameters

Name Type Required Description
tenantId string Yes
questionId string No
questionIds Array No
urlId string No
timeBucket AggregateTimeBucket No
startDate Date No
forceRecalculate boolean No

Response

Returns: AggregateQuestionResults200Response

Example

aggregateQuestionResults Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_98765';
3const questionIds: Array<string> = ['q-102', 'q-103'];
4const urlId: string = 'url_55b3';
5const timeBucket: AggregateTimeBucket = { unit: 'day', size: 7 };
6const startDate: Date = new Date('2026-01-01T00:00:00Z');
7const forceRecalculate: boolean = true;
8
9const result: AggregateQuestionResults200Response = await aggregateQuestionResults(
10 tenantId,
11 undefined, // questionId omitted, using questionIds instead
12 questionIds,
13 urlId,
14 timeBucket,
15 startDate,
16 forceRecalculate
17);
18

bulkAggregateQuestionResults Internal Link

Parameters

Name Type Required Description
tenantId string Yes
bulkAggregateQuestionResultsRequest BulkAggregateQuestionResultsRequest Yes
forceRecalculate boolean No

Response

Returns: BulkAggregateQuestionResults200Response

Example

bulkAggregateQuestionResults Example
Copy Copy
1
2const tenantId: string = "tenant_live_7c9d";
3const bulkAggregateQuestionResultsRequest: BulkAggregateQuestionResultsRequest = {
4 items: [
5 { questionId: "q_feedback_rating", includeSubQuestions: false, filters: { locale: "en-US" } }
6 ],
7 timeBuckets: [
8 { granularity: "day", startUtc: "2026-03-01T00:00:00Z", endUtc: "2026-03-15T00:00:00Z" }
9 ]
10};
11const forceRecalculate: boolean = true;
12const result: BulkAggregateQuestionResults200Response = await bulkAggregateQuestionResults(tenantId, bulkAggregateQuestionResultsRequest, forceRecalculate);
13

combineCommentsWithQuestionResults Internal Link

Parameters

Name Type Required Description
tenantId string Yes
questionId string No
questionIds Array No
urlId string No
startDate Date No
forceRecalculate boolean No
minValue number No
maxValue number No
limit number No

Response

Returns: CombineCommentsWithQuestionResults200Response

Example

combineCommentsWithQuestionResults Example
Copy Copy
1
2const tenantId: string = 'tenant_9f3a2';
3const questionIds: string[] = ['question-42', 'question-43'];
4const urlId: string = 'url_5d7b';
5const startDate: Date = new Date('2026-02-01T00:00:00Z');
6const forceRecalculate: boolean = true;
7const minValue: number = 1;
8const maxValue: number = 5;
9const limit: number = 50;
10const result: CombineCommentsWithQuestionResults200Response = await combineCommentsWithQuestionResults(
11 tenantId,
12 undefined,
13 questionIds,
14 urlId,
15 startDate,
16 forceRecalculate,
17 minValue,
18 maxValue,
19 limit
20);
21

addSSOUser Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createAPISSOUserData CreateAPISSOUserData Yes

Response

Returns: AddSSOUserAPIResponse

Example

addSSOUser Example
Copy Copy
1
2const tenantId: string = 'acme-tenant-7f8c2d4b';
3const createAPISSOUserData: CreateAPISSOUserData = {
4 externalId: 'okta|00u1abcd2345EfGH',
5 email: 'jane.doe@acme-corp.com',
6 displayName: 'Jane Doe',
7 avatarUrl: 'https://cdn.acme-corp.com/avatars/jane.jpg',
8 sendWelcomeEmail: true,
9 metadata: { department: 'Engineering', employeeId: 'E12345' }
10};
11const result: AddSSOUserAPIResponse = await addSSOUser(tenantId, createAPISSOUserData);
12

deleteSSOUser Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
deleteComments boolean No
commentDeleteMode string No

Response

Returns: DeleteSSOUserAPIResponse

Example

deleteSSOUser Example
Copy Copy
1
2const tenantId: string = 'tenant_8a3f4c2b-6d1a';
3const id: string = 'sso_user_3f9a7b1d-22c4';
4const deleteComments: boolean = true;
5const commentDeleteMode: string = 'permanent';
6const responseWithDeletion: DeleteSSOUserAPIResponse = await deleteSSOUser(tenantId, id, deleteComments, commentDeleteMode);
7const responseWithoutDeletion: DeleteSSOUserAPIResponse = await deleteSSOUser(tenantId, id);
8

getSSOUserByEmail Internal Link

Parameters

Name Type Required Description
tenantId string Yes
email string Yes

Response

Returns: GetSSOUserByEmailAPIResponse

Example

getSSOUserByEmail Example
Copy Copy
1
2const tenantId: string = "tenant_fc_7a9d3b";
3const email: string = "laura.powell@dailynews.com";
4const response: GetSSOUserByEmailAPIResponse = await getSSOUserByEmail(tenantId, email);
5const ssoUser: APISSOUser | undefined = response.user;
6const ssoUserEmail: string | undefined = ssoUser?.email;
7

getSSOUserById Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: GetSSOUserByIdAPIResponse

Example

getSSOUserById Example
Copy Copy
1
2const tenantId: string = "fastcomments-enterprise-42";
3const id: string = "sso_user_9f3b1c2d";
4const result: GetSSOUserByIdAPIResponse = await getSSOUserById(tenantId, id);
5const ssoUser: APISSOUser | undefined = result.user;
6const email: string | undefined = ssoUser?.email;
7console.log(email);
8

getSSOUsers Internal Link

Parameters

Name Type Required Description
tenantId string Yes
skip number No

Response

Returns: GetSSOUsers200Response

Example

getSSOUsers Example
Copy Copy
1
2const tenantId: string = 'tenant_4a9f3b2c-01';
3const resultWithoutSkip: GetSSOUsers200Response = await getSSOUsers(tenantId);
4
5const skip: number = 25;
6const resultWithSkip: GetSSOUsers200Response = await getSSOUsers(tenantId, skip);
7

patchSSOUser Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updateAPISSOUserData UpdateAPISSOUserData Yes
updateComments boolean No

Response

Returns: PatchSSOUserAPIResponse

Example

patchSSOUser Example
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_acme_01';
4 const id: string = 'ssouser_0a1b2c3d';
5 const updateData: UpdateAPISSOUserData = {
6 email: 'jane.doe@acme-corp.com',
7 name: 'Jane Doe',
8 provider: 'saml',
9 externalId: 'CN=Jane Doe,OU=Users,DC=acme,DC=com'
10 };
11 const updateComments: boolean = true;
12 const result: PatchSSOUserAPIResponse = await patchSSOUser(tenantId, id, updateData, updateComments);
13})();
14

putSSOUser Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updateAPISSOUserData UpdateAPISSOUserData Yes
updateComments boolean No

Response

Returns: PutSSOUserAPIResponse

Example

putSSOUser Example
Copy Copy
1
2const tenantId: string = "fastcomments_tenant_7f3a2b";
3const id: string = "sso_user_4a9c21";
4const updateData: UpdateAPISSOUserData = {
5 email: "marija.kovacevic@example.com",
6 displayName: "Marija K.",
7 roles: ["moderator"],
8 avatarUrl: "https://cdn.example.com/avatars/marija.jpg",
9 externalId: "marija-kovacevic-01"
10};
11const updateComments: boolean = true;
12const result: PutSSOUserAPIResponse = await putSSOUser(tenantId, id, updateData, updateComments);
13

createSubscription Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createAPIUserSubscriptionData CreateAPIUserSubscriptionData Yes

Response

Returns: CreateSubscriptionAPIResponse

Example

createSubscription Example
Copy Copy
1
2const tenantId: string = "acme-corp-123";
3const createAPIUserSubscriptionData: CreateAPIUserSubscriptionData = {
4 userId: "u_987654",
5 planId: "pro_monthly",
6 startDate: new Date().toISOString(),
7 trialDays: 14, // optional parameter demonstrated
8 metadata: { source: "marketing-email" } // optional parameter demonstrated
9};
10const result: CreateSubscriptionAPIResponse = await createSubscription(tenantId, createAPIUserSubscriptionData);
11const subscription: APIUserSubscription = result.subscription;
12

deleteSubscription Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
userId string No

Response

Returns: DeleteSubscriptionAPIResponse

Example

deleteSubscription Example
Copy Copy
1
2const responseWithoutUser: DeleteSubscriptionAPIResponse = await deleteSubscription('tenant_9f8b7a6c', 'sub_3a9d2e7b');
3const responseWithUser: DeleteSubscriptionAPIResponse = await deleteSubscription('tenant_9f8b7a6c', 'sub_8b2c4f1d', 'user_47b2f9c1');
4

getSubscriptions Internal Link

Parameters

Name Type Required Description
tenantId string Yes
userId string No

Response

Returns: GetSubscriptionsAPIResponse

Example

getSubscriptions Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_corp_01';
3const userId: string = 'user_76a3b9f2';
4const subscriptionsForUser: GetSubscriptionsAPIResponse = await getSubscriptions(tenantId, userId);
5const subscriptionsForTenant: GetSubscriptionsAPIResponse = await getSubscriptions(tenantId);
6

updateSubscription Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updateAPIUserSubscriptionData UpdateAPIUserSubscriptionData Yes
userId string No

Response

Returns: UpdateSubscriptionAPIResponse

Example

updateSubscription Example
Copy Copy
1
2const tenantId: string = 'tenant_9f3b2c';
3const subscriptionId: string = 'sub_7641a2b3';
4const updateData: UpdateAPIUserSubscriptionData = {
5 status: 'active',
6 planId: 'pro_annual',
7 autoRenew: true,
8 renewalDate: '2026-04-15T00:00:00Z',
9 metadata: { upgradedBy: 'billing-team' }
10};
11const userId: string = 'user_215';
12const result: UpdateSubscriptionAPIResponse = await updateSubscription(tenantId, subscriptionId, updateData, userId);
13

getTenantDailyUsages Internal Link

Parameters

Name Type Required Description
tenantId string Yes
yearNumber number No
monthNumber number No
dayNumber number No
skip number No

Response

Returns: GetTenantDailyUsages200Response

Example

getTenantDailyUsages Example
Copy Copy
1
2const tenantId: string = 'tenant_5f4a3b2c-1d6e-4f9a-b9d8-123456789abc';
3const yearNumber: number = 2026;
4const monthNumber: number = 3;
5const dayNumber: number = 24;
6const skip: number = 0;
7
8const result: GetTenantDailyUsages200Response = await getTenantDailyUsages(tenantId, yearNumber, monthNumber, dayNumber, skip);
9

createTenantPackage Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createTenantPackageBody CreateTenantPackageBody Yes

Response

Returns: CreateTenantPackage200Response

Example

createTenantPackage Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_001';
3const createTenantPackageBody: CreateTenantPackageBody = {
4 packageName: 'Standard Moderation',
5 description: 'Suitable for small-to-medium sites: basic moderation, spam rules, and analytics',
6 maxCommentsPerMinute: 50,
7 allowAnonymousComments: false, // optional parameter provided
8 // optional fields omitted: e.g., advanced moderation rules, custom CSS
9 customConfigParameters: {
10 enableProfanityFilter: true,
11 imageContentProfanityLevel: 'medium' // illustrative value; uses CustomConfigParameters shape
12 }
13};
14const response: CreateTenantPackage200Response = await createTenantPackage(tenantId, createTenantPackageBody);
15console.log(response);
16

deleteTenantPackage Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: FlagCommentPublic200Response

Example

deleteTenantPackage Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_corp_987';
3const packageId: string = 'pkg_pro_2026_01';
4type DeleteOptions = { force?: boolean; notify?: boolean };
5const options: DeleteOptions = { force: true }; // optional parameters demonstrated
6const result: FlagCommentPublic200Response = await deleteTenantPackage(tenantId, packageId);
7

getTenantPackage Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: GetTenantPackage200Response

Example

getTenantPackage Example
Copy Copy
1
2const tenantId: string = 'tenant_7f3b2c8';
3const packageId: string = 'pkg_standard_2026';
4const requestOptions: { includeConfig?: boolean } = { includeConfig: true };
5const packageResponse: GetTenantPackage200Response = await getTenantPackage(tenantId, packageId);
6

getTenantPackages Internal Link

Parameters

Name Type Required Description
tenantId string Yes
skip number No

Response

Returns: GetTenantPackages200Response

Example

getTenantPackages Example
Copy Copy
1
2const tenantId: string = "tenant_7f8e3b4c";
3const skip: number = 20;
4const packagesDefault: GetTenantPackages200Response = await getTenantPackages(tenantId);
5const packagesWithSkip: GetTenantPackages200Response = await getTenantPackages(tenantId, skip);
6

replaceTenantPackage Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
replaceTenantPackageBody ReplaceTenantPackageBody Yes

Response

Returns: FlagCommentPublic200Response

Example

replaceTenantPackage Example
Copy Copy
1
2const tenantId: string = "tenant-9f3c2a";
3const id: string = "pkg_4f8b21";
4const replaceTenantPackageBody: ReplaceTenantPackageBody = {
5 packageName: "Premium Moderation Pack",
6 enabled: true,
7 apiStatus: { mode: "active" } as APIStatus,
8 customConfigParameters: { maxFlagsBeforeReview: 5 } as CustomConfigParameters,
9 voteStyle: "thumbs" as VoteStyle,
10 tosConfig: { requireAcceptance: true } as TOSConfig
11};
12const result: FlagCommentPublic200Response = await replaceTenantPackage(tenantId, id, replaceTenantPackageBody);
13

updateTenantPackage Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updateTenantPackageBody UpdateTenantPackageBody Yes

Response

Returns: FlagCommentPublic200Response

Example

updateTenantPackage Example
Copy Copy
1
2const tenantId: string = "tenant_3b7f9d-prod";
3const id: string = "pkg_enterprise_2026";
4const updateTenantPackageBody: UpdateTenantPackageBody = {
5 name: "Enterprise Plus",
6 isActive: true,
7 // optional fields omitted intentionally (e.g., description, limits)
8} as UpdateTenantPackageBody;
9const result: FlagCommentPublic200Response = await updateTenantPackage(tenantId, id, updateTenantPackageBody);
10

createTenantUser Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createTenantUserBody CreateTenantUserBody Yes

Response

Returns: CreateTenantUser200Response

Example

createTenantUser Example
Copy Copy
1
2const tenantId: string = 'tenant_6f4b2c';
3const createTenantUserBody: CreateTenantUserBody = {
4 email: 'sara.kim@example.com',
5 displayName: 'Sara Kim',
6 role: 'moderator',
7 notifyOnMentions: true
8};
9const result: CreateTenantUser200Response = await createTenantUser(tenantId, createTenantUserBody);
10

deleteTenantUser Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
deleteComments string No
commentDeleteMode string No

Response

Returns: FlagCommentPublic200Response

Example

deleteTenantUser Example
Copy Copy
1
2const tenantId: string = '4f3a9b2e-1c6a-4f7b-9e2a-0b8d6f1c2a3e';
3const userId: string = '9d2f7b3a-5c4e-48a2-b1f0-6c7d8e9f0a12';
4const deleteComments: string = 'true';
5const commentDeleteMode: string = 'permanent';
6const result: FlagCommentPublic200Response = await deleteTenantUser(tenantId, userId, deleteComments, commentDeleteMode);
7

getTenantUser Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: GetTenantUser200Response

Example

getTenantUser Example
Copy Copy
1
2const tenantId: string = 'tenant_fc5a9b2c';
3const userId: string = 'user_0a12b3';
4const result: GetTenantUser200Response = await getTenantUser(tenantId, userId);
5const user: User | undefined = (result as any).user; // accessing payload
6const userEmail: string | undefined = user?.email;
7console.log('Fetched user email:', userEmail);
8

getTenantUsers Internal Link

Parameters

Name Type Required Description
tenantId string Yes
skip number No

Response

Returns: GetTenantUsers200Response

Example

getTenantUsers Example
Copy Copy
1
2const tenantId: string = 'tenant_prod_8a3f2c';
3const skip: number = 50;
4const usersWithSkip: GetTenantUsers200Response = await getTenantUsers(tenantId, skip);
5const usersNoSkip: GetTenantUsers200Response = await getTenantUsers(tenantId);
6

replaceTenantUser Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
replaceTenantUserBody ReplaceTenantUserBody Yes
updateComments string No

Response

Returns: FlagCommentPublic200Response

Example

replaceTenantUser Example
Copy Copy
1
2const tenantId: string = 'tenant_9d8f4b2c';
3const id: string = 'user_f47ac10b';
4const replaceTenantUserBody: ReplaceTenantUserBody = {
5 externalId: 'ext-5234',
6 email: 'jane.doe@acme.com',
7 displayName: 'Jane Doe',
8 roles: ['moderator'],
9 metadata: { department: 'product', region: 'us-east-1' }
10};
11const updateComments: string = 'propagate-display-name-to-comments';
12
13const result: FlagCommentPublic200Response = await replaceTenantUser(tenantId, id, replaceTenantUserBody, updateComments);
14

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
redirectURL string No

Response

Returns: FlagCommentPublic200Response

Example

sendLoginLink Example
Copy Copy
1
2const tenantId: string = "tenant_12a9f3b7";
3const id: string = "user_84b2c7d1";
4const redirectURL: string = "https://app.mycompany.com/welcome?ref=login_email";
5const resultWithoutRedirect: FlagCommentPublic200Response = await sendLoginLink(tenantId, id);
6const resultWithRedirect: FlagCommentPublic200Response = await sendLoginLink(tenantId, id, redirectURL);
7

updateTenantUser Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updateTenantUserBody UpdateTenantUserBody Yes
updateComments string No

Response

Returns: FlagCommentPublic200Response

Example

updateTenantUser Example
Copy Copy
1
2const tenantId: string = "tenant_8f3b2a9d";
3const id: string = "user_52c9f1ab";
4const updateTenantUserBody: UpdateTenantUserBody = {
5 email: "jane.doe@example.com",
6 displayName: "Jane Doe",
7 roles: ["moderator"],
8 isActive: true,
9 metadata: { signupSource: "sso", locale: "en-US" }
10};
11const updateComments: string = "Promoted to moderator and updated display name";
12const result: FlagCommentPublic200Response = await updateTenantUser(tenantId, id, updateTenantUserBody, updateComments);
13

createTenant Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createTenantBody CreateTenantBody Yes

Response

Returns: CreateTenant200Response

Example

createTenant Example
Copy Copy
1
2const tenantId: string = "acme-corp-001";
3const createTenantBody: CreateTenantBody = {
4 name: "Acme Corporation",
5 domain: "comments.acme.com",
6 adminContact: { name: "Jane Doe", email: "jane.doe@acme.com" },
7 billingInfo: { planId: "pro-monthly", billingContactEmail: "billing@acme.com" },
8 importedSite: { siteId: "site-123", siteName: "Acme Blog" } // optional imported site
9};
10const result: CreateTenant200Response = await createTenant(tenantId, createTenantBody);
11

deleteTenant Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
sure string No

Response

Returns: FlagCommentPublic200Response

Example

deleteTenant Example
Copy Copy
1
2const tenantId: string = "tenant_7f3d2c";
3const id: string = "flag_8392b1a7";
4const sure: string = "confirmed";
5
6const responseWithoutSure: FlagCommentPublic200Response = await deleteTenant(tenantId, id);
7const responseWithSure: FlagCommentPublic200Response = await deleteTenant(tenantId, id, sure);
8

getTenant Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: GetTenant200Response

Example

getTenant Example
Copy Copy
1
2const tenantId: string = "tenant_9f4b2c1a";
3const idOverride: string | undefined = undefined; // optional override, if available
4const id: string = idOverride ?? "site_3e7a6b2f";
5const response: GetTenant200Response = await getTenant(tenantId, id);
6console.log(response);
7

getTenants Internal Link

Parameters

Name Type Required Description
tenantId string Yes
meta string No
skip number No

Response

Returns: GetTenants200Response

Example

getTenants Example
Copy Copy
1
2const tenantId: string = 'tenant_8421e7';
3const meta: string = 'include=domains,billing,customConfig';
4const skip: number = 20;
5
6const tenantsBasic: GetTenants200Response = await getTenants(tenantId);
7const tenantsWithOptions: GetTenants200Response = await getTenants(tenantId, meta, skip);
8

updateTenant Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updateTenantBody UpdateTenantBody Yes

Response

Returns: FlagCommentPublic200Response

Example

updateTenant Example
Copy Copy
1
2const tenantId: string = "tenant_4821";
3const id: string = "flag_7b9e";
4const billingInfo: BillingInfo | undefined = undefined; // optional, omit to keep current billing
5const updateTenantBody: UpdateTenantBody = {
6 name: "Acme News Comments",
7 defaultDomain: "comments.acme.com",
8 ...(billingInfo ? { billingInfo } : {})
9};
10const result: FlagCommentPublic200Response = await updateTenant(tenantId, id, updateTenantBody);
11

changeTicketState Internal Link

Parameters

Name Type Required Description
tenantId string Yes
userId string Yes
id string Yes
changeTicketStateBody ChangeTicketStateBody Yes

Response

Returns: ChangeTicketState200Response

Example

changeTicketState Example
Copy Copy
1
2const tenantId: string = 'tenant_82f9b3';
3const userId: string = 'user_9472';
4const id: string = 'ticket_550e8400-e29b-41d4-a716-446655440000';
5const changeTicketStateBody: ChangeTicketStateBody = {
6 state: 'resolved',
7 comment: 'Confirmed fix deployed to production; closing ticket.',
8 notifySubscribers: true
9};
10const result: ChangeTicketState200Response = await changeTicketState(tenantId, userId, id, changeTicketStateBody);
11

createTicket Internal Link

Parameters

Name Type Required Description
tenantId string Yes
userId string Yes
createTicketBody CreateTicketBody Yes

Response

Returns: CreateTicket200Response

Example

createTicket Example
Copy Copy
1
2const tenantId: string = "acme-corp-001";
3const userId: string = "user_72b9f4";
4const createTicketBody: CreateTicketBody = {
5 subject: "Subscription renewal failed for card on file",
6 description: "Customer's card was declined by the payment processor during automatic renewal. Transaction ID: txn_9a8b7c. Please review gateway logs and retry.",
7 priority: "high", // optional field demonstrated
8 contactEmail: "billing@acme-corp.com", // optional contact info
9 relatedUrl: "https://acme-corp.com/account/billing"
10};
11const ticketResponse: CreateTicket200Response = await createTicket(tenantId, userId, createTicketBody);
12

getTicket Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
userId string No

Response

Returns: GetTicket200Response

Example

getTicket Example
Copy Copy
1
2const tenantId: string = 'acme-corp-tenant-01';
3const ticketId: string = 'tkt-20260325-42';
4const userId: string = 'user-8452';
5
6const ticketResponseWithUser: GetTicket200Response = await getTicket(tenantId, ticketId, userId);
7const ticketResponseWithoutUser: GetTicket200Response = await getTicket(tenantId, ticketId);
8

getTickets Internal Link

Parameters

Name Type Required Description
tenantId string Yes
userId string No
state number No
skip number No
limit number No

Response

Returns: GetTickets200Response

Example

getTickets Example
Copy Copy
1
2const tenantId: string = "tenant_92f3b4c1";
3const userId: string = "user_742a9f3e";
4const state: number = 1;
5const skip: number = 0;
6const limit: number = 25;
7const ticketsFull: GetTickets200Response = await getTickets(tenantId, userId, state, skip, limit);
8const ticketsMinimal: GetTickets200Response = await getTickets("tenant_92f3b4c1");
9

uploadImage Internal Link

Upload and resize an image

Parameters

Name Type Required Description
tenantId string Yes
file Blob Yes
sizePreset SizePreset No
urlId string No

Response

Returns: UploadImageResponse

Example

uploadImage Example
Copy Copy
1
2const tenantId: string = 'tenant-4f3b2c9'
3const file: Blob = new Blob([new Uint8Array([137,80,78,71,13,10,26,10])], { type: 'image/png' })
4const sizePreset: SizePreset = { name: 'medium', maxWidth: 1024, maxHeight: 768 }
5const urlId: string = 'article-2026-01-12'
6const result: UploadImageResponse = await uploadImage(tenantId, file, sizePreset, urlId)
7

getUserBadgeProgressById Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: GetUserBadgeProgressById200Response

Example

getUserBadgeProgressById Example
Copy Copy
1
2const optionalTenantSuffix: string | undefined = undefined;
3const tenantId: string = `5f8d0d55-1234-4ab1-9e2a-3f2b5c6d7e8f${optionalTenantSuffix ?? ''}`;
4const id: string = '3a2b1c4d-5678-4ef0-9abc-def123456789';
5const result: GetUserBadgeProgressById200Response = await getUserBadgeProgressById(tenantId, id);
6

getUserBadgeProgressByUserId Internal Link

Parameters

Name Type Required Description
tenantId string Yes
userId string Yes

Response

Returns: GetUserBadgeProgressById200Response

Example

getUserBadgeProgressByUserId Example
Copy Copy
1
2const tenantId: string = 'tenant_7f9c2d3b';
3const maybeUserId: string | undefined = 'user_4b8e1f9a'; // optional source (could be undefined)
4const userId: string = maybeUserId ?? 'user_fallback0001';
5const result: GetUserBadgeProgressById200Response = await getUserBadgeProgressByUserId(tenantId, userId);
6console.log(result);
7

getUserBadgeProgressList Internal Link

Parameters

Name Type Required Description
tenantId string Yes
userId string No
limit number No
skip number No

Response

Returns: GetUserBadgeProgressList200Response

Example

getUserBadgeProgressList Example
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_4f8c2b9d';
4 const userId: string = 'user_9a7e215c';
5 const limit: number = 25;
6 const skip: number = 0;
7 const resultMinimal: GetUserBadgeProgressList200Response = await getUserBadgeProgressList(tenantId);
8 const resultFull: GetUserBadgeProgressList200Response = await getUserBadgeProgressList(tenantId, userId, limit, skip);
9 console.log(resultMinimal, resultFull);
10})();
11

createUserBadge Internal Link

Parameters

Name Type Required Description
tenantId string Yes
createUserBadgeParams CreateUserBadgeParams Yes

Response

Returns: CreateUserBadge200Response

Example

createUserBadge Example
Copy Copy
1
2const tenantId: string = 'tenant_84f3b2';
3const createUserBadgeParams: CreateUserBadgeParams = {
4 name: 'Top Contributor',
5 slug: 'top-contributor',
6 imageUrl: 'https://assets.fastcomments.com/badges/top-contributor.png',
7 description: 'Awarded for 100 helpful comments',
8 active: true,
9 criteria: { commentsCount: 100 }, // optional criteria
10 displayOrder: 10,
11 metadata: { featured: true } // optional metadata
12};
13const result: CreateUserBadge200Response = await createUserBadge(tenantId, createUserBadgeParams);
14console.log(result);
15

deleteUserBadge Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: UpdateUserBadge200Response

Example

deleteUserBadge Example
Copy Copy
1
2type DeleteOptions = { notifyModerators?: boolean };
3
4const tenantId: string = 'tenant_8a3f21';
5const id: string = 'badge_71f2b';
6const options: DeleteOptions = { notifyModerators: true };
7
8const result: UpdateUserBadge200Response = await deleteUserBadge(tenantId, id);
9

getUserBadge Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: GetUserBadge200Response

Example

getUserBadge Example
Copy Copy
1
2const tenantId: string = "tenant_acme_01";
3const id: string = "badge_8c7d2f";
4const response: GetUserBadge200Response = await getUserBadge(tenantId, id);
5

getUserBadges Internal Link

Parameters

Name Type Required Description
tenantId string Yes
userId string No
badgeId string No
type number No
displayedOnComments boolean No
limit number No
skip number No

Response

Returns: GetUserBadges200Response

Example

getUserBadges Example
Copy Copy
1
2const tenantId: string = 'tenant_acme_01';
3const userId: string = 'user_5f4d3c2a';
4const badgeId: string = 'badge_top_contributor';
5const type: number = 1;
6const displayedOnComments: boolean = true;
7const limit: number = 50;
8const skip: number = 0;
9
10const result: GetUserBadges200Response = await getUserBadges(tenantId, userId, badgeId, type, displayedOnComments, limit, skip);
11

updateUserBadge Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
updateUserBadgeParams UpdateUserBadgeParams Yes

Response

Returns: UpdateUserBadge200Response

Example

updateUserBadge Example
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_acme_987';
4 const id: string = 'badge_top_contributor_42';
5 const updateUserBadgeParams: UpdateUserBadgeParams = {
6 title: 'Top Contributor',
7 description: 'Awarded for reaching 100 high-quality comments',
8 color: '#FFD700',
9 iconUrl: 'https://cdn.acme.com/badges/top-contributor.svg',
10 active: true,
11 notifyUsers: true
12 } as UpdateUserBadgeParams;
13 const result: UpdateUserBadge200Response = await updateUserBadge(tenantId, id, updateUserBadgeParams);
14 console.log(result);
15})();
16

getUserNotificationCount Internal Link

Parameters

Name Type Required Description
tenantId string Yes
sso string No

Response

Returns: GetUserNotificationCount200Response

Example

getUserNotificationCount Example
Copy Copy
1
2(async () => {
3 const tenantId: string = '9f1e2d3c-4b5a-6d7e-8f90-123456789abc';
4 const ssoToken: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0MjMifQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';
5 const resultWithSSO: GetUserNotificationCount200Response = await getUserNotificationCount(tenantId, ssoToken);
6 const resultWithoutSSO: GetUserNotificationCount200Response = await getUserNotificationCount(tenantId);
7 console.log(resultWithSSO, resultWithoutSSO);
8})();
9

getUserNotifications Internal Link

Parameters

Name Type Required Description
tenantId string Yes
pageSize number No
afterId string No
includeContext boolean No
afterCreatedAt number No
unreadOnly boolean No
dmOnly boolean No
noDm boolean No
includeTranslations boolean No
sso string No

Response

Returns: GetUserNotifications200Response

Example

getUserNotifications Example
Copy Copy
1
2const tenantId: string = 'tenant_7f3b1c';
3const pageSize: number = 25;
4const afterId: string = 'notif_b2f9e4';
5const includeContext: boolean = true;
6const afterCreatedAt: number = Date.now() - 24 * 60 * 60 * 1000;
7const unreadOnly: boolean = true;
8const dmOnly: boolean = false;
9const noDm: boolean = false;
10const includeTranslations: boolean = true;
11const sso: string = 'sso_tok_user_9f8d7c';
12const response: GetUserNotifications200Response = await getUserNotifications(
13 tenantId,
14 pageSize,
15 afterId,
16 includeContext,
17 afterCreatedAt,
18 unreadOnly,
19 dmOnly,
20 noDm,
21 includeTranslations,
22 sso
23);
24

resetUserNotificationCount Internal Link

Parameters

Name Type Required Description
tenantId string Yes
sso string No

Response

Returns: ResetUserNotifications200Response

Example

resetUserNotificationCount Example
Copy Copy
1
2(async () => {
3 const tenantId: string = "tenant_9f3b2c4a";
4 const ssoToken: string | undefined = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9._sample_payload_.signature";
5 const responseWithSSO: ResetUserNotifications200Response = await resetUserNotificationCount(tenantId, ssoToken);
6 const responseWithoutSSO: ResetUserNotifications200Response = await resetUserNotificationCount(tenantId);
7 console.log(responseWithSSO, responseWithoutSSO);
8})();
9

resetUserNotifications Internal Link

Parameters

Name Type Required Description
tenantId string Yes
afterId string No
afterCreatedAt number No
unreadOnly boolean No
dmOnly boolean No
noDm boolean No
sso string No

Response

Returns: ResetUserNotifications200Response

Example

resetUserNotifications Example
Copy Copy
1
2const tenantId: string = "tenant_prod_4a9f12";
3const afterId: string = "notification_87213";
4const afterCreatedAt: number = Math.floor(Date.now() / 1000) - 3600;
5const unreadOnly: boolean = true;
6const dmOnly: boolean = false;
7const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.payload";
8const result: ResetUserNotifications200Response = await resetUserNotifications(tenantId, afterId, afterCreatedAt, unreadOnly, dmOnly, undefined, sso);
9

updateUserNotificationCommentSubscriptionStatus Internal Link

Enable or disable notifications for a specific comment.

Parameters

Name Type Required Description
tenantId string Yes
notificationId string Yes
optedInOrOut UpdateUserNotificationCommentSubscriptionStatusOptedInOrOutEnum Yes
commentId string Yes
sso string No

Response

Returns: UpdateUserNotificationStatus200Response

Example

updateUserNotificationCommentSubscriptionStatus Example
Copy Copy
1
2const tenantId: string = 'acme-tenant-001';
3const notificationId: string = 'notif-2026-03-25-01';
4const commentId: string = 'cmt-8f3a2b';
5const optedInOrOut: UpdateUserNotificationCommentSubscriptionStatusOptedInOrOutEnum = UpdateUserNotificationCommentSubscriptionStatusOptedInOrOutEnum.OptIn;
6const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.sso-payload.signature';
7const result: UpdateUserNotificationStatus200Response = await updateUserNotificationCommentSubscriptionStatus(tenantId, notificationId, optedInOrOut, commentId, sso);
8

updateUserNotificationPageSubscriptionStatus Internal Link

Enable or disable notifications for a page. When users are subscribed to a page, notifications are created for new root comments, and also

Parameters

Name Type Required Description
tenantId string Yes
urlId string Yes
url string Yes
pageTitle string Yes
subscribedOrUnsubscribed UpdateUserNotificationPageSubscriptionStatusSubscribedOrUnsubscribedEnum Yes
sso string No

Response

Returns: UpdateUserNotificationStatus200Response

Example

updateUserNotificationPageSubscriptionStatus Example
Copy Copy
1
2const tenantId: string = 'acme-tenant-42';
3const urlId: string = 'blog-launch-2026';
4const url: string = 'https://acme.example.com/blog/launch-march-2026';
5const pageTitle: string = 'Acme Product Launch — March 2026';
6const subscribedOrUnsubscribed: UpdateUserNotificationPageSubscriptionStatusSubscribedOrUnsubscribedEnum = UpdateUserNotificationPageSubscriptionStatusSubscribedOrUnsubscribedEnum.Subscribed;
7const sso: string = 'sso_jwt_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9';
8const response: UpdateUserNotificationStatus200Response = await updateUserNotificationPageSubscriptionStatus(tenantId, urlId, url, pageTitle, subscribedOrUnsubscribed, sso);
9

updateUserNotificationStatus Internal Link

Parameters

Name Type Required Description
tenantId string Yes
notificationId string Yes
newStatus UpdateUserNotificationStatusNewStatusEnum Yes
sso string No

Response

Returns: UpdateUserNotificationStatus200Response

Example

updateUserNotificationStatus Example
Copy Copy
1
2const tenantId: string = 'tenant_84a2c3';
3const notificationId: string = 'notif_20260325_01';
4const newStatus: UpdateUserNotificationStatusNewStatusEnum = UpdateUserNotificationStatusNewStatusEnum.Read;
5const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.sso_signature_example';
6const result: UpdateUserNotificationStatus200Response = await updateUserNotificationStatus(tenantId, notificationId, newStatus, sso);
7

getUserPresenceStatuses Internal Link

Parameters

Name Type Required Description
tenantId string Yes
urlIdWS string Yes
userIds string Yes

Response

Returns: GetUserPresenceStatuses200Response

Example

getUserPresenceStatuses Example
Copy Copy
1
2const tenantId: string = 'tenant_7f3a2b';
3const urlIdWS: string = 'articles/2026/03/25/fastcomments-integration';
4const maybeUserIds: string | undefined = 'user_123,user_456'; // optional source
5const userIds: string = maybeUserIds ?? 'user_123';
6const presence: GetUserPresenceStatuses200Response = await getUserPresenceStatuses(tenantId, urlIdWS, userIds);
7

searchUsers Internal Link

Parameters

Name Type Required Description
tenantId string Yes
urlId string Yes
usernameStartsWith string No
mentionGroupIds Array No
sso string No
searchSection SearchUsersSearchSectionEnum No

Response

Returns: SearchUsers200Response

Example

searchUsers Example
Copy Copy
1
2const tenantId: string = 'tenant_8392';
3const urlId: string = 'articles/2026/03/25/fastcomments-release';
4const usernameStartsWith: string = 'jo';
5const mentionGroupIds: Array<string> = ['editors', 'senior-writers'];
6const sso: string = 'sso_jwt_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9';
7const searchSection: SearchUsersSearchSectionEnum = SearchUsersSearchSectionEnum.ALL;
8const result: SearchUsers200Response = await searchUsers(tenantId, urlId, usernameStartsWith, mentionGroupIds, sso, searchSection);
9

getUser Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes

Response

Returns: GetUser200Response

Example

getUser Example
Copy Copy
1
2const tenantId: string = 'tenant_7b3f42';
3const id: string = 'user_9c4d2a';
4const userResponse: GetUser200Response = await getUser(tenantId, id);
5console.log(userResponse);
6

createVote Internal Link

Parameters

Name Type Required Description
tenantId string Yes
commentId string Yes
direction CreateVoteDirectionEnum Yes
userId string No
anonUserId string No

Response

Returns: VoteComment200Response

Example

createVote Example
Copy Copy
1
2const tenantId: string = 'tenant_9f8b6a';
3const commentId: string = 'comment_3b7d2e';
4const direction: CreateVoteDirectionEnum = CreateVoteDirectionEnum.Up;
5const anonUserId: string = 'anon_4c2a1f';
6
7const voteResult: VoteComment200Response = await createVote(tenantId, commentId, direction, undefined, anonUserId);
8

deleteVote Internal Link

Parameters

Name Type Required Description
tenantId string Yes
id string Yes
editKey string No

Response

Returns: DeleteCommentVote200Response

Example

deleteVote Example
Copy Copy
1
2const tenantId: string = "tenant_7c3f2b4a";
3const voteId: string = "vote_4f8d9a11";
4const editKey: string = "edit_2b9f8c";
5const resultWithoutKey: DeleteCommentVote200Response = await deleteVote(tenantId, voteId);
6const resultWithKey: DeleteCommentVote200Response = await deleteVote(tenantId, voteId, editKey);
7

getVotes Internal Link

Parameters

Name Type Required Description
tenantId string Yes
urlId string Yes

Response

Returns: GetVotes200Response

Example

getVotes Example
Copy Copy
1
2const tenantId: string = 'acme-corp-8f3b';
3const refCampaign: string | undefined = 'newsletter-march2026'; // optional query parameter
4const urlId: string = `https://www.example.com/articles/2026/03/25/fastcomments-integration${refCampaign ? `?ref=${refCampaign}` : ''}`;
5
6const votes: GetVotes200Response = await getVotes(tenantId, urlId);
7

getVotesForUser Internal Link

Parameters

Name Type Required Description
tenantId string Yes
urlId string Yes
userId string No
anonUserId string No

Response

Returns: GetVotesForUser200Response

Example

getVotesForUser Example
Copy Copy
1
2(async (): Promise<void> => {
3 const tenantId: string = "local-news-ny";
4 const urlId: string = "articles/2026-03-25/ev-infrastructure-update";
5 const userId: string = "user_78b6f3d9";
6 const anonUserId: string = "anon_9c3f7a1b";
7 const result: GetVotesForUser200Response = await getVotesForUser(tenantId, urlId, userId, anonUserId);
8 console.log(result);
9})();
10

Need Help?

If you encounter any issues or have questions about the JavaScript/TypeScript SDK, please:

Contributing

Contributions are welcome! Please visit the GitHub repository for contribution guidelines.