AIGCS

API Reference

Complete API endpoint reference

Overview

All API endpoints return JSON responses.

Base URL

http://your-server:41905/api

Response Format

{
  "code": 200,
  "data": { ... }
}

Error responses:

{
  "code": 401,
  "message": "Unauthorized"
}

Authentication

MethodHeader
JWTAuthorization: Bearer <token>
API TokenAuthorization: Bearer <token>
CSRF (admin)X-Requested-With: XMLHttpRequest

Public Endpoints

MethodPathDescription
GET/api/healthHealth check → { status: 200 }
GET/widget.jsWidget JS bundle
GET/api/avatar-proxy?url=Proxy and cache external avatars

Auth Endpoints (/api/auth)

MethodPathAuthDescription
POST/registerRegister new user
POST/loginLogin by email or username
POST/totp/verifyComplete TOTP step-up
GET/meBearerGet current user profile
PUT/meBearerUpdate profile
POST/change-passwordBearerChange password
POST/refreshRefresh access token
POST/avatarBearerUpload avatar (max 2MB)
DELETE/avatarBearerRemove avatar
GET/avatar/:userIdServe avatar image
POST/totp/setupBearerGenerate TOTP secret + QR
POST/totp/enableBearerEnable TOTP
POST/totp/disableBearerDisable TOTP

Widget Endpoints (/api/widget)

MethodPathDescription
GET/:domain/comments?path=Get page comments
POST/:domain/reactToggle reaction
POST/:domain/commentSubmit visitor comment
PUT/:domain/comment/:idEdit visitor comment
DELETE/:domain/comment/:idDelete visitor comment
POST/:domain/comment/:id/request-deleteRequest deletion code
POST/:domain/comment/:id/verify-deleteVerify and delete
POST/:domain/ping/:type/:tokenPing webhook receiver

Admin Endpoints (/api/admin)

All require Authorization: Bearer <token> + X-Requested-With: XMLHttpRequest.

Sites

MethodPathDescription
GET/sitesList user's sites
POST/sitesCreate site
GET/sites/:idGet site
PUT/sites/:idUpdate site
DELETE/sites/:idDelete site

Providers

MethodPathDescription
GET/sites/:siteId/providersList providers
POST/sites/:siteId/providersCreate provider
PATCH/sites/:siteId/providers/:idUpdate provider
DELETE/sites/:siteId/providers/:idDelete provider
POST/sites/:siteId/providers/:id/testTest provider
GET/builtin-providersList built-in providers
GET/provider-defaultsGet provider defaults
PUT/provider-defaultsSave provider default

Cache & Comments

MethodPathDescription
GET/sites/:siteId/cacheList page cache
POST/sites/:siteId/cache/clearClear cache
POST/sites/:siteId/cache/warmWarm cache
POST/sites/:siteId/cache/generateGenerate comments
GET/sites/:siteId/commentsList comments

Prompts

MethodPathDescription
GET/promptsList prompt templates
POST/promptsCreate prompt
DELETE/prompts/:idDelete prompt
POST/prompts/importImport from GitHub URL

Webhooks

MethodPathDescription
GET/sites/:siteId/webhooksList webhooks
POST/sites/:siteId/webhooksCreate webhook
PATCH/sites/:siteId/webhooks/:idUpdate webhook
DELETE/sites/:siteId/webhooks/:idDelete webhook

Plugins

MethodPathDescription
GET/pluginsList all plugins
POST/plugins/:name/toggleToggle plugin
DELETE/plugins/:nameUninstall plugin

System

MethodPathAuthDescription
GET/system/configAdminGet system config
PUT/system/configAdminUpdate system config
POST/system/smtp-testAdminSend test email
GET/dashboard/statsBearerDashboard statistics
GET/audit-logBearerAudit log
GET/exportBearerExport JSON data

Mastodon Plugin Endpoints

These are registered dynamically by the Mastodon plugin:

MethodPathDescription
GET.../mastodon/bindingsList bindings
POST.../mastodon/bindingsCreate binding
DELETE.../mastodon/bindings/:idDelete binding
POST.../mastodon/bindings/:id/refreshRefresh comments
POST.../mastodon/test-connectionTest instance
POST.../mastodon/oauth/startStart OAuth flow
POST.../mastodon/publishPost a toot and bind
GET.../mastodon/configGet fedi config
PUT.../mastodon/configUpdate fedi config

Unsubscribe

MethodPathDescription
GET/api/unsubscribe?email=&ctx=&token=Toggle unsubscribe

On this page