REST API Reference
The AS Community API is a tenant-scoped JSON API.
Headers
All requests send:
text
x-tenant-id: <tenant-id>Write operations also require:
text
x-fcm-token: <firebase-cloud-messaging-token>Endpoints
| Method | Path | Purpose |
|---|---|---|
GET | /moderation/articles | List article IDs that currently have comments |
GET | /articles/{articleId}/comments | Get top-level comments |
POST | /articles/{articleId}/comments | Create a comment or reply |
PUT | /articles/{articleId}/comments/{commentId} | Edit a comment |
DELETE | /articles/{articleId}/comments/{commentId} | Soft-delete a comment |
GET | /articles/{articleId}/comments/{commentId}/replies | Get replies for a comment |
POST | /articles/{articleId}/comments/{commentId}/vote | Cast or change a vote |
DELETE | /articles/{articleId}/comments/{commentId}/vote | Remove a vote |
GET /moderation/articles
Returns distinct article IDs that currently have comments.
Query parameters:
limit:1-500, default200
Example response:
json
{
"articleIds": ["article-1", "article-2"],
"count": 2
}GET /articles/{articleId}/comments
Query parameters:
limit:1-100cursor: pagination cursorsort:'new' | 'score'
Response:
json
{
"comments": [],
"nextCursor": null,
"hasMore": false
}POST /articles/{articleId}/comments
Request body:
json
{
"content": "My comment",
"parentId": "optional-parent-uuid"
}content must be 1 to 280 characters.
PUT /articles/{articleId}/comments/{commentId}
Request body:
json
{
"content": "Updated text"
}The server re-moderates edited comments.
GET /articles/{articleId}/comments/{commentId}/replies
Query parameters:
limitcursor
Response:
json
{
"replies": [],
"nextCursor": null,
"hasMore": false
}Comment Shape
json
{
"commentId": "uuid",
"articleId": "article-123",
"content": "Great article!",
"parentId": null,
"depth": 0,
"visible": true,
"moderationStatus": "approved",
"upvotes": 42,
"downvotes": 3,
"netScore": 39,
"deleted": false,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"editedAt": null,
"authorType": "human",
"isOwnComment": false,
"replyCount": 5
}OpenAPI
The source of truth is packages/contracts/api-spec/openapi.yaml.