Generates a new instance of LemmyHttp.
the base url, without the vX version: https://lemmy.ml -> goes to https://lemmy.ml/api/vX
Optional
options: { Optional
fetchOptional
init: RequestInitOptional
init: RequestInitOptional
headers?: { Private
#apiPrivate
#fetchPrivate
#headersPrivate
#pictrsPrivate
#buildPrivate
#wrapperAdd an admin to your site.
HTTP.POST /admin/add
Add a moderator to your community.
HTTP.POST /community/mod
Approve a registration application
HTTP.PUT /admin/registration_application/approve
Ban a user from a community.
HTTP.POST /community/ban_user
Ban a person from your site.
HTTP.POST /user/ban
Block a community.
HTTP.POST /community/block
Block an instance.
HTTP.Post /site/block
Block a person.
HTTP.POST /user/block
Change your user password.
HTTP.PUT /user/change_password
Create a comment.
HTTP.POST /comment
Report a comment.
HTTP.POST /comment/report
Create a new community.
HTTP.POST /community
Create a new custom emoji
HTTP.POST /custom_emoji
Create a post.
HTTP.POST /post
Report a post.
HTTP.POST /post/report
Create a private message.
HTTP.POST /private_message
Create a report for a private message.
HTTP.POST /private_message/report
Create your site.
HTTP.POST /site
Delete your account.
HTTP.POST /user/delete_account
Delete a comment.
HTTP.POST /comment/delete
Delete a community.
HTTP.POST /community/delete
Delete a custom emoji
HTTP.Post /custom_emoji/delete
Delete a pictrs image
Delete a post.
HTTP.POST /post/delete
Delete a private message.
HTTP.POST /private_message/delete
Distinguishes a comment (speak as moderator)
HTTP.POST /comment/distinguish
Edit a comment.
HTTP.PUT /comment
Edit a community.
HTTP.PUT /community
Edit an existing custom emoji
HTTP.PUT /custom_emoji
Edit a post.
HTTP.PUT /post
Edit a private message.
HTTP.PUT /private_message
Edit your site.
HTTP.PUT /site
A moderator can feature a community post ( IE stick it to the top of a community ).
HTTP.POST /post/feature
Follow / subscribe to a community.
HTTP.POST /community/follow
Generate a TOTP / two-factor secret.
Afterwards you need to call /user/totp/update
with a valid token to enable it.
HTTP.POST /user/totp/generate
Get a list of banned users
HTTP.GET /user/banned
Fetch a Captcha.
HTTP.GET /user/get_captcha
Get / fetch comment.
HTTP.GET /comment
Get / fetch comments.
HTTP.GET /comment/list
Get / fetch a community.
HTTP.GET /community
Fetch federated instances.
HTTP.Get /federated_instances
Get the modlog.
HTTP.GET /modlog
Get the details for a person.
HTTP.GET /user
Get mentions for your user.
HTTP.GET /user/mention
Get / fetch a post.
HTTP.GET /post
Get / fetch posts, with various filters.
HTTP.GET /post/list
Get / fetch private messages.
HTTP.GET /private_message/list
Get the application a user submitted when they first registered their account
HTTP.GET /admin/registration_application
Get comment replies.
HTTP.GET /user/replies
Get counts for your reports
HTTP.GET /user/report_count
Gets the site, and your user data.
HTTP.GET /site
Fetch metadata for any given site.
HTTP.GET /post/site_metadata
Get your unread counts
HTTP.GET /user/unread_count
Get the unread registration applications count.
HTTP.GET /admin/registration_application/count
Hide a community from public / "All" view. Admins only.
HTTP.PUT /community/hide
Hide a post from list views.
HTTP.POST /post/hide
Import a backup of your user settings.
HTTP.POST /user/import_settings
Leave the Site admins.
HTTP.POST /user/leave_admin
Like / vote on a comment.
HTTP.POST /comment/like
Like / vote on a post.
HTTP.POST /post/like
List all the media known to your instance.
HTTP.GET /admin/list_all_media
List a comment's likes. Admin-only.
HTTP.GET /comment/like/list
List comment reports.
HTTP.GET /comment/report/list
List communities, with various filters.
HTTP.GET /community/list
List login tokens for your user
HTTP.GET /user/list_logins
List all the media for your user
HTTP.GET /account/list_media
List a post's likes. Admin-only.
HTTP.GET /post/like/list
List post reports.
HTTP.GET /post/report/list
List private message reports.
HTTP.GET /private_message/report/list
List the registration applications.
HTTP.GET /admin/registration_application/list
A moderator can lock a post ( IE disable new comments ).
HTTP.POST /post/lock
Log into lemmy.
HTTP.POST /user/login
Invalidate the currently used auth token.
HTTP.POST /user/logout
Mark all replies as read.
HTTP.POST /user/mark_all_as_read
Mark a comment as read.
HTTP.POST /comment/mark_as_read
Mark a person mention as read.
HTTP.POST /user/mention/mark_as_read
Mark a post as read.
HTTP.POST /post/mark_as_read
Mark a private message as read.
HTTP.POST /private_message/mark_as_read
Change your password from an email / token based reset.
HTTP.POST /user/password_change
Reset your password.
HTTP.POST /user/password_reset
Purge / Delete a comment from the database.
HTTP.POST /admin/purge/comment
Purge / Delete a community from the database.
HTTP.POST /admin/purge/community
Purge / Delete a person from the database.
HTTP.POST /admin/purge/person
Purge / Delete a post from the database.
HTTP.POST /admin/purge/post
Register a new user.
HTTP.POST /user/register
A moderator remove for a comment.
HTTP.POST /comment/remove
A moderator remove for a community.
HTTP.POST /community/remove
A moderator remove for a post.
HTTP.POST /post/remove
Resolve a comment report. Only a mod can do this.
HTTP.PUT /comment/report/resolve
Fetch a non-local / federated object.
HTTP.GET /resolve_object
Resolve a post report. Only a mod can do this.
HTTP.PUT /post/report/resolve
Resolve a report for a private message.
HTTP.PUT /private_message/report/resolve
Save a comment.
HTTP.PUT /comment/save
Save a post.
HTTP.PUT /post/save
Save your user settings.
HTTP.PUT /user/save_user_settings
Search lemmy.
HTTP.GET /search
Transfer your community to an existing moderator.
HTTP.POST /community/transfer
Enable / Disable TOTP / two-factor authentication.
To enable, you need to first call /user/totp/generate
and then pass a valid token to this.
Disabling is only possible if 2FA was previously enabled. Again it is necessary to pass a valid token.
HTTP.POST /user/totp/update
Upload an image to the server.
Returns an error message if your auth token is invalid
HTTP.GET /user/validate_auth
Verify your email
HTTP.POST /user/verify_email
Helps build lemmy HTTP requests.