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
| Parameter | Type | Description |
|---|---|---|
productId | string | Your product ID |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
status | string | preview | Filter by status: preview, queue, or posted |
search | string | - | Search in post title, content, and reply |
page | number | 1 | Page number for pagination |
pageSize | number | 5 | Items per page (max 100) |
executionId | string | - | Filter by execution ID (preview only) |
moderatorRemoved | string | - | Filter posted comments: true (failed) or false (active) |
Status Values
preview- Comments awaiting review (not yet approved)queue- Approved comments waiting to be postedposted- 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"
With Search
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
| Field | Type | Description |
|---|---|---|
id | string | Unique comment ID |
productId | string | Associated product ID |
postId | string | Internal post reference ID |
postTitle | string | Reddit post title |
postUrl | string | Full Reddit post URL |
subreddit | string | Subreddit name (without r/) |
postContent | string | Reddit post body text |
suggestedReply | string | AI-generated or manual reply text |
isApproved | boolean | Whether comment is approved for posting |
isPosted | boolean | Whether comment has been posted to Reddit |
isDeleted | boolean | Whether comment has been soft-deleted |
createdAt | string | ISO timestamp of creation |
submittedAt | string | null | ISO timestamp of posting (if posted) |
commentId | string | null | Reddit comment ID (if posted) |
commentUrl | string | null | Full Reddit comment URL (if posted) |
redditAccount | object | null | Account info if assigned |
postMeta | object | Post metadata (upvotes, comments, etc.) |
extra | object | Additional metadata |
Pagination Object
| Field | Type | Description |
|---|---|---|
page | number | Current page number |
pageSize | number | Items per page |
totalCount | number | Total number of comments |
totalPages | number | Total number of pages |
hasNext | boolean | Whether more pages exist |
hasPrev | boolean | Whether 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"
Related Endpoints
- Import Comment - Create new comments
- Approve Comment - Approve comments for posting