π― IMPORTANT: This is a backend API service documentation. These endpoints are designed for apps to integrate with, not for end users to access directly.
Base URL: https://whzwmfxngelicmjyxwmr.supabase.co/functions/v1/
π TOKEN-BASED AUTH - Mod+ actions require client_type + access_token for verification with provider APIs.
Commentum v2 is a comment backend API service that provides:
- Comment CRUD operations
- Voting system
- Content reporting
- Advanced moderation
- Multi-platform support (AniList, MyAnimeList, SIMKL)
Apps integrate with this backend via REST API calls.
- Authentication
- Comments API
- Votes API
- Reports API
- Moderation API
- Users API
- Media API
- Announcements API
- Error Handling
All moderation and admin actions require token-based authentication:
{
"client_type": "anilist",
"access_token": "user_oauth_token_from_provider"
}The backend verifies the token with the appropriate provider API:
| Provider | API Endpoint | Returns |
|---|---|---|
| AniList | graphql.anilist.co |
id, name, avatar |
| MAL | api.myanimelist.net/v2/users/@me |
id, name, picture |
| SIMKL | api.simkl.com/users/settings |
account.id, user.name |
Basic operations use user_info objects:
{
"user_info": {
"user_id": "12345",
"username": "TestUser",
"avatar": "https://example.com/avatar.jpg"
}
}| Endpoint | Operation | Auth Required |
|---|---|---|
/comments |
Create | β No |
/comments |
Edit | β No (user_id match only) |
/comments |
Delete (own) | β No (user_id match only) |
/comments |
mod_delete (others) | β Token required |
/votes |
Vote | β No |
/media |
Get comments | β No |
/reports |
Create report | β No |
/reports |
Resolve report | β Token required |
/reports |
Get queue | β Token required |
/moderation |
All actions | β Token required |
/users |
All actions | β Token required |
Method: POST
Content-Type: application/json
Auth: Not required
{
"action": "create",
"client_type": "anilist",
"user_info": {
"user_id": "12345",
"username": "TestUser",
"avatar": "https://example.com/avatar.jpg"
},
"media_info": {
"media_id": "6789",
"type": "anime",
"title": "Attack on Titan",
"year": 2013,
"poster": "https://example.com/poster.jpg"
},
"content": "This was an amazing episode!",
"parent_id": null,
"tag": "1"
}Response (201):
{
"success": true,
"comment": { /* comment object */ }
}Auth: user_info (owner only)
{
"action": "edit",
"comment_id": 1,
"user_info": {
"user_id": "12345",
"username": "TestUser"
},
"content": "Updated comment text"
}Auth: user_info (owner only)
{
"action": "delete",
"comment_id": 1,
"user_info": {
"user_id": "12345",
"username": "TestUser"
}
}Auth: β Token required (moderator+)
{
"action": "mod_delete",
"comment_id": 1,
"client_type": "anilist",
"access_token": "user_oauth_token_here"
}Response (200):
{
"success": true,
"comment": { /* deleted comment */ },
"moderator": {
"id": "67890",
"username": "ModeratorUser",
"role": "admin"
}
}Method: POST
Auth: Not required
{
"comment_id": 1,
"user_info": {
"user_id": "12345",
"username": "TestUser"
},
"vote_type": "upvote"
}vote_type: "upvote", "downvote", or "remove"
Response (200):
{
"success": true,
"voteScore": 5,
"upvotes": 6,
"downvotes": 1,
"userVote": "upvote"
}Method: POST
Auth: Not required
{
"action": "create",
"comment_id": 1,
"reporter_info": {
"user_id": "12345",
"username": "TestUser"
},
"reason": "spam",
"notes": "This looks like automated spam"
}Valid Reasons: spam, offensive, harassment, spoiler, nsfw, off_topic, other
Auth: β Token required (moderator+)
{
"action": "resolve",
"comment_id": 1,
"client_type": "anilist",
"access_token": "user_oauth_token_here",
"reporter_info": { "user_id": "12345" },
"resolution": "resolved",
"review_notes": "Confirmed spam, removed"
}resolution: "resolved" or "dismissed"
Auth: β Token required (moderator+)
{
"action": "get_queue",
"client_type": "anilist",
"access_token": "user_oauth_token_here"
}Method: POST
Auth: β Token required for all actions
All moderation actions require:
| Parameter | Type | Required | Description |
|---|---|---|---|
action |
string | β | Moderation action type |
client_type |
string | β | "anilist", "mal", "simkl" |
access_token |
string | β | OAuth token from provider |
{
"action": "pin_comment",
"comment_id": 1,
"client_type": "anilist",
"access_token": "...",
"reason": "Important announcement"
}{
"action": "unpin_comment",
"comment_id": 1,
"client_type": "anilist",
"access_token": "...",
"reason": "No longer relevant"
}{
"action": "lock_thread",
"comment_id": 1,
"client_type": "anilist",
"access_token": "...",
"reason": "Off-topic discussion"
}{
"action": "unlock_thread",
"comment_id": 1,
"client_type": "anilist",
"access_token": "...",
"reason": "Discussion can continue"
}{
"action": "warn_user",
"target_user_id": "12345",
"client_type": "anilist",
"access_token": "...",
"reason": "Multiple rule violations"
}{
"action": "ban_user",
"target_user_id": "12345",
"client_type": "anilist",
"access_token": "...",
"reason": "Repeated spam",
"shadow_ban": false
}{
"action": "unban_user",
"target_user_id": "12345",
"client_type": "anilist",
"access_token": "...",
"reason": "Appeal approved"
}{
"action": "get_queue",
"client_type": "anilist",
"access_token": "..."
}Method: POST
Auth: β Token required for all actions
{
"action": "get_user_info",
"client_type": "anilist",
"access_token": "...",
"target_user_id": "12345",
"target_client_type": "anilist"
}{
"action": "get_user_stats",
"client_type": "anilist",
"access_token": "...",
"target_client_type": "anilist"
}{
"action": "warn_user",
"client_type": "anilist",
"access_token": "...",
"target_user_id": "12345",
"target_client_type": "anilist",
"reason": "Rule violation"
}{
"action": "mute_user",
"client_type": "anilist",
"access_token": "...",
"target_user_id": "12345",
"target_client_type": "anilist",
"reason": "Temporary mute",
"duration": 24
}{
"action": "unmute_user",
"client_type": "anilist",
"access_token": "...",
"target_user_id": "12345",
"target_client_type": "anilist",
"reason": "Mute expired"
}{
"action": "ban_user",
"client_type": "anilist",
"access_token": "...",
"target_user_id": "12345",
"target_client_type": "anilist",
"reason": "Repeated violations"
}{
"action": "unban_user",
"client_type": "anilist",
"access_token": "...",
"target_user_id": "12345",
"target_client_type": "anilist",
"reason": "Appeal approved"
}{
"action": "get_user_history",
"client_type": "anilist",
"access_token": "...",
"target_user_id": "12345",
"target_client_type": "anilist"
}Method: GET
Auth: Not required
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
media_id |
string | β | - | Media identifier |
client_type |
string | β | - | Platform identifier |
page |
integer | β | 1 | Page number |
limit |
integer | β | 50 | Results per page |
sort |
string | β | newest | Sort order |
Sort Options: newest, oldest, top, controversial
Example:
GET /media?media_id=6789&client_type=anilist&page=1&limit=20&sort=top
Response (200):
{
"media": {
"mediaId": "6789",
"mediaType": "anime",
"mediaTitle": "Attack on Titan",
"mediaYear": 2023,
"mediaPoster": "https://example.com/poster.jpg"
},
"comments": [ /* nested comment structure */ ],
"stats": {
"commentCount": 150,
"totalUpvotes": 500,
"totalDownvotes": 50,
"netScore": 450
},
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8
}
}Multi-app announcement system for developer communications.
Method: GET
Auth: Not required (public)
Query Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
app_id |
string | β | - | App ID (anymex/shonenx/animestream) |
status |
string | β | published | Filter by status |
category |
string | β | - | Filter by category |
page |
integer | β | 1 | Page number |
limit |
integer | β | 20 | Results per page (max 50) |
user_id |
string | β | - | For read status |
include_read |
boolean | β | false | Include read status |
Example:
GET /announcements?app_id=anymex&status=published&page=1&limit=20
Response (200):
{
"success": true,
"announcements": [
{
"id": 1,
"title": "New Feature Release",
"short_description": "We've added a new feature...",
"category": "feature",
"pinned": true,
"featured": false,
"priority": 10,
"published_at": "2024-01-15T10:00:00Z",
"author_name": "Dev Team",
"view_count": 150,
"is_read": false
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 45,
"total_pages": 3
},
"unread_count": 5
}Method: GET
Auth: Not required (public)
Example:
GET /announcements/1?user_id=12345&app_id=anymex
Response (200):
{
"success": true,
"announcement": {
"id": 1,
"app_id": "anymex",
"title": "New Feature Release",
"short_description": "We've added a new feature...",
"full_content": "# Full markdown content here...",
"author_id": "dev123",
"author_name": "Dev Team",
"category": "feature",
"priority": 10,
"status": "published",
"pinned": true,
"featured": false,
"published_at": "2024-01-15T10:00:00Z",
"expires_at": null,
"view_count": 151,
"is_read": false
}
}Method: GET
Auth: Not required
Example:
GET /announcements/unread-count?user_id=12345&app_id=anymex
Response (200):
{
"success": true,
"total_published": 45,
"read_count": 40,
"unread_count": 5
}Method: POST
Auth: β Token required (owner/super_admin only)
{
"client_type": "anilist",
"access_token": "admin_oauth_token",
"app_id": "anymex",
"title": "New Feature Release",
"short_description": "We've added a new feature...",
"full_content": "# Full markdown content here...",
"category": "feature",
"priority": 10,
"pinned": false,
"featured": false,
"expires_at": null,
"publish": true
}Response (201):
{
"success": true,
"announcement": { /* announcement object */ },
"message": "Announcement published successfully"
}Method: PATCH
Auth: β Token required (owner/super_admin only)
PATCH /announcements/1
{
"client_type": "anilist",
"access_token": "admin_oauth_token",
"title": "Updated Title",
"priority": 20,
"pinned": true
}Method: DELETE
Auth: β Token required (owner/super_admin only)
DELETE /announcements/1
{
"client_type": "anilist",
"access_token": "admin_oauth_token"
}Method: POST
Auth: β Token required (owner/super_admin only)
POST /announcements/1/publish
{
"client_type": "anilist",
"access_token": "admin_oauth_token"
}Note: Publishing sends a Discord notification to the configured channel.
Method: POST
Auth: β Token required (owner/super_admin only)
POST /announcements/1/archive
{
"client_type": "anilist",
"access_token": "admin_oauth_token"
}Method: POST
Auth: Not required
POST /announcements/1/view
{
"user_id": "12345",
"app_id": "anymex"
}Method: POST
Auth: Not required
POST /announcements/1/read
{
"user_id": "12345",
"app_id": "anymex"
}{
"error": "Error description"
}| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized (invalid/expired token) |
| 403 | Forbidden (insufficient permissions) |
| 404 | Not Found |
| 429 | Rate Limited |
| 500 | Internal Server Error |
| 503 | Service Unavailable |
- Client sends:
client_type+access_token - Backend verifies: Calls provider API
- Provider returns:
provider_user_id,username,avatar_url - Backend checks: Role from database
- Action executed: If role is sufficient
| Action | Endpoint | Auth | Min Role |
|---|---|---|---|
| create | /comments | user_info | user |
| edit | /comments | user_info (owner) | user |
| delete | /comments | user_info (owner) | user |
| mod_delete | /comments | token | moderator |
| vote | /votes | user_info | user |
| create_report | /reports | user_info | user |
| resolve_report | /reports | token | moderator |
| get_queue | /reports | token | moderator |
| pin/unpin | /moderation | token | moderator |
| lock/unlock | /moderation | token | moderator |
| warn_user | /moderation | token | moderator |
| ban_user | /moderation | token | admin |
| unban_user | /moderation | token | admin |
| get_queue | /moderation | token | moderator |
| get_user_* | /users | token | moderator |
| warn_user | /users | token | moderator |
| mute_user | /users | token | moderator |
| ban_user | /users | token | admin |
| unban_user | /users | token | admin |
| get_media | /media | none | - |
| list_announcements | /announcements | none | - |
| get_announcement | /announcements/:id | none | - |
| get_unread_count | /announcements/unread-count | none | - |
| mark_viewed | /announcements/:id/view | none | - |
| mark_read | /announcements/:id/read | none | - |
| create_announcement | /announcements | token | super_admin |
| update_announcement | /announcements/:id | token | super_admin |
| delete_announcement | /announcements/:id | token | super_admin |
| publish_announcement | /announcements/:id/publish | token | super_admin |
| archive_announcement | /announcements/:id/archive | token | super_admin |
Ready to integrate? Start with the Quick Start Guide! π