Darflen API Documentation

This documentation provides information about all API endpoints found in Darflen's source code. If there are any missing endpoints or incorrect information, please let me know.

Base URL

The base URL for all endpoints on this page is https://api.darflen.com. All paths on this page are for this URL.

Note on Request Body Format: The server expects the body of all requests as formdata (multipart/form-data). Also note that if there are any fields in a request that end in [], you can provide multiple of that field.
Authentication: All API requests that require authentication need a token obtained from the login endpoint. This token must be provided as a Bearer token in the Authorization header, e.g., Authorization: Bearer YOUR_AUTH_TOKEN. Additionally, for POST requests, a CSRF token (retrieved from the /data endpoint or implicitly handled by session cookies) is expected to be sent as a form field named csrf_token.

General Endpoints

POST /activity

Record User is Online

Sends a ping to the server to indicate active user presence, used for tracking online users.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

GET /search/autocomplete?q=query

Search Autocomplete

Provides autocomplete suggestions based on the search query.

Query Parameters:

Request Headers:

None.

Request Body:

None.

GET /search?q=query&p=x

Perform Search

Executes a search for posts based on the query.

Query Parameters:

Request Headers:

None.

Request Body:

None.

GET /search/render?q=query&p=x

Render Search Results

Retrieves rendered HTML for search results, suitable for direct insertion into the DOM.

Query Parameters:

Request Headers:

None.

Request Body:

None.

Authentication & User Endpoints

POST /auth/login

User Login

Authenticates a user and provides an authentication token for subsequent requests.

Request Headers:

Content-Type: multipart/form-data

Request Body:

POST /auth/register

User Registration

Registers a new user account.

Request Headers:

Content-Type: multipart/form-data

Request Body:

POST /auth/logout

Logout Current Session

Logs out the current authenticated session.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /auth/logout/device

Logout Specific Device Session

Logs out a specific device session associated with the user's account.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /auth/logout/devices

Logout All Device Sessions

Logs out the user from all active device sessions.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /auth/username/change

Change Username

Allows a logged-in user to change their username.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /auth/password/change

Change Password

Allows a logged-in user to change their password.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /auth/email/change

Change Email

Allows a logged-in user to change their email address.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /auth/email/verify

Verify Email

Sends a verification email to the user's email address.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /auth/password/forgot/start

Initiate Forgot Password

Sends a password reset link or code to the user's email.

Request Headers:

Content-Type: multipart/form-data

Request Body:

POST /auth/tokens/TOKEN_ID/discard

Discard Authentication Token

Invalidates a specific authentication token, effectively logging out that session. Can only be used by admins.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

User Endpoints

GET /users/USERNAME

Get User Profile

Retrieves detailed profile information for a specific user.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /users/USERNAME/followers

Get User Followers

Retrieves a list of users who are following the specified user.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /users/USERNAME/following

Get User Following

Retrieves a list of users that the specified user is following.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /users/USERNAME/posts

Get User Posts

Retrieves a list of posts created by the specified user.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /users/USERNAME/communities

Get User Communities

Retrieves a list of communities the specified user is a member of.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /users/USERNAME/loves

Get User Loves

Retrieves a list of users that have loved the specified user's content.

Path Parameters:

Request Headers:

None.

Request Body:

None.

POST /users/USERNAME/follow

Follow/Unfollow User

Toggles the follow status for a specified user.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /users/USERNAME/block

Block/Unblock User

Toggles the block status for a specified user.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /users/USER_ID/report

Report User

Submits a report against a specified user.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

Post Endpoints

POST /posts/create

Create Post

Creates a new post. Can include text, files, and poll options.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

GET /posts/POST_ID/render

Render Post

Retrieves the rendered HTML content of a specific post.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /posts/POST_ID

Get Post Details

Retrieves detailed information about a specific post.

Path Parameters:

Request Headers:

None.

Request Body:

None.

POST /posts/POST_ID/edit

Edit Post

Modifies the content and/or media of an existing post.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /posts/POST_ID/repost

Repost Content

Reposts a specific post, optionally adding text, files, or associating with a community.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /posts/POST_ID/report

Report Post

Submits a report against a specified post.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /posts/POST_ID/love

Love/Unlove Post

Toggles the love status for a specified post.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /posts/POST_ID/pin

Pin/Unpin Post

Toggles the pinned status of a post on the logged in user's profile.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /posts/POST_ID/delete

Delete Post

Deletes a specified post.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

GET /posts/POST_ID/reposts

Get Post Reposts

Retrieves a list of reposts associated with a specific post.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /posts/POST_ID/comments

Get Post Comments

Retrieves a list of comments for a specific post.

Path Parameters:

Request Headers:

None.

Request Body:

None.

Comment Endpoints

POST /posts/POST_ID/comment

Create Comment on Post

Adds a new comment to a specified post.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

GET /comments/COMMENT_ID/render

Render Comment

Retrieves the rendered HTML content of a specific comment.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /comments/COMMENT_ID

Get Comment Details

Retrieves detailed information about a specific comment.

Path Parameters:

Request Headers:

None.

Request Body:

None.

POST /comments/COMMENT_ID/edit

Edit Comment

Modifies the content and/or media of an existing comment.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /comments/COMMENT_ID/report

Report Comment

Submits a report against a specified comment.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /comments/COMMENT_ID/love

Love/Unlove Comment

Toggles the love status for a specified comment.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /comments/COMMENT_ID/delete

Delete Comment

Deletes a specified comment.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

GET /comments/COMMENT_ID/replies

Get Comment Replies

Retrieves a list of replies for a specific comment.

Path Parameters:

Request Headers:

None.

Request Body:

None.

POST /comments/COMMENT_ID/reply

Create Reply to Comment

Adds a new reply to a specified comment.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

Reply Endpoints

GET /replies/REPLY_ID/render

Render Reply

Retrieves the rendered HTML content of a specific reply.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /replies/REPLY_ID

Get Reply Details

Retrieves detailed information about a specific reply.

Path Parameters:

Request Headers:

None.

Request Body:

None.

POST /replies/REPLY_ID/edit

Edit Reply

Modifies the content and/or media of an existing reply.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /replies/REPLY_ID/report

Report Reply

Submits a report against a specified reply.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /replies/REPLY_ID/love

Love/Unlove Reply

Toggles the love status for a specified reply.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /replies/REPLY_ID/delete

Delete Reply

Deletes a specified reply.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

Community Endpoints

POST /communities/create

Create Community

Creates a new community.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

GET /communities/COMMUNITY

Get Community Profile

Retrieves detailed profile information for a specific community.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /communities/COMMUNITY/posts

Get Community Posts

Retrieves a list of posts published within a specific community.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /communities/COMMUNITY/loves

Get Community Loves

Retrieves a list of users that have loved posts within a community.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /communities/COMMUNITY/members

Get Community Members

Retrieves a list of members of a specific community.

Path Parameters:

Request Headers:

None.

Request Body:

None.

POST /communities/COMMUNITY/join

Join/Leave Community

Toggles the membership status for the specified community.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /communities/COMMUNITY/report

Report Community

Submits a report against a specified community.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /communities/COMMUNITY/settings/customization

Update Community Customization Settings

Updates the icon, banner, description, and display name of a community.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /communities/COMMUNITY/settings/members/USER/role

Update Community Member Role

Changes the role of a specific member within a community (e.g., from member to moderator).

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /communities/COMMUNITY/settings/visiblility

Update Community Visibility

Changes the visibility setting of a community (e.g., public or private).

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /communities/COMMUNITY/settings/members/USER/kick

Kick Community Member

Removes a user from the community.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /communities/COMMUNITY/settings/members/USER/ban

Ban Community Member

Bans a user from the community, preventing them from rejoining.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /communities/COMMUNITY/settings/members/USER/unban

Unban Community Member

Unbans a user from the community, allowing them to rejoin.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /communities/COMMUNITY/settings/pinned

Set Pinned Post in Community

Sets a specific post as the pinned post for the community.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /communities/COMMUNITY/settings/invite

Invite User to Community

Sends an invitation to a user to join the community.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /communities/COMMUNITY/settings/transfer

Transfer Community Ownership

Transfers the ownership of the community to another user.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /communities/COMMUNITY/settings/links

Update Community External Links

Updates the links associated with a specific community.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

Explore & Feed Endpoints

GET /explore/recent/render/PAGE

Render Recent Explore Content

Retrieves rendered HTML for recent content in the explore section, paginated.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /explore/recent/get/PAGE

Get Recent Explore Content Data

Retrieves structured JSON data for recent content in the explore section, paginated.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /explore/trending/render/PAGE

Render Trending Explore Content

Retrieves rendered HTML for trending content in the explore section, paginated.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /explore/trending/get/PAGE

Get Trending Explore Content Data

Retrieves structured JSON data for trending content in the explore section, paginated.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /explore/loved/render/PAGE

Render Loved Explore Content

Retrieves rendered HTML for most loved content in the explore section, paginated.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /explore/loved/get/PAGE

Get Loved Explore Content Data

Retrieves structured JSON data for most loved content in the explore section, paginated.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /explore/popular/render/PAGE

Render Popular Explore Content

Retrieves rendered HTML for popular content in the explore section, paginated.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /explore/popular/get/PAGE

Get Popular Explore Content Data

Retrieves structured JSON data for popular content in the explore section, paginated.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /feed/render?page=x

Render User Feed

Retrieves rendered HTML for the authenticated user's feed, paginated.

Query Parameters:

Request Headers:

Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

None.

GET /explore/communities/recent/render/PAGE

Render Recent Communities in Explore

Retrieves rendered HTML for recently created communities in the explore section, paginated.

Path Parameters:

Request Headers:

None.

Request Body:

None.

GET /explore/communities/activity/render/PAGE

Render Active Communities in Explore

Retrieves rendered HTML for communities with recent activity in the explore section, paginated.

Path Parameters:

Request Headers:

None.

Request Body:

None.

Notification Endpoints

GET /notification

Get Notification Count

Retrieves the number of unread notifications for the current user.

Request Headers:

Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

None.

GET /notifications/render/PAGE

Render Notifications

Retrieves a paginated list of rendered notifications for the current user.

Path Parameters:

Request Headers:

Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

None.

GET /notifications/get/PAGE

Get Notifications Data

Retrieves structured JSON data for a paginated list of notifications for the current user.

Path Parameters:

Request Headers:

Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

None.

Settings Endpoints

POST /settings/customization

Update User Customization Settings

Updates the display name, description, profile icon, and banner for the authenticated user.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /settings/theme

Update User Theme

Changes the user's preferred theme.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /settings/language

Update User Language

Changes the user's preferred language.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /settings/notifications/loves

Toggle Love Notifications

Enables or disables notifications for when content is loved.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /settings/notifications/posts

Toggle Post Notifications

Enables or disables notifications when users you follow make posts.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /settings/notifications/pings

Toggle Ping Notifications

Enables or disables notifications when the user is pinged.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /settings/notifications/followers

Toggle Follower Notifications

Enables or disables notifications for new followers.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /settings/preferences/horizontal_content_scrolling

Toggle Horizontal Content Scrolling Preference

Sets the user's preference for horizontal content scrolling in the UI.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

POST /settings/preferences/events_ui

Toggle Events UI Preference

Sets the user's preference for displaying special events in the UI.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

GET /settings/referrals/generate

Generate New Referral Link

Generates a new referral link for the authenticated user.

Request Headers:

Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

None.

POST /settings/links

Update User External Links

Updates external links associated with the user's profile.

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body:

Moderation & Internal Endpoints

POST /bans/USER_ID/ban

Ban User (Internal)

Bans a usee. Requires admin authentication.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_MODERATOR_AUTH_TOKEN

Request Body:

POST /bans/USER_ID/unban

Unban User (Internal)

Unbans a user. Requires admin authentication.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_MODERATOR_AUTH_TOKEN

Request Body:

POST /bans/USER_ID/edit

Edit User Ban Reason (Internal)

Modifies the reason for an existing user ban. Requires admin authentication.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_MODERATOR_AUTH_TOKEN

Request Body:

POST /reports/REPORT_ID/discard

Discard Report (Internal)

Discards a specific report, marking it as resolved or irrelevant. Requires moderator authentication.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_MODERATOR_AUTH_TOKEN

Request Body:

POST /settings/internal/USER_ID/customization

Update User Internal Customization (Internal)

Allows internal administrators to modify user flags (e.g., administrator status, verified status, bug hunter status).

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_ADMIN_AUTH_TOKEN

Request Body:

POST /communities/COMMUNITY/settings/internal/customization

Update Community Internal Customization (Internal)

Allows internal administrators to modify community flags (e.g., verified status, disabled status).

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_ADMIN_AUTH_TOKEN

Request Body:

POST /interactions/internal/INTERACTION_ID/edit

Edit Interaction Internally (Internal)

Allows internal administrators to edit the content of any post, comment, or reply.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_ADMIN_AUTH_TOKEN

Request Body:

Statistics Endpoints

GET /statistics/interactions

Get Global Interaction Statistics

Retrieves global data for interaction statistics (posts, comments, replies) over time.

Request Headers:

None.

Request Body:

None.

GET /statistics/engagements

Get Global Engagement Statistics

Retrieves global data for user engagement (e.g., loves, votes etc) over time.

Request Headers:

None.

Request Body:

None.

GET /statistics/interactions?user=USERNAME

Get User Interaction Statistics

Retrieves interaction statistics (posts, comments, replies) for a specific user over time.

Query Parameters:

Request Headers:

None.

Request Body:

None.

GET /statistics/engagements?user=USERNAME

Get User Engagement Statistics

Retrieves engagement statistics (e.g., content loved, votes cast etc) for a specific user over time.

Query Parameters:

Request Headers:

None.

Request Body:

None.

GET /statistics/biggest_lovers

Get Biggest Lovers

Retrieves a list of users who have loved the most content.

Request Headers:

None.

Request Body:

None.

GET /statistics/biggest_posters

Get Biggest Posters

Retrieves a list of users who have created the most posts.

Request Parameters:

None.

Request Body:

None.

Poll Endpoints

POST /polls/POST_ID/vote

Vote on Poll

Casts a vote on a specific poll.

Path Parameters:

Request Headers:

Content-Type: multipart/form-data
Authorization: Bearer YOUR_AUTH_TOKEN

Request Body: