API
Authentication
A request is authenticated in one of three ways:
- the
JWTcookie set at login, with theX-XSRF-TOKENheader carrying the value of theXSRF-TOKENcookie. An expired cookie token is renewed. A widget framed by another site over HTTPS sendsX-Remark42-Partitioned-Cookie: 1with its requests, and when it uses a session of its own, the session's cookies are__Host-JWT-EMBEDDEDand__Host-XSRF-TOKEN-EMBEDDED, used in the same way; - the token in the
X-JWTheader, with no XSRF header; a token in thejwtquery parameter is ignored. A header token must not be expired, and it takes precedence over the cookie, so a request carrying one does not renew the cookie session. WithAUTH_SEND_JWT_HEADERset, a response that issues or renews a token carries it in theX-JWTheader, which the built-in CORS policy does not expose to cross-origin scripts. A response served from the session of a widget framed by another site, which lives in that widget's own cookies, carries none; - Basic auth as user
adminwith theADMIN_PASSWDpassword, which makes the request an admin of every site.
Calls marked auth required and all admin calls need site in the query, and it has to be the site the user signed in to; otherwise the answer is 403. Basic-auth requests are exempt from this check. Under /api/v1, a Basic-auth request that the browser marks as cross-site, or that carries an Origin other than the REMARK_URL origin, is rejected with 403.
Anonymous users get 403 from the email and Telegram subscription calls, POST /api/v1/deleteme and POST /api/v1/picture, and from PUT /api/v1/vote/{id} unless both ANON_VOTE and VOTES_IP are set.
With SUBSCRIBERS_ONLY set, creating, editing and previewing comments, voting, uploading a picture, POST /api/v1/deleteme and the email and Telegram subscription calls get 403 for anyone who is not a paid Patreon subscriber, the Basic-auth admin included. The paid status counts for two weeks from the sign-in with Patreon.
Errors and limits
Requests are rate-limited per client address and URL path, so that, for example, each comment ID has its own counter. The limits are not part of the API and can change between releases. At present, in requests per second, they are:
- 2 under
/auth/, except 20 onGET /auth/status; - 10 on the open
/api/v1calls, except 20 onGET /api/v1/configandGET /api/v1/find; - 20 on
GET /api/v1/user, and 10 onGET /api/v1/userdataandGET /api/v1/email; - 10 on
/api/v1/img,/api/v1/picture/{user}/{id}and/api/v1/qr/telegram, and on the admin calls; UPDATE_LIMIT(0.5 by default, 10 when it is 0) on the other calls that need auth: comment changes, preview, votes, picture upload, email and Telegram subscription, andPOST /api/v1/deleteme;- 100 on avatars, 50 on
/robots.txt,/email/unsubscribe.html,/email/subscribe.htmland/email/login.html, and 20 on/web/.
A request over the limit gets 429 with a plain-text body.
Request bodies are limited to 64 KiB for comment creation, editing and preview and for email subscription and confirmation, to 128 KiB for POST /api/v1/counts, to 32 MiB for a picture upload and to 256 MiB for POST /api/v1/admin/import/form.
Most /api/v1 handlers report an error with an HTTP status and a JSON body, {"error": "error text", "details": "what failed", "code": 4}. Avatar errors carry only error, and a GET /api/v1/admin/wait timeout carries status and site_id. Rejections by the authentication, admin, site and anonymous-user checks have a plain-text body, and a request that runs out of its time limit gets 504 with an empty body. The code values are:
const (
ErrInternal = 0 // any internal error
ErrCommentNotFound = 1 // can't find comment
ErrDecode = 2 // failed to unmarshal incoming request
ErrNoAccess = 3 // rejected by auth
ErrCommentValidation = 4 // validation failed
ErrPostNotFound = 5 // can't find post
ErrSiteNotFound = 6 // can't find site
ErrUserBlocked = 7 // user blocked
ErrReadOnly = 8 // write failed on read only
ErrCommentRejected = 9 // general error on rejected comment change
ErrCommentEditExpired = 10 // too late for edit
ErrCommentEditChanged = 11 // parent comment cannot be changed
ErrVoteRejected = 12 // general error on vote rejected
ErrVoteSelf = 13 // vote for own comment
ErrVoteDbl = 14 // already voted for the comment
ErrVoteMax = 15 // too many votes for the comment
ErrVoteMinScore = 16 // min score reached for the comment
ErrActionRejected = 17 // general error for rejected actions
ErrAssetNotFound = 18 // requested file not found
ErrCommentRestrictWords = 19 // restricted words in a comment
ErrImgNotFound = 20 // posted image not found in the storage
)
Authorization
GET /auth/{provider}/login?from=http://url&site=site_id&session=1- perform "social" login with one of supported providers and redirect tourl. The host ofurlhas to be theREMARK_URLhost (any port) or one ofALLOWED_HOSTS, where entries with*do not count; for another host, the login completes without the redirect. A non-emptysessionvalue other than0makes the cookies session-only instead of using the default expirationGET /auth/email/login?site=site-id&user=name&address=user@example.org- send a sign-in token to the address, withAUTH_EMAIL_ENABLEset; see email authentication. Returns{"user": "name", "address": "user@example.org"}. The address has to be a bare one: with a display name, a comment, a group, a quoted local part, a second address or spaces around it the call gets 403.GET /auth/email/login?token=tokenthen signs the user in, within 30 minutes; a token used once gets 403GET /email/login.html?tkn=token- the page the sign-in link in the login email opens, answers with an HTML page.GETshows whom the link signs in, andPOSTwith the same query signs in the browser that sends it. The link works once, within 30 minutes, and leaves the token to paste validGET /auth/telegram/login?site=site-id- start Telegram sign-in, withAUTH_TELEGRAMset. Returns{"token": "token", "bot": "bot-name"}; the user sends/start tokento the bot.GET /auth/telegram/login?site=site-id&token=tokenthen signs the user in. Both steps have to finish within 10 minutes; the call answers 404 while the bot has no message, and for an unknown, expired or already used tokenGET /auth/anonymous/login?user=name&aud=site-id- sign in anonymously, withAUTH_ANONset. The authorization page describes the accepted namesGET /auth/user- the signed-in user as stored in the token, 401 without a valid token or for a session the server refuses, such as a blocked user's. Admin Basic credentials, accepted whenADMIN_PASSWDis set, take precedence over the token and return the admin userGET /auth/status- returns{"status": "logged in", "user": "name"}or{"status": "not logged in"}, with the same checks as/auth/userGET /auth/list- list of enabled providersGET /auth/logout- logout
The authentication handler answers no other path under /auth/ and returns 404 for it, apart from /auth/{provider}/callback, where a provider sends the user back, and /auth/{provider}/logout of a registered provider, which signs out as /auth/logout does. Paths under /auth/handoff/ are internal to the widget framed by another site, which uses them to bring a sign-in made in a popup into its own cookies.
Commenting
POST /api/v1/comment?site=site-id- add a comment, auth required. A reply setspidto the ID of the comment it answers, which must be a comment on the same post; otherwise the request is rejected with status 400. Replies are limited to 500 levels below a top-level comment, and a deeper reply is rejected with status 400. The body carries Markdown intext, the post'slocator, and optionallypidandtitle; the server sets the other fields itself,origincluded. Except for the Basic-auth admin,locator.sitehas to be the user's site. Returns status 201 with the storedComment. A blocked user or a read-only post gets 403. The text gets 400 when it is empty, when its length in Unicode code points is outsideMIN_COMMENT_SIZEandMAX_COMMENT_SIZE(2048 when that is 0 or less), or when a non-empty Markdown link or image destination does not start withhttp://,https://ormailto:. WithIMAGE_DISABLEset, images are removed from the text, and a text left with nothing but empty markup gets 400
type Comment struct {
ID string `json:"id"` // comment ID, read only
ParentID string `json:"pid"` // parent ID
Text string `json:"text"` // comment text, after md processing
Orig string `json:"orig,omitempty"` // original comment text in Markdown, should never be rendered as HTML as-is!
User User `json:"user"` // user info, read only
Locator Locator `json:"locator"` // post locator
Score int `json:"score"` // comment score, read only
Vote int `json:"vote"` // vote for the current user, -1/1/0
Controversy float64 `json:"controversy,omitempty"` // comment controversy, read only
Timestamp time.Time `json:"time"` // time stamp, read only
Edit *Edit `json:"edit,omitempty"` // pointer to have empty default in JSON response
Pin bool `json:"pin,omitempty"` // pinned status, read only
Deleted bool `json:"delete,omitempty"` // delete status, read only
Imported bool `json:"imported,omitempty"` // imported from a backup, read only
PostTitle string `json:"title,omitempty"` // post title
PendingApproval bool `json:"pendingApproval"` // held for premoderation, read only
}
type Locator struct {
SiteID string `json:"site,omitempty"` // site ID
URL string `json:"url"` // post URL
}
type Edit struct {
Timestamp time.Time `json:"time"`
Summary string `json:"summary"`
}
POST /api/v1/preview?site=site-id- preview comment in HTML, auth required. Body isCommentto render. The text gets the length, link and stored-picture checks of a new comment, but not the restricted-words check, and the answer is the sanitised HTML. WithIMAGE_DISABLEset, images are removed and a text left with nothing to show gets 400, as on creationGET /api/v1/find?site=site-id&url=post-url&sort=fld&format=tree|plain- find all comments for given post
This call returns the comments of a post. The plain format returns {"comments": [...], "info": {...}}, the sorted Comment list and the post's PostInfo. With format=tree, it returns this structure:
type treeWithInfo struct {
*service.Tree
Info store.PostInfo `json:"info"`
}
type Tree struct {
Nodes []*Node `json:"comments"`
}
type Node struct {
Comment store.Comment `json:"comment"`
Replies []*Node `json:"replies,omitempty"`
}
Sort can be time, active, score or controversy. Supported sort order with prefix -/+, i.e., -time. For tree mode, the sort will be applied to top-level comments only, and all replies are always sorted by time.
The call takes more optional parameters:
view=userfills onlyidanduserof each comment that is not deleted; the other fields keep zero values, so in thetreeformat every comment becomes a top-level node.since(epoch time, milliseconds) returns only newer comments, andinfo.countthen counts the matching comments that are neither deleted nor held for premoderation, before paging. Thetreeformat ignores it.limit, when positive, returns the firstlimitcomments; thetreeformat returns whole top-level threads, and always at least one.info.count_leftis the number of comments after the page, deleted placeholders the result keeps included, andinfo.last_commentis the ID of the last returned comment, top-level in thetreeformat.offset_idreturns the comments after the one with this ID, soinfo.last_commentpassed asoffset_idgives the next page. An ID not in the result starts from the beginning, and thetreeformat matches top-level comments only.
In the tree format, the first page of a request with limit (no offset_id) also carries pinned when more pages follow (info.count_left above zero) and the post has pinned comments that are not deleted: those comments, oldest first, wherever their pages are. A first page that holds the whole thread leaves it out, as its pins are in the tree.
Without url, the call returns up to 1000 latest comments of the site that are not deleted.
PUT /api/v1/comment/{id}?site=site-id&url=post-url- edit or delete own comment, auth required, any number of times withinEDIT_TIMEsince creation (a duration,5mby default;0refuses every edit and delete) and only while the comment has no reply that is not deleted. WithADMIN_EDITset, an admin edits own comments without these limits. Another user's comment gets 403, and a deleted comment cannot be edited. Body isEditRequestJSON;deleteset deletes the comment. Returns the updatedComment. The new text is checked as a new comment's is: it must not be empty, must fitMIN_COMMENT_SIZEandMAX_COMMENT_SIZE, and the destinations of its Markdown links and images must start withhttp://,https://ormailto:. WithIMAGE_DISABLEset, images are removed from it, and a text left with nothing but empty markup gets 400. A request withdeleteset skips this check, even when it carries text.
type EditRequest struct {
Text string `json:"text"` // updated text
Summary string `json:"summary"` // optional, summary of the edit
Delete bool `json:"delete"` // delete flag
}
GET /api/v1/last/{max}?site=site-id&since=ts-msec- get up to{max}last comments, newest first,since(epoch time, milliseconds) is optional.{max}is 1000 at most, and0means 1000. Deleted comments are left outGET /api/v1/id/{id}?site=site-id&url=post-url- get comment bycomment id.urlis required: the comment is looked up among the post's comments, and withouturlthe answer is 400GET /api/v1/comments?site=site-id&user=id&limit=N&skip=M- get comments byuser id, newest first, returnsuserCommentsobject.limitis 500 at most, and0means 500;skipskips that many comments. Deleted comments are left out of the list and ofcount. Comments held for premoderation are listed, and counted incount, for the user themselves and the site's admins only.
Important: original comment text in Markdown in the orig field should never be rendered as HTML as-is, only text containing HTML is sanitized and safe for render.
type userComments struct {
Comments []store.Comment `json:"comments"`
Count int `json:"count"`
}
GET /api/v1/count?site=site-id&url=post-url- get comment's count for{url}, returns{"count": N, "locator": {"site": "site-id", "url": "post-url"}}POST /api/v1/counts?site=site-id- get number of comments for posts from post body, a JSON array of post URLs of 128 KB at most. Returns an array ofPostInfowithurlandcount; a URL that cannot be counted is left outGET /api/v1/list?site=site-id&limit=5&skip=2- list commented posts, returns array ofPostInfo, limit=0 will return all posts
type PostInfo struct {
URL string `json:"url,omitempty"`
Count int `json:"count"`
CountLeft int `json:"count_left"` // used only with returning search results limited by number, otherwise zero
LastComment string `json:"last_comment,omitempty"` // used only with returning search results limited by number
ReadOnly bool `json:"read_only,omitempty"`
FirstTS time.Time `json:"first_time"`
LastTS time.Time `json:"last_time"`
}
GET /api/v1/user?site=site-id- get user info, auth required
type User struct {
Name string `json:"name"`
ID string `json:"id"`
Picture string `json:"picture"`
IP string `json:"ip,omitempty"` // hashed client IP, in comments shown to site admins only
Admin bool `json:"admin"`
Blocked bool `json:"block,omitempty"`
Verified bool `json:"verified,omitempty"`
EmailSubscription bool `json:"email_subscription,omitempty"`
SiteID string `json:"site_id,omitempty"`
PaidSub bool `json:"paid_sub,omitempty"` // is paid Patreon subscriber
}
PUT /api/v1/vote/{id}?site=site-id&url=post-url&vote=1- vote for comment, auth required.vote=1increases the score, and any other value, a missing one included, decreases it. A vote opposite to the user's earlier one cancels it, and a second one casts the opposite vote. Returns{"id": "comment-id", "score": N}. A vote for one's own comment, a repeated vote in the same direction, and a vote refused byMAX_VOTES,POSITIVE_SCOREorVOTES_IPget 400; a blocked user or a read-only post gets 403GET /api/v1/userdata?site=site-id- export user data to gz stream, auth required. The document is{"info": {...}, "details": {...}, "comments": [...]}: user info, notification email and Telegram (detailsis left out when neither is stored), and up to 10,000 of the user's comments, newest first, the ones held for premoderation included. Deleted comments are left outPOST /api/v1/deleteme?site=site-id- request deletion of user data, auth required. The call deletes nothing itself. It returns{"site": "site-id", "user_id": "user-id", "token": "token", "link": "url"}, and the data is deleted when an admin openslinkwithin three monthsGET /api/v1/config?site=site-id- returns configuration (parameters) for given site.edit_durationis in seconds,premoderationreports whether comments can be held for approval, andimage_disabledwhetherIMAGE_DISABLErefuses images
type Config struct {
Version string `json:"version"`
Premoderation bool `json:"premoderation"`
EditDuration int `json:"edit_duration"`
AdminEdit bool `json:"admin_edit"`
MinCommentSize int `json:"min_comment_size"`
MaxCommentSize int `json:"max_comment_size"`
Admins []string `json:"admins"`
AdminEmail string `json:"admin_email"`
Auth []string `json:"auth_providers"`
AnonVote bool `json:"anon_vote"`
LowScore int `json:"low_score"`
CriticalScore int `json:"critical_score"`
PositiveScore bool `json:"positive_score"`
ReadOnlyAge int `json:"readonly_age"`
MaxImageSize int `json:"max_image_size"`
ImageDisabled bool `json:"image_disabled"`
EmailNotifications bool `json:"email_notifications"`
TelegramNotifications bool `json:"telegram_notifications"`
EmojiEnabled bool `json:"emoji_enabled"`
SimpleView bool `json:"simple_view"`
SendJWTHeader bool `json:"send_jwt_header"`
SubscribersOnly bool `json:"subscribers_only"` // enable commenting only for Patreon subscribers
}
GET /api/v1/info?site=site-id&url=post-url- returnsPostInfofor site and URL
Streaming API
Not available
Streaming API supposed to provide server-sent events for post updates as well as a site update:GET /api/v1/stream/info?site=site-id&url=post-url&since=unix_ts_msec- returns stream (event: info) withPostInforecords for the site and URL.sinceis optionalGET /api/v1/stream/last?site=site-id&since=unix_ts_msec- returns updates stream (event: last) with comments for the site,sinceis optional
It was removed in https://github.com/umputun/remark42/pull/826 due to not being used and affecting tests flakiness and could be returned if there will be a developer who would be willing to write frontend support for it.
Response example of /stream/info:
data: {"url":"https://radio-t.com/blah1","count":2,"first_time":"2019-06-18T12:53:48.125686-05:00","last_time":"2019-06-18T12:53:48.142872-05:00"}
event: info
data: {"url":"https://radio-t.com/blah1","count":3,"first_time":"2019-06-18T12:53:48.125686-05:00","last_time":"2019-06-18T12:53:48.157709-05:00"}
event: info
data: {"url":"https://radio-t.com/blah1","count":4,"first_time":"2019-06-18T12:53:48.125686-05:00","last_time":"2019-06-18T12:53:48.172991-05:00"}
event: info
data: {"url":"https://radio-t.com/blah1","count":5,"first_time":"2019-06-18T12:53:48.125686-05:00","last_time":"2019-06-18T12:53:48.188429-05:00"}
event: info
data: {"url":"https://radio-t.com/blah1","count":6,"first_time":"2019-06-18T12:53:48.125686-05:00","last_time":"2019-06-18T12:53:48.204742-05:00"}
event: info
data: {"url":"https://radio-t.com/blah1","count":7,"first_time":"2019-06-18T12:53:48.125686-05:00","last_time":"2019-06-18T12:53:48.220692-05:00"}
event: info
data: {"url":"https://radio-t.com/blah1","count":8,"first_time":"2019-06-18T12:53:48.125686-05:00","last_time":"2019-06-18T12:53:48.23817-05:00"}
event: info
data: {"url":"https://radio-t.com/blah1","count":9,"first_time":"2019-06-18T12:53:48.125686-05:00","last_time":"2019-06-18T12:53:48.254669-05:00"}
RSS Feeds
GET /api/v1/rss/post?site=site-id&url=post-url- RSS feed for a postGET /api/v1/rss/site?site=site-id- RSS feed for given siteGET /api/v1/rss/reply?site=site-id&user=user-id- RSS feed for replies to user's comments
Images Management
GET /api/v1/picture/{user}/{id}- load stored image. A malformed or unknown ID gets 400, and stored content that is not an image gets 415POST /api/v1/picture?site=site-id- upload and store image, uses post form withFormFile("file"). Returns{"id": "user/imgid"}, auth required. Accepts GIF, JPEG, PNG and WebP. A file larger thanIMAGE_MAX_SIZEbytes, reported asmax_image_sizein/api/v1/config, a file in another format, a malformed image or one over 16,777,216 pixels is rejected with 400; a form that cannot be parsed, a request over 32 MiB included, gets 500. WithIMAGE_DISABLEset, every upload gets 403
returned ID should be appended to load image URL on the caller side
GET /api/v1/img?src=encoded-url&sig=signature- load an external image through the server;srcis the image URL in URL-safe base64 with padding, andsigis the signature the server adds to the image URLs in the comments and previews it returns. A preview's URLs also carryexp, the time their signature expires. A request without a valid signature gets 403GET /api/v1/avatar/{id}- load a user's avatar, also served as/avatar/{id}
Email Subscription
GET /api/v1/email?site=site-id- get user's email, auth requiredPOST /api/v1/email/subscribe?site=site-id- makes confirmation token and sends it to the user over email, auth required. Body is{"address": "user@example.org"}. The address has to be a bare one, as for the email sign-in, except that spaces around it are dropped, and it must not have?or#in it, which the notification mailer does not take; otherwise the call gets 400. The token is valid for 30 minutes. A user signed in by email with the same address is subscribed at once, and the answer carries"updated": true. The older form sends an empty body andaddressin the query, and always sends the tokenTrying to subscribe to the same email a second time will return response code
409 Conflictwith explaining error messagePOST /api/v1/email/confirm?site=site-id- uses the token from the body,{"token": "token"}, to set email for the user, auth required. The older form sends an empty body andtknin the queryWith email notifications configured, a user with an email set is notified about every reply in the threads under their comments, at any depth, except their own replies
DELETE /api/v1/email?site=site-id- removes user's email, auth requiredGET /email/subscribe.html?tkn=token- the page the link in the subscription confirmation email opens, answers with an HTML page.GETshows the confirmation button, andPOSTwith the same query sets the address, within 30 minutesGET /email/unsubscribe.html?site=site-id&tkn=token- unsubscribe from the link in a notification email, answers with an HTML page.POSTwith the same query does the same
Telegram Subscription
GET /api/v1/telegram/subscribe?site=site-id- start a subscription to notifications over Telegram, auth required. Returns{"token": "token", "bot": "bot-name"}; the user sends/start tokento the bot. A user who already has a subscription gets 409, and a server without Telegram notifications answers 500GET /api/v1/telegram/subscribe?site=site-id&tkn=token- complete the subscription, auth required, as the user who started it and within 10 minutes of the first call. Returns{"updated": true}. 404 means the bot has no message yet, the token is unknown, expired or already used, or another user sent the requestDELETE /api/v1/telegram?site=site-id- removes user's Telegram subscription, auth requiredGET /api/v1/qr/telegram?url=https://t.me/...- PNG with the QR code of ahttps://t.me/link, used for Telegram sign-in and subscription
Admin
DELETE /api/v1/admin/comment/{id}?site=site-id&url=post-url- delete comment byidPUT /api/v1/admin/user/{userid}?site=site-id&block=1&ttl=168h- block (block=1) or unblock (any other value) a user.ttlis optional and uses Go duration syntax with units up to hours (30m,24h,168hfor a week); there is no day unit. Withoutttl, or withttl=0, the block is permanent, and a permanent block also deletes all comments of the user. Attlthat does not parse, such as7d, or is negative is rejected with status 400 and changes nothing. Returns{"user_id": "...", "site_id": "...", "block": true}.GET /api/v1/admin/blocked?site=site-id- list of blocked users
type BlockedUser struct {
ID string `json:"id"`
Name string `json:"name"`
Until time.Time `json:"time"`
}
GET /api/v1/admin/export?site=site-id&mode=[stream|file]- export all comments to JSON stream or gz filePOST /api/v1/admin/import?site=site-id&provider=native- import comments from the backup, uses post body.providerisnative(the default when omitted),disqus,wordpressorcommento; any other value is rejected with 400.remarkis accepted asnative. Returns 202 once the upload is saved and runs the import in the background; while another import or remap runs on the site, the answer is 409. A native backup of another site is refused with 400 before anything is changed, and so is one whose metadata line names no site and whose first comment can't be read for onePOST /api/v1/admin/import/form?site=site-id&provider=native- import comments from the backup sent asmultipart/form-datain the part namedfile,providerand responses as abovePOST /api/v1/admin/remap?site=site-id- remap comments to different URLs. Expect a list of "from-url new-url" pairs separated by \n. From-url and new-url parts are separated by space. If URLs end with an asterisk (*), it means matching the prefix. Remap procedure based on export/import chain so make the backup first
http://oldsite.com* https://newsite.com*
http://oldsite.com/from-old-page/1 https://newsite.com/to-new-page/1
GET /api/v1/admin/wait?site=site-id&timeout=15m- wait for completion for any async migration ops (import or remap).timeoutis a Go duration,15mby default; when it runs out, the answer is 504."status": "completed"means the operation has stopped, not that it succeeded; failures are reported in the server logPUT /api/v1/admin/pin/{id}?site=site-id&url=post-url&pin=1- pin (pin=1) or unpin (any other value) commentPUT /api/v1/admin/comment/{id}/approve?site=site-id&url=post-url&approved=1- approve (approved=1) or reject (any other value) a comment held for premoderation. UnderPREMODERATION=first, approving a held comment also releases the author's other held comments. A deleted comment is left as it is. WithPREMODERATION=nonea rejection gets 400 and changes nothing, while an approval is accepted, for a comment held before premoderation was turned off. Returns{"id": "...", "locator": {"site": "...", "url": "..."}, "approved": true}GET /api/v1/admin/user/{userid}?site=site-id- get user's info, taken from the user's latest comment that is not deleted; a user without one gets 400DELETE /api/v1/admin/user/{userid}?site=site-id- delete the user's comments and stored details; succeeds even if the user has no comments or is already absent. The comments stay as deleted placeholders without the text and the user's name. The pictures the user uploaded that the user's comments show are removed too, except those that another user's comment on the same posts shows. The avatar is kept, since every site of the instance shares itPUT /api/v1/admin/readonly?site=site-id&url=post-url&ro=1- set (ro=1) or clear (any other value) read-only status. A post that is read-only byREADONLY_AGEcannot be cleared and gets 403PUT /api/v1/admin/verify/{userid}?site=site-id&verified=1- set (verified=1) or clear (any other value) verified statusPUT /api/v1/admin/title/{id}?site=site-id&url=post-url- set the comment'stitleto the title of the post pageGET /api/v1/admin/deleteme?site=site-id&token=token- process a user's deleteme request; a token older than three months gets 403, and already-deleted or dataless users return success (idempotent). Removes the comments, stored details and pictures asDELETE /api/v1/admin/user/{userid}does, and the avatar named in the token
all admin calls require auth and admin privilege
Other
GET /ping- returnspongGET /robots.txt- rules for crawlers