List Comments

Retrieve AI-generated comments for a product with filtering by status, search, and pagination.

Endpoint

GET /api/products/{productId}/ai-comments

Authentication

Requires API key authentication via Bearer token.

Authorization: Bearer sk_your_api_key

URL Parameters

ParameterTypeDescription
productIdstringYour product ID

Query Parameters

ParameterTypeDefaultDescription
statusstringpreviewFilter by status: preview, queue, or posted
searchstring-Search in post title, content, and reply
pagenumber1Page number for pagination
pageSizenumber5Items per page (max 100)
executionIdstring-Filter by execution ID (preview only)
moderatorRemovedstring-Filter posted comments: true (failed) or false (active)

Status Values

  • preview - Comments awaiting review (not yet approved)
  • queue - Approved comments waiting to be posted
  • posted - Successfully posted comments

Example Request

Basic Request

bash
curl -X GET "https://www.replyagent.ai/api/products/prod_123/ai-comments" \
  -H "Authorization: Bearer sk_your_api_key"

With Filters

bash
curl -X GET "https://www.replyagent.ai/api/products/prod_123/ai-comments?status=posted&page=1&pageSize=20" \
  -H "Authorization: Bearer sk_your_api_key"
bash
curl -X GET "https://www.replyagent.ai/api/products/prod_123/ai-comments?status=preview&search=startup" \
  -H "Authorization: Bearer sk_your_api_key"

Success Response

Status: 200 OK

json
{
  "aiComments": [
    {
      "id": "cm_abc123...",
      "productId": "prod_123",
      "postId": "post_456",
      "postTitle": "Best tools for SaaS startups?",
      "postUrl": "https://www.reddit.com/r/SaaS/comments/abc123/best_tools/",
      "subreddit": "SaaS",
      "postContent": "Looking for recommendations...",
      "suggestedReply": "I've been using MyProduct for this...",
      "isApproved": false,
      "isPosted": false,
      "isDeleted": false,
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:30:00.000Z",
      "submittedAt": null,
      "commentId": null,
      "commentUrl": null,
      "redditAccount": null,
      "postMeta": {
        "upvotes": 45,
        "numComments": 23,
        "createdUtc": "2024-01-15T08:00:00.000Z",
        "source": "reddit"
      },
      "extra": {
        "searchSource": "reddit"
      }
    }
  ],
  "availableExecutions": ["exec_001", "exec_002"],
  "pagination": {
    "page": 1,
    "pageSize": 5,
    "totalCount": 42,
    "totalPages": 9,
    "hasNext": true,
    "hasPrev": false
  }
}

Comment Object Fields

FieldTypeDescription
idstringUnique comment ID
productIdstringAssociated product ID
postIdstringInternal post reference ID
postTitlestringReddit post title
postUrlstringFull Reddit post URL
subredditstringSubreddit name (without r/)
postContentstringReddit post body text
suggestedReplystringAI-generated or manual reply text
isApprovedbooleanWhether comment is approved for posting
isPostedbooleanWhether comment has been posted to Reddit
isDeletedbooleanWhether comment has been soft-deleted
createdAtstringISO timestamp of creation
submittedAtstring | nullISO timestamp of posting (if posted)
commentIdstring | nullReddit comment ID (if posted)
commentUrlstring | nullFull Reddit comment URL (if posted)
redditAccountobject | nullAccount info if assigned
postMetaobjectPost metadata (upvotes, comments, etc.)
extraobjectAdditional metadata

Pagination Object

FieldTypeDescription
pagenumberCurrent page number
pageSizenumberItems per page
totalCountnumberTotal number of comments
totalPagesnumberTotal number of pages
hasNextbooleanWhether more pages exist
hasPrevbooleanWhether previous pages exist

Error Responses

401 Unauthorized

json
{
  "error": "Unauthorized"
}

403 Forbidden

json
{
  "error": "Access denied to this product"
}

404 Not Found

json
{
  "error": "Product not found"
}

Use Cases

Sync Comments to External System

Fetch all posted comments to sync with your analytics:

bash
curl -X GET "https://www.replyagent.ai/api/products/prod_123/ai-comments?status=posted&pageSize=100" \
  -H "Authorization: Bearer sk_your_api_key"

Monitor Pending Queue

Check comments waiting to be posted:

bash
curl -X GET "https://www.replyagent.ai/api/products/prod_123/ai-comments?status=queue" \
  -H "Authorization: Bearer sk_your_api_key"

Search for Specific Topics

Find comments related to a keyword:

bash
curl -X GET "https://www.replyagent.ai/api/products/prod_123/ai-comments?search=pricing&status=preview" \
  -H "Authorization: Bearer sk_your_api_key"