FastComments.com

FastComments Rust SDK

This is the official Rust SDK for FastComments.

Official Rust SDK for the FastComments API

Repository

View on GitHub

Installation Internal Link

cargo add fastcomments-sdk

The SDK requires Rust 2021 edition or later.

Library Contents Internal Link

The FastComments Rust SDK consists of several modules:

  • Client Module - Auto-generated API client for FastComments REST APIs

    • Complete type definitions for all API models
    • Both authenticated (DefaultApi) and public (PublicApi) endpoints
    • Full async/await support with tokio
    • See client/README.md for detailed API documentation
  • SSO Module - Server-side Single Sign-On utilities

    • Secure token generation for user authentication
    • Support for both simple and secure SSO modes
    • HMAC-SHA256 based token signing
  • Core Types - Shared type definitions and utilities

    • Comment models and metadata structures
    • User and tenant configurations
    • Helper functions for common operations

Quick Start Internal Link

Using the Public API

use fastcomments_sdk::client::apis::configuration::Configuration;
use fastcomments_sdk::client::apis::public_api;

#[tokio::main]
async fn main() {
    // Create API configuration
    let config = Configuration::new();

    // Fetch comments for a page
    let result = public_api::get_comments_public(
        &config,
        public_api::GetCommentsPublicParams {
            tenant_id: "your-tenant-id".to_string(),
            urlid: Some("page-url-id".to_string()),
            url: None,
            count_only: None,
            skip: None,
            limit: None,
            sort_dir: None,
            page: None,
            sso_hash: None,
            simple_sso_hash: None,
            has_no_comment: None,
            has_comment: None,
            comment_id_filter: None,
            child_ids: None,
            start_date_time: None,
            starts_with: None,
        },
    )
    .await;

    match result {
        Ok(response) => {
            println!("Found {} comments", response.comments.len());
            for comment in response.comments {
                println!("Comment: {:?}", comment);
            }
        }
        Err(e) => eprintln!("Error fetching comments: {:?}", e),
    }
}

Using the Authenticated API

use fastcomments_sdk::client::apis::configuration::{ApiKey, Configuration};
use fastcomments_sdk::client::apis::default_api;

#[tokio::main]
async fn main() {
    // Create configuration with API key
    let mut config = Configuration::new();
    config.api_key = Some(ApiKey {
        prefix: None,
        key: "your-api-key".to_string(),
    });

    // Fetch comments using authenticated API
    let result = default_api::get_comments(
        &config,
        default_api::GetCommentsParams {
            tenant_id: "your-tenant-id".to_string(),
            skip: None,
            limit: None,
            sort_dir: None,
            urlid: Some("page-url-id".to_string()),
            url: None,
            is_spam: None,
            user_id: None,
            all_comments: None,
            for_moderation: None,
            parent_id: None,
            is_flagged: None,
            is_flagged_tag: None,
            is_by_verified: None,
            is_pinned: None,
            asc: None,
            include_imported: None,
            origin: None,
            tags: None,
        },
    )
    .await;

    match result {
        Ok(response) => {
            println!("Total comments: {}", response.count);
            for comment in response.comments {
                println!("Comment ID: {}, Text: {}", comment.id, comment.comment);
            }
        }
        Err(e) => eprintln!("Error: {:?}", e),
    }
}

Using SSO for Authentication

use fastcomments_sdk::sso::{
    fastcomments_sso::FastCommentsSSO,
    secure_sso_user_data::SecureSSOUserData,
};

fn main() {
    let api_key = "your-api-key".to_string();

    // Create secure SSO user data (server-side only!)
    let user_data = SecureSSOUserData::new(
        "user-123".to_string(),           // User ID
        "user@example.com".to_string(),   // Email
        "John Doe".to_string(),            // Username
        "https://example.com/avatar.jpg".to_string(), // Avatar URL
    );

    // Generate SSO token
    let sso = FastCommentsSSO::new_secure(api_key, &user_data).unwrap();
    let token = sso.create_token().unwrap();

    println!("SSO Token: {}", token);
    // Pass this token to your frontend for authentication
}

Common Issues Internal Link

401 Unauthorized Errors

If you're getting 401 errors when using the authenticated API:

  1. Check your API key: Ensure you're using the correct API key from your FastComments dashboard
  2. Verify the tenant ID: Make sure the tenant ID matches your account
  3. API key format: The API key should be passed in the Configuration:
let mut config = Configuration::new();
config.api_key = Some(ApiKey {
    prefix: None,
    key: "YOUR_API_KEY".to_string(),
});

SSO Token Issues

If SSO tokens aren't working:

  1. Use secure mode for production: Always use FastCommentsSSO::new_secure() with your API key for production
  2. Server-side only: Generate SSO tokens on your server, never expose your API key to clients
  3. Check user data: Ensure all required fields (id, email, username) are provided

Async Runtime Errors

The SDK uses tokio for async operations. Make sure to:

  1. Add tokio to your dependencies:

    [dependencies]
    tokio = { version = "1", features = ["full"] }
  2. Use the tokio runtime:

    #[tokio::main]
    async fn main() {
     // Your async code here
    }

Notes Internal Link

Broadcast IDs

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.

Support Internal Link

For issues, questions, or feature requests:

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
tenant_id String Yes
aggregation_request models::AggregationRequest Yes
parent_tenant_id String No
include_stats bool No

Response

Returns: AggregationResponse

Example

aggregate Example
Copy Copy
1
2async fn run_aggregate() -> Result<(), Error> {
3 let params: AggregateParams = AggregateParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 aggregation_request: models::AggregationRequest {
6 predicates: vec![
7 models::QueryPredicate {
8 field: "path".to_string(),
9 operator: "EQUALS".to_string(),
10 value: models::QueryPredicateValue::String("news/article".to_string()),
11 }
12 ],
13 operations: vec![
14 models::AggregationOperation {
15 op: models::AggregationOpType::COUNT,
16 field: Some("thread_id".to_string()),
17 }
18 ],
19 sort: Some(vec![ models::AggregationRequestSort { field: "count".to_string(), descending: true } ]),
20 limit: Some(50),
21 },
22 parent_tenant_id: Some("acme-parent".to_string()),
23 include_stats: Some(true),
24 };
25 let response: AggregationResponse = aggregate(&configuration, params).await?;
26 let _ = response;
27 Ok(())
28}
29

get_audit_logs Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
limit f64 No
skip f64 No
order models::SortDir No
after f64 No
before f64 No

Response

Returns: GetAuditLogs200Response

Example

get_audit_logs Example
Copy Copy
1
2async fn fetch_audit_logs() -> Result<GetAuditLogs200Response, Error> {
3 let cfg: &configuration::Configuration = &configuration;
4 let params: GetAuditLogsParams = GetAuditLogsParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 limit: Some(100.0),
7 skip: Some(0.0),
8 order: Some(models::SortDir::Desc),
9 after: Some(1690000000.0),
10 before: Some(1699999999.0),
11 };
12 let resp = get_audit_logs(cfg, params).await?;
13 Ok(resp)
14}
15

block_from_comment_public Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_id String Yes
public_block_from_comment_params models::PublicBlockFromCommentParams Yes
sso String No

Response

Returns: BlockFromCommentPublic200Response

Example

block_from_comment_public Example
Copy Copy
1
2let params: BlockFromCommentPublicParams = BlockFromCommentPublicParams {
3 tenant_id: String::from("acme-corp-tenant"),
4 comment_id: String::from("news/article/12345"),
5 public_block_from_comment_params: models::PublicBlockFromCommentParams {
6 moderator_id: String::from("mod-9876"),
7 reason: String::from("Repeated spam links promoting phishing site"),
8 block_duration_minutes: Some(60),
9 notify_user: Some(true),
10 },
11 sso: Some(String::from("sso-token-opaque-abc123")),
12};
13let response: BlockFromCommentPublic200Response = block_from_comment_public(&configuration, params).await?;
14

un_block_comment_public Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_id String Yes
public_block_from_comment_params models::PublicBlockFromCommentParams Yes
sso String No

Response

Returns: UnBlockCommentPublic200Response

Example

un_block_comment_public Example
Copy Copy
1
2let params: UnBlockCommentPublicParams = UnBlockCommentPublicParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 comment_id: "news/politics/2025-11-04-6789".to_string(),
5 public_block_from_comment_params: models::PublicBlockFromCommentParams {
6 moderator_id: "mod-cherie-01".to_string(),
7 reason: "reinstating after manual review - not abusive".to_string(),
8 },
9 sso: Some("sso-token-0a1b2c3d".to_string()),
10};
11
12let response: UnBlockCommentPublic200Response = un_block_comment_public(&configuration, params).await?;
13

checked_comments_for_blocked Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_ids String Yes
sso String No

Response

Returns: CheckedCommentsForBlocked200Response

Example

checked_comments_for_blocked Example
Copy Copy
1
2async fn example_checked_comments() -> Result<(), Error> {
3 let params: CheckedCommentsForBlockedParams = CheckedCommentsForBlockedParams {
4 tenant_id: "acme-news-tenant".to_string(),
5 comment_ids: "cmt-2025-001,cmt-2025-002".to_string(),
6 sso: Some("sso-session-7f3a".to_string()),
7 };
8 let response: CheckedCommentsForBlocked200Response = checked_comments_for_blocked(&configuration, params).await?;
9 Ok(())
10}
11

block_user_from_comment Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes
block_from_comment_params models::BlockFromCommentParams Yes
user_id String No
anon_user_id String No

Response

Returns: BlockFromCommentPublic200Response

Example

block_user_from_comment Example
Copy Copy
1
2let params: BlockUserFromCommentParams = BlockUserFromCommentParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 id: "comments/news/article/abc123".to_string(),
5 block_from_comment_params: models::BlockFromCommentParams {
6 reason: Some("repeated spam and harassment".to_string()),
7 duration_minutes: Some(24 * 60),
8 notify_user: Some(true),
9 ..Default::default()
10 },
11 user_id: Some("user-1024".to_string()),
12 anon_user_id: None,
13};
14
15let response: BlockFromCommentPublic200Response = block_user_from_comment(&configuration, params).await?;
16

create_comment_public Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
url_id String Yes
broadcast_id String Yes
comment_data models::CommentData Yes
session_id String No
sso String No

Response

Returns: CreateCommentPublic200Response

Example

create_comment_public Example
Copy Copy
1
2pub async fn example_create_comment_public() -> Result<CreateCommentPublic200Response, Error> {
3 let params = CreateCommentPublicParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 url_id: String::from("news/article/2025/nov/04/breaking-analysis"),
6 broadcast_id: String::from("site-default"),
7 comment_data: models::CommentData {
8 content: String::from("Great analysis — thank you for the deep dive!"),
9 author_name: Some(String::from("Jane Doe")),
10 author_email: Some(String::from("jane.doe@acme.com")),
11 ..Default::default()
12 },
13 session_id: Some(String::from("sess_9f8b7c6a")),
14 sso: Some(String::from("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...")),
15 };
16 let response = create_comment_public(&configuration, params).await?;
17 Ok(response)
18}
19

delete_comment Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes
context_user_id String No
is_live bool No

Response

Returns: DeleteComment200Response

Example

delete_comment Example
Copy Copy
1
2async fn run_delete_comment() -> Result<DeleteComment200Response, Error> {
3 let params: DeleteCommentParams = DeleteCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article/2025/11/04/comment-789".to_string(),
6 context_user_id: Some("user-42".to_string()),
7 is_live: Some(true),
8 };
9 let response: DeleteComment200Response = delete_comment(&configuration, params).await?;
10 Ok(response)
11}
12

delete_comment_public Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_id String Yes
broadcast_id String Yes
edit_key String No
sso String No

Response

Returns: DeleteCommentPublic200Response

Example

delete_comment_public Example
Copy Copy
1
2async fn run_delete_comment() -> Result<(), Error> {
3 let params: DeleteCommentPublicParams = DeleteCommentPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "news/article-98765/comment-123".to_string(),
6 broadcast_id: "news/article-98765".to_string(),
7 edit_key: Some("edit-9f8e7d6c".to_string()),
8 sso: Some("sso.jwt.token.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9".to_string()),
9 };
10 let response: DeleteCommentPublic200Response = delete_comment_public(&configuration, params).await?;
11 Ok(())
12}
13

delete_comment_vote Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_id String Yes
vote_id String Yes
url_id String Yes
broadcast_id String Yes
edit_key String No
sso String No

Response

Returns: DeleteCommentVote200Response

Example

delete_comment_vote Example
Copy Copy
1
2async fn example_delete_vote(configuration: &configuration::Configuration) -> Result<DeleteCommentVote200Response, Error> {
3 let params: DeleteCommentVoteParams = DeleteCommentVoteParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 comment_id: String::from("comment-98765"),
6 vote_id: String::from("vote-12345"),
7 url_id: String::from("news/article-2025-11-04"),
8 broadcast_id: String::from("broadcast-001"),
9 edit_key: Some(String::from("editkey-abc123")),
10 sso: Some(String::from("sso-token-xyz")),
11 };
12 let response: DeleteCommentVote200Response = delete_comment_vote(configuration, params).await?;
13 Ok(response)
14}
15

flag_comment Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes
user_id String No
anon_user_id String No

Response

Returns: FlagComment200Response

Example

flag_comment Example
Copy Copy
1
2async fn example_flag_comment() -> Result<FlagComment200Response, Error> {
3 let params: FlagCommentParams = FlagCommentParams {
4 tenant_id: "acme-news-tenant".to_string(),
5 id: "article/2025/11/04/comment-98765".to_string(),
6 user_id: Some("reader_204".to_string()),
7 anon_user_id: None,
8 };
9 let response: FlagComment200Response = flag_comment(&configuration, params).await?;
10 Ok(response)
11}
12

get_comment Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes

Response

Returns: GetComment200Response

Example

get_comment Example
Copy Copy
1
2let params: GetCommentParams = GetCommentParams {
3 tenant_id: "acme-news-tenant".to_string(),
4 id: "news/article/2025/11/04/interesting-story/comment-842".to_string(),
5 include_replies: Some(true),
6};
7let comment: GetComment200Response = get_comment(&configuration, params).await?;
8dbg!(comment);
9

get_comment_text Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_id String Yes
edit_key String No
sso String No

Response

Returns: GetCommentText200Response

Example

get_comment_text Example
Copy Copy
1
2async fn run() -> Result<GetCommentText200Response, Error> {
3 let params: GetCommentTextParams = GetCommentTextParams {
4 tenant_id: "acme-corp-tenant".to_owned(),
5 comment_id: "cmt-7f3a9b2d".to_owned(),
6 edit_key: Some("edit-abc123".to_owned()),
7 sso: Some("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9".to_owned()),
8 };
9 let response: GetCommentText200Response = get_comment_text(&configuration, params).await?;
10 Ok(response)
11}
12

get_comment_vote_user_names Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_id String Yes
dir i32 Yes
sso String No

Response

Returns: GetCommentVoteUserNames200Response

Example

get_comment_vote_user_names Example
Copy Copy
1
2async fn fetch_vote_user_names() -> Result<(), Error> {
3 let params: GetCommentVoteUserNamesParams = GetCommentVoteUserNamesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "news/article-9876".to_string(),
6 dir: 1,
7 sso: Some("user-42-sso-token.eyJhbGci".to_string()),
8 };
9 let response: GetCommentVoteUserNames200Response =
10 get_comment_vote_user_names(&configuration, params).await?;
11 Ok(())
12}
13

get_comments Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
page i32 No
limit i32 No
skip i32 No
as_tree bool No
skip_children i32 No
limit_children i32 No
max_tree_depth i32 No
url_id String No
user_id String No
anon_user_id String No
context_user_id String No
hash_tag String No
parent_id String No
direction models::SortDirections No

Response

Returns: GetComments200Response

Example

get_comments Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: GetCommentsParams = GetCommentsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 page: Some(1),
6 limit: Some(50),
7 skip: Some(0),
8 as_tree: Some(true),
9 skip_children: Some(0),
10 limit_children: Some(5),
11 max_tree_depth: Some(3),
12 url_id: Some("news/politics/2025-election".to_string()),
13 user_id: Some("user_12345".to_string()),
14 anon_user_id: Some("anon_98765".to_string()),
15 context_user_id: Some("editor_7".to_string()),
16 hash_tag: Some("breaking-news".to_string()),
17 parent_id: Some("comment_4f2d".to_string()),
18 direction: Some(models::SortDirections::Desc),
19 };
20 let response: GetComments200Response = get_comments(configuration, params).await?;
21 Ok(())
22}
23

get_comments_public Internal Link

req tenantId urlId

Parameters

Name Type Required Description
tenant_id String Yes
url_id String Yes
page i32 No
direction models::SortDirections No
sso String No
skip i32 No
skip_children i32 No
limit i32 No
limit_children i32 No
count_children bool No
fetch_page_for_comment_id String No
include_config bool No
count_all bool No
includei10n bool No
locale String No
modules String No
is_crawler bool No
include_notification_count bool No
as_tree bool No
max_tree_depth i32 No
use_full_translation_ids bool No
parent_id String No
search_text String No
hash_tags Vec No
user_id String No
custom_config_str String No
after_comment_id String No
before_comment_id String No

Response

Returns: GetCommentsPublic200Response

Example

get_comments_public Example
Copy Copy
1
2let params: GetCommentsPublicParams = GetCommentsPublicParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 url_id: "news/article/2025/11/04/rust-async".to_string(),
5 page: Some(1), direction: None, sso: None, skip: Some(0),
6 skip_children: Some(0), limit: Some(25), limit_children: Some(5),
7 count_children: Some(true), fetch_page_for_comment_id: None,
8 include_config: Some(true), count_all: Some(false), includei10n: Some(true),
9 locale: Some("en-US".to_string()), modules: Some("reactions,moderation".to_string()),
10 is_crawler: Some(false), include_notification_count: Some(true), as_tree: Some(true),
11 max_tree_depth: Some(3), use_full_translation_ids: Some(false), parent_id: None,
12 search_text: Some("climate policy".to_string()), hash_tags: Some(vec!["breaking".to_string(), "world".to_string()]),
13 user_id: Some("user_9876".to_string()), custom_config_str: None,
14 after_comment_id: Some("cmt_12345".to_string()), before_comment_id: None,
15};
16
17let response: GetCommentsPublic200Response = get_comments_public(&configuration, params).await?;
18

lock_comment Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_id String Yes
broadcast_id String Yes
sso String No

Response

Returns: LockComment200Response

Example

lock_comment Example
Copy Copy
1
2async fn run_lock_comment() -> Result<LockComment200Response, Error> {
3 let params: LockCommentParams = LockCommentParams {
4 tenant_id: "acme-news-tenant".to_string(),
5 comment_id: "cmt-2025-11-04-42".to_string(),
6 broadcast_id: "live-sports-nyc-2025-11-04".to_string(),
7 sso: Some("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.fakepayload.signature".to_string()),
8 };
9 let response: LockComment200Response = lock_comment(&configuration, params).await?;
10 Ok(response)
11}
12

pin_comment Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_id String Yes
broadcast_id String Yes
sso String No

Response

Returns: PinComment200Response

Example

pin_comment Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: PinCommentParams = PinCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "cmt-9f8d7a6b".to_string(),
6 broadcast_id: "news/article/2025/11/04".to_string(),
7 sso: Some("user-42|sig=abc123".to_string()),
8 };
9 let response: PinComment200Response = pin_comment(&configuration, params).await?;
10 Ok(())
11}
12

save_comment Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
create_comment_params models::CreateCommentParams Yes
is_live bool No
do_spam_check bool No
send_emails bool No
populate_notifications bool No

Response

Returns: SaveComment200Response

Example

save_comment Example
Copy Copy
1
2async fn example_save_comment() -> Result<(), Error> {
3 let create: models::CreateCommentParams = models::CreateCommentParams {
4 content: "I enjoyed this deep dive into Rust async.".to_string(),
5 thread_id: "news/tech/rust-async-2025".to_string(),
6 author_name: "Alex Rivera".to_string(),
7 author_email: "alex.rivera@acme.com".to_string(),
8 parent_id: None,
9 };
10
11 let params: SaveCommentParams = SaveCommentParams {
12 tenant_id: "acme-corp-tenant".to_string(),
13 create_comment_params: create,
14 is_live: Some(true),
15 do_spam_check: Some(true),
16 send_emails: Some(false),
17 populate_notifications: Some(true),
18 };
19
20 let response: SaveComment200Response = save_comment(&configuration, params).await?;
21 Ok(())
22}
23

save_comments_bulk Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
create_comment_params Vecmodels::CreateCommentParams Yes
is_live bool No
do_spam_check bool No
send_emails bool No
populate_notifications bool No

Response

Returns: Vec<models::SaveComment200Response>

Example

save_comments_bulk Example
Copy Copy
1
2async fn save_comments_example() -> Result<Vec<models::SaveComment200Response>, Error> {
3 let comments: Vec<models::CreateCommentParams> = vec![
4 models::CreateCommentParams { thread_id: "news/article/2025/10/04".to_string(), content: "Great reporting — learned a lot.".to_string(), author_name: "Jane Doe".to_string(), author_email: "jane.doe@example.com".to_string() },
5 models::CreateCommentParams { thread_id: "news/article/2025/10/04".to_string(), parent_id: Some("cmt-12345".to_string()), content: "Replying to Jane — agree with this point.".to_string(), author_name: "John Smith".to_string(), author_email: "john.smith@acme.com".to_string() },
6 ];
7 let params: SaveCommentsBulkParams = SaveCommentsBulkParams {
8 tenant_id: "acme-corp-tenant".to_string(),
9 create_comment_params: comments,
10 is_live: Some(true),
11 do_spam_check: Some(true),
12 send_emails: Some(false),
13 populate_notifications: Some(true),
14 };
15 let saved: Vec<models::SaveComment200Response> = save_comments_bulk(&configuration, params).await?;
16 Ok(saved)
17}
18

set_comment_text Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_id String Yes
broadcast_id String Yes
comment_text_update_request models::CommentTextUpdateRequest Yes
edit_key String No
sso String No

Response

Returns: SetCommentText200Response

Example

set_comment_text Example
Copy Copy
1
2async fn update_comment_example(configuration: &configuration::Configuration) -> Result<SetCommentText200Response, Error> {
3 let params: SetCommentTextParams = SetCommentTextParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "news/article/2025/11/04/12345".to_string(),
6 broadcast_id: "web-frontend".to_string(),
7 comment_text_update_request: models::CommentTextUpdateRequest {
8 text: "Updated comment text with corrected facts and a mention @jane".to_string(),
9 mentions: vec![models::CommentUserMentionInfo { user_id: "user-432".to_string(), display_name: "jane.doe".to_string() }],
10 hashtags: vec![models::CommentUserHashTagInfo { tag: "breaking".to_string() }],
11 },
12 edit_key: Some("edit-key-abc123".to_string()),
13 sso: Some("sso-token-xyz".to_string()),
14 };
15 let response: SetCommentText200Response = set_comment_text(configuration, params).await?;
16 Ok(response)
17}
18

un_block_user_from_comment Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes
un_block_from_comment_params models::UnBlockFromCommentParams Yes
user_id String No
anon_user_id String No

Response

Returns: UnBlockCommentPublic200Response

Example

un_block_user_from_comment Example
Copy Copy
1
2async fn run_unblock() -> Result<(), Error> {
3 let params: UnBlockUserFromCommentParams = UnBlockUserFromCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article/comments/721".to_string(),
6 un_block_from_comment_params: models::UnBlockFromCommentParams {
7 reason: Some("User appeal accepted".to_string()),
8 },
9 user_id: Some("user-842".to_string()),
10 anon_user_id: None,
11 };
12 let response: UnBlockCommentPublic200Response =
13 un_block_user_from_comment(&configuration, params).await?;
14 Ok(())
15}
16

un_flag_comment Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes
user_id String No
anon_user_id String No

Response

Returns: FlagComment200Response

Example

un_flag_comment Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: UnFlagCommentParams = UnFlagCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "comments/2025-11-04-98765".to_string(),
6 user_id: Some("user-42".to_string()),
7 anon_user_id: None,
8 };
9 let response: FlagComment200Response = un_flag_comment(&configuration, params).await?;
10 Ok(())
11}
12

un_lock_comment Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_id String Yes
broadcast_id String Yes
sso String No

Response

Returns: LockComment200Response

Example

un_lock_comment Example
Copy Copy
1
2let params: UnLockCommentParams = UnLockCommentParams {
3 tenant_id: String::from("acme-corp-tenant"),
4 comment_id: String::from("cmt-9f8a7b6"),
5 broadcast_id: String::from("breaking/news/2025/11/04"),
6 sso: Some(String::from("sso-secure-8a7b6c")),
7};
8
9let response: LockComment200Response = un_lock_comment(&configuration, params).await?;
10

un_pin_comment Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_id String Yes
broadcast_id String Yes
sso String No

Response

Returns: PinComment200Response

Example

un_pin_comment Example
Copy Copy
1
2async fn example() -> Result<PinComment200Response, Error> {
3 let params: UnPinCommentParams = UnPinCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "comment-9f8e7d6c".to_string(),
6 broadcast_id: "news/world/2025/nov/04/article-123".to_string(),
7 sso: Some("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.signature".to_string()),
8 };
9 let response: PinComment200Response = un_pin_comment(&configuration, params).await?;
10 Ok(response)
11}
12

update_comment Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes
body models::PickApiCommentPeriodUpdatableCommentFields Yes
context_user_id String No
do_spam_check bool No
is_live bool No

Response

Returns: FlagCommentPublic200Response

Example

update_comment Example
Copy Copy
1
2async fn run(configuration: &configuration::Configuration) -> Result<FlagCommentPublic200Response, Error> {
3 let params: UpdateCommentParams = UpdateCommentParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 id: String::from("news/article/comment-9876"),
6 body: models::PickApiCommentPeriodUpdatableCommentFields {
7 content: String::from("Updated: Thanks for the feedback — we've corrected the data in the article."),
8 },
9 context_user_id: Some(String::from("moderator-anna")),
10 do_spam_check: Some(true),
11 is_live: Some(true),
12 };
13 let response: FlagCommentPublic200Response = update_comment(configuration, params).await?;
14 Ok(response)
15}
16

vote_comment Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_id String Yes
url_id String Yes
broadcast_id String Yes
vote_body_params models::VoteBodyParams Yes
session_id String No
sso String No

Response

Returns: VoteComment200Response

Example

vote_comment Example
Copy Copy
1
2let params: VoteCommentParams = VoteCommentParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 comment_id: "c12345".to_string(),
5 url_id: "news/article/2025-election".to_string(),
6 broadcast_id: "broadcast-987".to_string(),
7 vote_body_params: models::VoteBodyParams { vote: 1 },
8 session_id: Some("sess_abc123".to_string()),
9 sso: Some("sso-token-xyz".to_string()),
10};
11let response: VoteComment200Response = vote_comment(&configuration, params).await?;
12

add_domain_config Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
add_domain_config_params models::AddDomainConfigParams Yes

Response

Returns: AddDomainConfig200Response

Example

add_domain_config Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: AddDomainConfigParams = AddDomainConfigParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 add_domain_config_params: models::AddDomainConfigParams {
6 domain: "news.acme.com".to_string(),
7 allowed_paths: Some(vec!["/articles".to_string(), "/blog".to_string()]),
8 enable_subdomains: Some(true),
9 site_name: Some("Acme News".to_string()),
10 },
11 };
12 let response: AddDomainConfig200Response = add_domain_config(&configuration, params).await?;
13 Ok(())
14}
15

delete_domain_config Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
domain String Yes

Response

Returns: DeleteDomainConfig200Response

Example

delete_domain_config Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = DeleteDomainConfigParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 domain: String::from("news.example.com"),
6 purge_comments: Some(true),
7 };
8
9 let response: DeleteDomainConfig200Response = delete_domain_config(&configuration, params).await?;
10 println!("{:?}", response);
11 Ok(())
12}
13

get_domain_config Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
domain String Yes

Response

Returns: GetDomainConfig200Response

Example

get_domain_config Example
Copy Copy
1
2async fn example_get_domain_config() -> Result<(), Error> {
3 let params: GetDomainConfigParams = GetDomainConfigParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 domain: "news/article".to_string(),
6 include_subdomains: Some(true),
7 };
8 let domain_config: GetDomainConfig200Response = get_domain_config(&configuration, params).await?;
9 Ok(())
10}
11

get_domain_configs Internal Link

Parameters

Name Type Required Description
tenant_id String Yes

Response

Returns: GetDomainConfigs200Response

Example

get_domain_configs Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: GetDomainConfigsParams = GetDomainConfigsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 domain: Some("news.acme.com".to_string()),
6 environment: Some("production".to_string()),
7 include_inactive: Some(false),
8 };
9 let configs: GetDomainConfigs200Response = get_domain_configs(&configuration, params).await?;
10 let _ = configs;
11 Ok(())
12}
13

patch_domain_config Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
domain_to_update String Yes
patch_domain_config_params models::PatchDomainConfigParams Yes

Response

Returns: GetDomainConfig200Response

Example

patch_domain_config Example
Copy Copy
1
2let params: PatchDomainConfigParams = PatchDomainConfigParams {
3 tenant_id: "acme-corp-tenant".into(),
4 domain_to_update: "news/article".into(),
5 patch_domain_config_params: models::PatchDomainConfigParams {
6 enable_comments: Some(true),
7 moderation: Some("pre-moderation".into()),
8 allowed_origins: Some(vec![
9 "https://news.acme.com".into(),
10 "https://blog.acme.com".into()
11 ]),
12 max_comment_length: Some(2000),
13 },
14};
15
16let updated: GetDomainConfig200Response = patch_domain_config(&configuration, params).await?;
17

put_domain_config Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
domain_to_update String Yes
update_domain_config_params models::UpdateDomainConfigParams Yes

Response

Returns: GetDomainConfig200Response

Example

put_domain_config Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: PutDomainConfigParams = PutDomainConfigParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 domain_to_update: "news/article".to_string(),
6 update_domain_config_params: models::UpdateDomainConfigParams {
7 allow_subdomains: Some(true),
8 moderation_mode: Some("pre_moderation".to_string()),
9 allowed_origins: Some(vec![
10 "https://www.acme.com".to_string(),
11 "https://blog.acme.com".to_string(),
12 ]),
13 redirect_url: Some("https://www.acme.com/comments".to_string()),
14 },
15 };
16
17 let updated: GetDomainConfig200Response = put_domain_config(&configuration, params).await?;
18 Ok(())
19}
20

get_event_log Internal Link

req tenantId urlId userIdWS

Parameters

Name Type Required Description
tenant_id String Yes
url_id String Yes
user_id_ws String Yes
start_time i64 Yes
end_time i64 Yes

Response

Returns: GetEventLog200Response

Example

get_event_log Example
Copy Copy
1
2async fn example_get_event_log() -> Result<GetEventLog200Response, Error> {
3 let params: GetEventLogParams = GetEventLogParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article/2025/11/election-results".to_string(),
6 user_id_ws: "user-7b9f2c".to_string(),
7 start_time: 1_700_000_000i64,
8 end_time: 1_700_086_400i64,
9 cursor: Some("evt_cursor_2025_11_04".to_string()),
10 };
11 let response: GetEventLog200Response = get_event_log(&configuration, params).await?;
12 Ok(response)
13}
14

get_global_event_log Internal Link

req tenantId urlId userIdWS

Parameters

Name Type Required Description
tenant_id String Yes
url_id String Yes
user_id_ws String Yes
start_time i64 Yes
end_time i64 Yes

Response

Returns: GetEventLog200Response

Example

get_global_event_log Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: GetGlobalEventLogParams = GetGlobalEventLogParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/economy/q1-report".to_string(),
6 user_id_ws: "user-789-ws".to_string(),
7 start_time: 1704067200i64,
8 end_time: 1704153600i64,
9 limit: Some(100),
10 cursor: Some("cursor_0001".to_string()),
11 };
12 let response: GetEventLog200Response = get_global_event_log(&configuration, params).await?;
13 Ok(())
14}
15

create_feed_post Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
create_feed_post_params models::CreateFeedPostParams Yes
broadcast_id String No
is_live bool No
do_spam_check bool No
skip_dup_check bool No

Response

Returns: CreateFeedPost200Response

Example

create_feed_post Example
Copy Copy
1
2async fn example_create_feed_post() -> Result<(), Error> {
3 let params: CreateFeedPostParams = CreateFeedPostParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 create_feed_post_params: models::CreateFeedPostParams {
6 title: "Quarterly Update: Platform Improvements".to_string(),
7 body: "We've rolled out performance and reliability improvements across the platform.".to_string(),
8 author_id: Some("editor-joe".to_string()),
9 tags: Some(vec!["announcement".to_string(), "product".to_string()]),
10 links: Some(vec![models::FeedPostLink {
11 url: "https://acme.com/blog/q4-update".to_string(),
12 title: Some("Full Q4 Update".to_string())
13 }]),
14 media: Some(vec![models::FeedPostMediaItem {
15 url: "https://cdn.acme.com/images/q4-hero.jpg".to_string(),
16 mime_type: Some("image/jpeg".to_string()),
17 assets: Some(vec![models::FeedPostMediaItemAsset {
18 url: "https://cdn.acme.com/images/q4-hero-1200.jpg".to_string(),
19 width: Some(1200),
20 height: Some(800)
21 }])
22 }]),
23 },
24 broadcast_id: Some("news-feed-broadcast-2025".to_string()),
25 is_live: Some(true),
26 do_spam_check: Some(true),
27 skip_dup_check: Some(false),
28 };
29 let response: CreateFeedPost200Response = create_feed_post(&configuration, params).await?;
30 let _ = response;
31 Ok(())
32}
33

create_feed_post_public Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
create_feed_post_params models::CreateFeedPostParams Yes
broadcast_id String No
sso String No

Response

Returns: CreateFeedPostPublic200Response

Example

create_feed_post_public Example
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params: CreateFeedPostPublicParams = CreateFeedPostPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 create_feed_post_params: models::CreateFeedPostParams {
6 title: "Daily News Roundup".to_string(),
7 content: "Top stories from around the world, curated by our editorial team.".to_string(),
8 author_id: Some("editor-42".to_string()),
9 tags: Some(vec!["news".to_string(), "daily".to_string()]),
10 media: Some(vec![models::FeedPostMediaItem {
11 url: "https://cdn.acme.com/images/top_story.jpg".to_string(),
12 caption: Some("Front page image".to_string()),
13 assets: Some(vec![models::FeedPostMediaItemAsset {
14 url: "https://cdn.acme.com/images/top_story_small.jpg".to_string(),
15 mime_type: Some("image/jpeg".to_string()),
16 }]),
17 }]),
18 links: Some(vec![models::FeedPostLink {
19 url: "https://acme.example.com/articles/567".to_string(),
20 title: Some("Read full story".to_string()),
21 }]),
22 is_published: Some(true),
23 },
24 broadcast_id: Some("broadcast-2025-11".to_string()),
25 sso: Some("sso-token-abc123".to_string()),
26 };
27 let response: CreateFeedPostPublic200Response = create_feed_post_public(&configuration, params).await?;
28 Ok(())
29}
30

delete_feed_post_public Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
post_id String Yes
broadcast_id String No
sso String No

Response

Returns: DeleteFeedPostPublic200Response

Example

delete_feed_post_public Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: DeleteFeedPostPublicParams = DeleteFeedPostPublicParams {
4 tenant_id: "acme-corp-tenant".to_owned(),
5 post_id: "news/article-2025-11-04".to_owned(),
6 broadcast_id: Some("global-feed".to_owned()),
7 sso: Some("sso-token-abc123".to_owned()),
8 };
9 let response: DeleteFeedPostPublic200Response = delete_feed_post_public(&configuration, params).await?;
10 Ok(())
11}
12

get_feed_posts Internal Link

req tenantId afterId

Parameters

Name Type Required Description
tenant_id String Yes
after_id String No
limit i32 No
tags Vec No

Response

Returns: GetFeedPosts200Response

Example

get_feed_posts Example
Copy Copy
1
2let params: GetFeedPostsParams = GetFeedPostsParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 after_id: Some("post_987654321".to_string()),
5 limit: Some(20),
6 tags: Some(vec!["news/article".to_string(), "tech".to_string()]),
7};
8let response: GetFeedPosts200Response = get_feed_posts(&configuration, params).await?;
9

get_feed_posts_public Internal Link

req tenantId afterId

Parameters

Name Type Required Description
tenant_id String Yes
after_id String No
limit i32 No
tags Vec No
sso String No
is_crawler bool No
include_user_info bool No

Response

Returns: GetFeedPostsPublic200Response

Example

get_feed_posts_public Example
Copy Copy
1
2async fn fetch_feed() -> Result<(), Error> {
3 let params: GetFeedPostsPublicParams = GetFeedPostsPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 after_id: Some("post_12345".to_string()),
6 limit: Some(20),
7 tags: Some(vec!["news".to_string(), "technology".to_string()]),
8 sso: Some("editor-990".to_string()),
9 is_crawler: Some(false),
10 include_user_info: Some(true),
11 };
12 let response: GetFeedPostsPublic200Response = get_feed_posts_public(&configuration, params).await?;
13 Ok(())
14}
15

get_feed_posts_stats Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
post_ids Vec Yes
sso String No

Response

Returns: GetFeedPostsStats200Response

Example

get_feed_posts_stats Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: GetFeedPostsStatsParams = GetFeedPostsStatsParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 post_ids: vec![
6 String::from("news/article-2025-10-01"),
7 String::from("blog/post-67890"),
8 ],
9 sso: Some(String::from("user-456-sso-token")),
10 };
11 let stats: GetFeedPostsStats200Response = get_feed_posts_stats(&configuration, params).await?;
12 Ok(())
13}
14

get_user_reacts_public Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
post_ids Vec No
sso String No

Response

Returns: GetUserReactsPublic200Response

Example

get_user_reacts_public Example
Copy Copy
1
2async fn fetch_user_reacts() -> Result<GetUserReactsPublic200Response, Error> {
3 let params: GetUserReactsPublicParams = GetUserReactsPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 post_ids: Some(vec![
6 "news/article-123".to_string(),
7 "news/article-124".to_string(),
8 ]),
9 sso: Some("sso:john.doe@example.com".to_string()),
10 };
11 let reacts: GetUserReactsPublic200Response = get_user_reacts_public(&configuration, params).await?;
12 Ok(reacts)
13}
14

react_feed_post_public Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
post_id String Yes
react_body_params models::ReactBodyParams Yes
is_undo bool No
broadcast_id String No
sso String No

Response

Returns: ReactFeedPostPublic200Response

Example

react_feed_post_public Example
Copy Copy
1
2async fn example_react() -> Result<ReactFeedPostPublic200Response, Error> {
3 let params: ReactFeedPostPublicParams = ReactFeedPostPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 post_id: "news/article-2025-10-31".to_string(),
6 react_body_params: models::ReactBodyParams {
7 reaction: "like".to_string(),
8 score: Some(1),
9 },
10 is_undo: Some(false),
11 broadcast_id: Some("broadcast-9c3f".to_string()),
12 sso: Some("sso-token-xyz".to_string()),
13 };
14 let response: ReactFeedPostPublic200Response = react_feed_post_public(&configuration, params).await?;
15 Ok(response)
16}
17

update_feed_post Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes
feed_post models::FeedPost Yes

Response

Returns: FlagCommentPublic200Response

Example

update_feed_post Example
Copy Copy
1
2async fn example_update_feed_post() -> Result<FlagCommentPublic200Response, Error> {
3 let feed_post: models::FeedPost = models::FeedPost {
4 id: Some("post-2025-11-04-001".into()),
5 title: Some("Daily Tech Update — Nov 4, 2025".into()),
6 content: Some("Top stories in AI, security, and Rust ecosystem.".into()),
7 tags: Some(vec!["technology".into(), "rust".into(), "ai".into()]),
8 published: Some(true),
9 media: Some(vec![models::FeedPostMediaItem {
10 caption: Some("Cover photo".into()),
11 asset: Some(models::FeedPostMediaItemAsset {
12 url: Some("https://cdn.acme-corp.com/assets/cover-2025-11-04.jpg".into()),
13 mime_type: Some("image/jpeg".into()),
14 ..Default::default()
15 }),
16 ..Default::default()
17 }]),
18 links: Some(vec![models::FeedPostLink {
19 url: Some("https://acme-corp.com/articles/daily-tech-2025-11-04".into()),
20 text: Some("Read full story".into()),
21 ..Default::default()
22 }]),
23 ..Default::default()
24 };
25 let params: UpdateFeedPostParams = UpdateFeedPostParams {
26 tenant_id: "acme-corp-tenant".into(),
27 id: "news/daily-tech-2025-11-04".into(),
28 feed_post,
29 };
30 let resp: FlagCommentPublic200Response = update_feed_post(&configuration, params).await?;
31 Ok(resp)
32}
33

update_feed_post_public Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
post_id String Yes
update_feed_post_params models::UpdateFeedPostParams Yes
broadcast_id String No
sso String No

Response

Returns: CreateFeedPostPublic200Response

Example

update_feed_post_public Example
Copy Copy
1
2let params: UpdateFeedPostPublicParams = UpdateFeedPostPublicParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 post_id: "news/article-2025-11-04-updates".to_string(),
5 update_feed_post_params: models::UpdateFeedPostParams {
6 title: Some("Morning Briefing: Market Update".to_string()),
7 content: Some("Markets opened higher today following positive earnings reports and tech gains.".to_string()),
8 media: Some(vec![
9 models::FeedPostMediaItem {
10 asset: Some(models::FeedPostMediaItemAsset {
11 url: "https://cdn.acme.com/images/market.jpg".to_string(),
12 mime_type: Some("image/jpeg".to_string()),
13 }),
14 caption: Some("Opening bell at the exchange".to_string()),
15 }
16 ]),
17 links: Some(vec![
18 models::FeedPostLink {
19 url: "https://acme.com/articles/market-update-2025".to_string(),
20 title: Some("Read full report".to_string()),
21 }
22 ]),
23 ..Default::default()
24 },
25 broadcast_id: Some("broadcast-339".to_string()),
26 sso: Some("sso-token-abc123".to_string()),
27};
28let response: CreateFeedPostPublic200Response = update_feed_post_public(&configuration, params).await?;
29

flag_comment_public Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
comment_id String Yes
is_flagged bool Yes
sso String No

Response

Returns: FlagCommentPublic200Response

Example

flag_comment_public Example
Copy Copy
1
2async fn run_flag() -> Result<FlagCommentPublic200Response, Error> {
3 let params: FlagCommentPublicParams = FlagCommentPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "news/article/2025/67890".to_string(),
6 is_flagged: true,
7 sso: Some("sso-user-token-7f3b".to_string()),
8 };
9 let resp: FlagCommentPublic200Response = flag_comment_public(configuration, params).await?;
10 Ok(resp)
11}
12

add_page Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
create_api_page_data models::CreateApiPageData Yes

Response

Returns: AddPageApiResponse

Example

add_page Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let create_data: models::CreateApiPageData = models::CreateApiPageData {
4 path: "news/product-launch".to_string(),
5 url: Some("https://acme-corp.example/news/product-launch".to_string()),
6 title: Some("Acme Corp Launches New Quantum Widget".to_string()),
7 description: Some("Details on Acme's latest product release and specs.".to_string()),
8 allow_comments: Some(true),
9 };
10 let params: AddPageParams = AddPageParams {
11 tenant_id: "acme-corp-tenant".to_string(),
12 create_api_page_data: create_data,
13 };
14 let response: AddPageApiResponse = add_page(&configuration, params).await?;
15 Ok(())
16}
17

delete_page Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes

Response

Returns: DeletePageApiResponse

Example

delete_page Example
Copy Copy
1
2async fn example_delete_page() -> Result<(), Error> {
3 let params: DeletePageParams = DeletePageParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article".to_string(),
6 force: Some(true),
7 };
8 let _response: DeletePageApiResponse = delete_page(&configuration, params).await?;
9 Ok(())
10}
11

get_page_by_urlid Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
url_id String Yes

Response

Returns: GetPageByUrlidApiResponse

Example

get_page_by_urlid Example
Copy Copy
1
2async fn example_get_page() -> Result<(), Error> {
3 let params: GetPageByUrlidParams = GetPageByUrlidParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/politics/election-coverage-2025".to_string(),
6 include_comments: Some(true),
7 };
8 let page: GetPageByUrlidApiResponse = get_page_by_urlid(&configuration, params).await?;
9 Ok(())
10}
11

get_pages Internal Link

Parameters

Name Type Required Description
tenant_id String Yes

Response

Returns: GetPagesApiResponse

Example

get_pages Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: GetPagesParams = GetPagesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 path: Some("news/article".to_string()),
6 page: Some(1),
7 page_size: Some(50),
8 };
9 let pages: GetPagesApiResponse = get_pages(&configuration, params).await?;
10 Ok(())
11}
12

patch_page Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes
update_api_page_data models::UpdateApiPageData Yes

Response

Returns: PatchPageApiResponse

Example

patch_page Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let update: models::UpdateApiPageData = models::UpdateApiPageData {
4 title: Some("Q3 Product Launch".to_string()),
5 path: Some("news/product-launch-q3".to_string()),
6 description: Some("Announcing our Q3 product lineup.".to_string()),
7 is_published: Some(true),
8 };
9 let params: PatchPageParams = PatchPageParams {
10 tenant_id: "acme-corp-tenant".to_string(),
11 id: "news/product-launch-q3".to_string(),
12 update_api_page_data: update,
13 };
14 let response: PatchPageApiResponse = patch_page(&configuration, params).await?;
15 Ok(())
16}
17

aggregate_question_results Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
question_id String No
question_ids Vec No
url_id String No
time_bucket models::AggregateTimeBucket No
start_date String No
force_recalculate bool No

Response

Returns: AggregateQuestionResults200Response

Example

aggregate_question_results Example
Copy Copy
1
2async fn run_example(configuration: &configuration::Configuration) -> Result<AggregateQuestionResults200Response, Error> {
3 let params: AggregateQuestionResultsParams = AggregateQuestionResultsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 question_id: None,
6 question_ids: Some(vec!["product-q-123".to_string(), "product-q-456".to_string()]),
7 url_id: Some("news/article/2025-election".to_string()),
8 time_bucket: Some(models::AggregateTimeBucket::Daily),
9 start_date: Some("2025-01-01T00:00:00Z".to_string()),
10 force_recalculate: Some(true),
11 };
12 let response: AggregateQuestionResults200Response = aggregate_question_results(configuration, params).await?;
13 Ok(response)
14}
15

bulk_aggregate_question_results Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
bulk_aggregate_question_results_request models::BulkAggregateQuestionResultsRequest Yes
force_recalculate bool No

Response

Returns: BulkAggregateQuestionResults200Response

Example

bulk_aggregate_question_results Example
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params: BulkAggregateQuestionResultsParams = BulkAggregateQuestionResultsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 bulk_aggregate_question_results_request: models::BulkAggregateQuestionResultsRequest {
6 items: vec![
7 models::BulkAggregateQuestionItem {
8 question_id: "satisfaction".to_string(),
9 path: "news/article/2025/10/04/product-launch".to_string(),
10 }
11 ],
12 start_time: "2025-10-01T00:00:00Z".to_string(),
13 end_time: "2025-10-31T23:59:59Z".to_string(),
14 time_bucket: models::AggregateTimeBucket::Daily,
15 },
16 force_recalculate: Some(true),
17 };
18 let response: BulkAggregateQuestionResults200Response = bulk_aggregate_question_results(&configuration, params).await?;
19 Ok(())
20}
21

combine_comments_with_question_results Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
question_id String No
question_ids Vec No
url_id String No
start_date String No
force_recalculate bool No
min_value f64 No
max_value f64 No
limit f64 No

Response

Returns: CombineCommentsWithQuestionResults200Response

Example

combine_comments_with_question_results Example
Copy Copy
1
2let params: CombineCommentsWithQuestionResultsParams = CombineCommentsWithQuestionResultsParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 question_id: Some("q-2025-product-satisfaction".to_string()),
5 question_ids: Some(vec!["q-2025-product-satisfaction".to_string(), "q-2024-overall".to_string()]),
6 url_id: Some("news/tech/acme-launch".to_string()),
7 start_date: Some("2025-10-01T00:00:00Z".to_string()),
8 force_recalculate: Some(true),
9 min_value: Some(0.0),
10 max_value: Some(5.0),
11 limit: Some(250.0),
12};
13let combined: CombineCommentsWithQuestionResults200Response =
14 combine_comments_with_question_results(&configuration, params).await?;
15

add_sso_user Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
create_apisso_user_data models::CreateApissoUserData Yes

Response

Returns: AddSsoUserApiResponse

Example

add_sso_user Example
Copy Copy
1
2let params: AddSsoUserParams = AddSsoUserParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 create_apisso_user_data: models::CreateApissoUserData {
5 external_id: "jane.doe@acme.com".to_string(),
6 email: "jane.doe@acme.com".to_string(),
7 display_name: "Jane Doe".to_string(),
8 roles: Some(vec!["author".to_string(), "editor".to_string()]),
9 avatar_url: Some("https://cdn.acme.com/avatars/jane.jpg".to_string()),
10 verified: Some(true),
11 metadata: None,
12 },
13};
14
15let response: AddSsoUserApiResponse = add_sso_user(&configuration, params).await?;
16

delete_sso_user Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes
delete_comments bool No
comment_delete_mode String No

Response

Returns: DeleteSsoUserApiResponse

Example

delete_sso_user Example
Copy Copy
1
2async fn run_delete_sso_user_example() -> Result<DeleteSsoUserApiResponse, Error> {
3 let params: DeleteSsoUserParams = DeleteSsoUserParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "sso-user-8f7a2b".to_string(),
6 delete_comments: Some(true),
7 comment_delete_mode: Some("cascade".to_string()),
8 };
9 let response: DeleteSsoUserApiResponse = delete_sso_user(&configuration, params).await?;
10 Ok(response)
11}
12

get_sso_user_by_email Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
email String Yes

Response

Returns: GetSsoUserByEmailApiResponse

Example

get_sso_user_by_email Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: GetSsoUserByEmailParams = GetSsoUserByEmailParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 email: "jane.doe@acme.com".to_string(),
6 };
7 let user: GetSsoUserByEmailApiResponse = get_sso_user_by_email(&configuration, params).await?;
8 Ok(())
9}
10

get_sso_user_by_id Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes

Response

Returns: GetSsoUserByIdApiResponse

Example

get_sso_user_by_id Example
Copy Copy
1
2async fn fetch_sso_user() -> Result<(), Error> {
3 let tenant_id_opt: Option<String> = Some("acme-corp-tenant".to_string());
4 let id_opt: Option<String> = Some("sso-user-42b7".to_string());
5 let params: GetSsoUserByIdParams = GetSsoUserByIdParams {
6 tenant_id: tenant_id_opt.unwrap(),
7 id: id_opt.unwrap(),
8 };
9 let response: GetSsoUserByIdApiResponse = get_sso_user_by_id(&configuration, params).await?;
10 Ok(())
11}
12

get_sso_users Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
skip i32 No

Response

Returns: GetSsoUsers200Response

Example

get_sso_users Example
Copy Copy
1
2async fn fetch_sso_users() -> Result<GetSsoUsers200Response, Error> {
3 let params: GetSsoUsersParams = GetSsoUsersParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 skip: Some(10),
6 };
7 let response: GetSsoUsers200Response = get_sso_users(&configuration, params).await?;
8 Ok(response)
9}
10

patch_sso_user Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes
update_apisso_user_data models::UpdateApissoUserData Yes
update_comments bool No

Response

Returns: PatchSsoUserApiResponse

Example

patch_sso_user Example
Copy Copy
1
2let params = PatchSsoUserParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 id: "user-1234".to_string(),
5 update_apisso_user_data: models::UpdateApissoUserData {
6 email: "jane.doe@acme.com".to_string(),
7 display_name: "Jane Doe".to_string(),
8 external_id: "sso-jane-doe-987".to_string(),
9 picture_url: Some("https://acme.com/avatars/jane.jpg".to_string()),
10 roles: vec!["editor".to_string(), "contributor".to_string()],
11 },
12 update_comments: Some(true),
13};
14
15let updated: PatchSsoUserApiResponse = patch_sso_user(&configuration, params).await?;
16

put_sso_user Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes
update_apisso_user_data models::UpdateApissoUserData Yes
update_comments bool No

Response

Returns: PutSsoUserApiResponse

Example

put_sso_user Example
Copy Copy
1
2async fn update_sso_user() -> Result<(), Error> {
3 let params: PutSsoUserParams = PutSsoUserParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "user-1234".to_string(),
6 update_apisso_user_data: models::UpdateApissoUserData {
7 sso_id: "sso|google-oauth2|1122334455".to_string(),
8 email: "jane.doe@acme.com".to_string(),
9 display_name: "Jane Doe".to_string(),
10 roles: vec!["author".to_string(), "editor".to_string()],
11 },
12 update_comments: Some(true),
13 };
14
15 let response: PutSsoUserApiResponse = put_sso_user(&configuration, params).await?;
16 Ok(())
17}
18

create_subscription Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
create_api_user_subscription_data models::CreateApiUserSubscriptionData Yes

Response

Returns: CreateSubscriptionApiResponse

Example

create_subscription Example
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params: CreateSubscriptionParams = CreateSubscriptionParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 create_api_user_subscription_data: models::CreateApiUserSubscriptionData {
6 api_user_id: "api_user_789".to_string(),
7 plan_id: "pro_monthly".to_string(),
8 start_date: Some("2025-11-01T00:00:00Z".to_string()),
9 trial_period_days: Some(14),
10 is_auto_renew: Some(true),
11 channels: Some(vec!["email".to_string(), "web".to_string()]),
12 metadata: Some(std::collections::HashMap::from([("source".to_string(), "newsletter".to_string())])),
13 callback_url: Some("https://webhook.acme.com/subscription".to_string()),
14 billing_cycle: Some("monthly".to_string()),
15 },
16 };
17 let response: CreateSubscriptionApiResponse = create_subscription(&configuration, params).await?;
18 Ok(())
19}
20

delete_subscription Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes
user_id String No

Response

Returns: DeleteSubscriptionApiResponse

Example

delete_subscription Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: DeleteSubscriptionParams = DeleteSubscriptionParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article:1234".to_string(),
6 user_id: Some("user-78b3f".to_string()),
7 };
8 let response: DeleteSubscriptionApiResponse = delete_subscription(&configuration, params).await?;
9 Ok(())
10}
11

get_subscriptions Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
user_id String No

Response

Returns: GetSubscriptionsApiResponse

Example

get_subscriptions Example
Copy Copy
1
2async fn fetch_user_subscriptions() -> Result<(), Error> {
3 let params: GetSubscriptionsParams = GetSubscriptionsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 user_id: Some("user-9876@acme.com".to_string()),
6 };
7 let subscriptions: GetSubscriptionsApiResponse = get_subscriptions(&configuration, params).await?;
8 println!("{:#?}", subscriptions);
9 Ok(())
10}
11

upload_image Internal Link

Upload and resize an image

Parameters

Name Type Required Description
tenant_id String Yes
file std::path::PathBuf Yes
size_preset models::SizePreset No
url_id String No

Response

Returns: UploadImageResponse

Example

upload_image Example
Copy Copy
1
2async fn run_upload(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params: UploadImageParams = UploadImageParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 file: std::path::PathBuf::from("assets/images/article-hero.jpg"),
6 size_preset: Some(models::SizePreset::Medium),
7 url_id: Some("news/article/2025/11/04".to_string()),
8 };
9 let response: UploadImageResponse = upload_image(configuration, params).await?;
10 println!("{:#?}", response);
11 Ok(())
12}
13

get_user_badge_progress_by_id Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes

Response

Returns: GetUserBadgeProgressById200Response

Example

get_user_badge_progress_by_id Example
Copy Copy
1
2async fn fetch_badge_progress() -> Result<(), Error> {
3 let params = GetUserBadgeProgressByIdParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "badge-9274".to_string(),
6 };
7 let badge_progress: GetUserBadgeProgressById200Response =
8 get_user_badge_progress_by_id(&configuration, params).await?;
9 Ok(())
10}
11

get_user_badge_progress_by_user_id Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
user_id String Yes

Response

Returns: GetUserBadgeProgressById200Response

Example

get_user_badge_progress_by_user_id Example
Copy Copy
1
2let params: GetUserBadgeProgressByUserIdParams = GetUserBadgeProgressByUserIdParams {
3 tenant_id: "acme-news-tenant".to_string(),
4 user_id: "journalist-44321".to_string(),
5 include_inactive: Some(false),
6};
7let response: GetUserBadgeProgressById200Response = get_user_badge_progress_by_user_id(&configuration, params).await?
8

get_user_badge_progress_list Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
user_id String No
limit f64 No
skip f64 No

Response

Returns: GetUserBadgeProgressList200Response

Example

get_user_badge_progress_list Example
Copy Copy
1
2async fn run() -> Result<GetUserBadgeProgressList200Response, Error> {
3 let params: GetUserBadgeProgressListParams = GetUserBadgeProgressListParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 user_id: Some("user-9876".to_string()),
6 limit: Some(25.0),
7 skip: Some(0.0),
8 };
9 let response: GetUserBadgeProgressList200Response =
10 get_user_badge_progress_list(&configuration, params).await?;
11 Ok(response)
12}
13

create_user_badge Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
create_user_badge_params models::CreateUserBadgeParams Yes

Response

Returns: CreateUserBadge200Response

Example

create_user_badge Example
Copy Copy
1
2let badge_payload: models::CreateUserBadgeParams = models::CreateUserBadgeParams {
3 user_id: "user-9876".to_string(),
4 badge_key: "top-contributor".to_string(),
5 awarded_by: Some("editor-jane".to_string()),
6 reason: Some("Consistently high-quality comments on technology articles".to_string()),
7 expires_at: Some("2026-12-31T23:59:59Z".to_string()),
8};
9
10let params: CreateUserBadgeParams = CreateUserBadgeParams {
11 tenant_id: "acme-corp-tenant".to_string(),
12 create_user_badge_params: badge_payload,
13};
14
15let response: CreateUserBadge200Response = create_user_badge(&configuration, params).await?;
16

delete_user_badge Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes

Response

Returns: UpdateUserBadge200Response

Example

delete_user_badge Example
Copy Copy
1
2async fn run_delete_badge() -> Result<UpdateUserBadge200Response, Error> {
3 let params: DeleteUserBadgeParams = DeleteUserBadgeParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "badge-2025-0001".to_string(),
6 };
7 let admin_note: Option<String> = Some("removed by moderator due to spam".to_string());
8 let response: UpdateUserBadge200Response = delete_user_badge(&configuration, params).await?;
9 Ok(response)
10}
11

get_user_badge Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes

Response

Returns: GetUserBadge200Response

Example

get_user_badge Example
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let include_meta: Option<&str> = Some("include=history");
4 let params: GetUserBadgeParams = GetUserBadgeParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 id: "badge-verified-2025".to_string(),
7 };
8 let badge: GetUserBadge200Response = get_user_badge(&configuration, params).await?;
9 Ok(())
10}
11

get_user_badges Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
user_id String No
badge_id String No
displayed_on_comments bool No
limit f64 No
skip f64 No

Response

Returns: GetUserBadges200Response

Example

get_user_badges Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: GetUserBadgesParams = GetUserBadgesParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 user_id: Some(String::from("user-12345")),
6 badge_id: Some(String::from("top-contributor")),
7 displayed_on_comments: Some(true),
8 limit: Some(25.0),
9 skip: Some(0.0),
10 };
11 let badges: GetUserBadges200Response = get_user_badges(&configuration, params).await?;
12 Ok(())
13}
14

update_user_badge Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
id String Yes
update_user_badge_params models::UpdateUserBadgeParams Yes

Response

Returns: UpdateUserBadge200Response

Example

update_user_badge Example
Copy Copy
1
2async fn run_update_badge() -> Result<(), Error> {
3 let params = UpdateUserBadgeParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "badge-2025".to_string(),
6 update_user_badge_params: models::UpdateUserBadgeParams {
7 name: Some("Community Champion".to_string()),
8 description: Some("Awarded for exceptional contributions to discussions".to_string()),
9 icon_url: Some("https://assets.acme.com/badges/champion.png".to_string()),
10 enabled: Some(true),
11 required_posts: Some(100),
12 },
13 };
14
15 let updated: UpdateUserBadge200Response = update_user_badge(&configuration, params).await?;
16 Ok(())
17}
18

get_user_notification_count Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
sso String No

Response

Returns: GetUserNotificationCount200Response

Example

get_user_notification_count Example
Copy Copy
1
2async fn run(config: &configuration::Configuration) -> Result<(), Error> {
3 let params: GetUserNotificationCountParams = GetUserNotificationCountParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 sso: Some("user-98765-sso-token".to_string()),
6 };
7 let resp: GetUserNotificationCount200Response = get_user_notification_count(config, params).await?;
8 dbg!(resp);
9 Ok(())
10}
11

get_user_notifications Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
page_size i32 No
after_id String No
include_context bool No
after_created_at i64 No
unread_only bool No
dm_only bool No
no_dm bool No
include_translations bool No
sso String No

Response

Returns: GetUserNotifications200Response

Example

get_user_notifications Example
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params: GetUserNotificationsParams = GetUserNotificationsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 page_size: Some(50),
6 after_id: Some("notif_12345abcdef".to_string()),
7 include_context: Some(true),
8 after_created_at: Some(1_700_123_456i64),
9 unread_only: Some(true),
10 dm_only: Some(false),
11 no_dm: Some(false),
12 include_translations: Some(true),
13 sso: Some("sso_user_token_01".to_string()),
14 };
15 let notifications: GetUserNotifications200Response =
16 get_user_notifications(&configuration, params).await?;
17 Ok(())
18}
19

reset_user_notification_count Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
sso String No

Response

Returns: ResetUserNotifications200Response

Example

reset_user_notification_count Example
Copy Copy
1
2async fn run_reset() -> Result<(), Error> {
3 let params: ResetUserNotificationCountParams = ResetUserNotificationCountParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 sso: Some("sso-jwt-4f3a2b".to_string()),
6 };
7
8 let _response: ResetUserNotifications200Response =
9 reset_user_notification_count(&configuration, params).await?;
10
11 Ok(())
12}
13

reset_user_notifications Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
after_id String No
after_created_at i64 No
unread_only bool No
dm_only bool No
no_dm bool No
sso String No

Response

Returns: ResetUserNotifications200Response

Example

reset_user_notifications Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: ResetUserNotificationsParams = ResetUserNotificationsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 after_id: Some("notif_20251103_01".to_string()),
6 after_created_at: Some(1_694_000_000i64),
7 unread_only: Some(true),
8 dm_only: Some(false),
9 no_dm: Some(false),
10 sso: Some("saml".to_string()),
11 };
12 let response: ResetUserNotifications200Response = reset_user_notifications(&configuration, params).await?;
13 Ok(())
14}
15

update_user_notification_comment_subscription_status Internal Link

Enable or disable notifications for a specific comment.

Parameters

Name Type Required Description
tenant_id String Yes
notification_id String Yes
opted_in_or_out String Yes
comment_id String Yes
sso String No

Response

Returns: UpdateUserNotificationStatus200Response

Example

update_user_notification_comment_subscription_status Example
Copy Copy
1
2async fn perform_update() -> Result<UpdateUserNotificationStatus200Response, Error> {
3 let params = UpdateUserNotificationCommentSubscriptionStatusParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 notification_id: String::from("notif-2025-08-01-12345"),
6 opted_in_or_out: String::from("opted_out"),
7 comment_id: String::from("news/article-98765-comment-4321"),
8 sso: Some(String::from("sso-token-xyz")),
9 };
10 let response: UpdateUserNotificationStatus200Response =
11 update_user_notification_comment_subscription_status(&configuration, params).await?;
12 Ok(response)
13}
14

update_user_notification_page_subscription_status 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
tenant_id String Yes
url_id String Yes
url String Yes
page_title String Yes
subscribed_or_unsubscribed String Yes
sso String No

Response

Returns: UpdateUserNotificationStatus200Response

Example

update_user_notification_page_subscription_status Example
Copy Copy
1
2async fn run_update_subscription() -> Result<UpdateUserNotificationStatus200Response, Error> {
3 let params: UpdateUserNotificationPageSubscriptionStatusParams = UpdateUserNotificationPageSubscriptionStatusParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article-2025-10-31-major-update".to_string(),
6 url: "https://acme.example.com/news/2025/10/31/major-update".to_string(),
7 page_title: "Major Product Update".to_string(),
8 subscribed_or_unsubscribed: "subscribed".to_string(),
9 sso: Some("user-123-sso-token".to_string()),
10 };
11 let resp: UpdateUserNotificationStatus200Response = update_user_notification_page_subscription_status(&configuration, params).await?;
12 Ok(resp)
13}
14

update_user_notification_status Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
notification_id String Yes
new_status String Yes
sso String No

Response

Returns: UpdateUserNotificationStatus200Response

Example

update_user_notification_status Example
Copy Copy
1
2async fn run_update_user_notification_status() -> Result<(), Error> {
3 let params: UpdateUserNotificationStatusParams = UpdateUserNotificationStatusParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 notification_id: "notif-2025-11-04-89ab".to_string(),
6 new_status: "read".to_string(),
7 sso: Some("sso-session-7f3d9a".to_string()),
8 };
9 let resp: UpdateUserNotificationStatus200Response =
10 update_user_notification_status(&configuration, params).await?;
11 Ok(())
12}
13

get_user_presence_statuses Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
url_id_ws String Yes
user_ids String Yes

Response

Returns: GetUserPresenceStatuses200Response

Example

get_user_presence_statuses Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: GetUserPresenceStatusesParams = GetUserPresenceStatusesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id_ws: "news/article".to_string(),
6 user_ids: "alice@example.com,bob@example.com,charlie@example.com".to_string(),
7 };
8 let response: GetUserPresenceStatuses200Response =
9 get_user_presence_statuses(&configuration, params).await?;
10 let _response = response;
11 Ok(())
12}
13

search_users Internal Link

Parameters

Name Type Required Description
tenant_id String Yes
url_id String Yes
username_starts_with String Yes
mention_group_ids Vec No
sso String No

Response

Returns: SearchUsers200Response

Example

search_users Example
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: SearchUsersParams = SearchUsersParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article/2025/11/04".to_string(),
6 username_starts_with: "joh".to_string(),
7 mention_group_ids: Some(vec!["editors".to_string(), "moderators".to_string()]),
8 sso: Some("sso-key-12345".to_string()),
9 };
10 let response: SearchUsers200Response = search_users(&configuration, params).await?;
11 Ok(())
12}
13

Need Help?

If you encounter any issues or have questions about the Rust SDK, please:

Contributing

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