MOiN API Documentation

Build integrations with the privacy-focused social platform. No tracking, no algorithms. Just a clean, developer-friendly API.

MOiN is a privacy-first social media platform with chronological feeds and credit-based premium features. This documentation covers everything you need to integrate with our API.

Quick Start

Get up and running with the MOiN API in minutes.

Create an account

Sign up at moin.net to get started. You need an active account to use authenticated endpoints. Registration may be temporarily closed, so check GET /api/v1/auth/registration-status before building a sign-up flow.

Authenticate via OTP

Request a one-time password, then verify it to receive your session cookie.

# Step 1: Request OTP
curl -X POST https://moin.net/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}'

# Step 2: Verify OTP (check your email for the 6-digit code)
curl -X POST https://moin.net/api/v1/auth/login/verify \
  -H "Content-Type: application/json" \
  -c cookies.txt \
  -d '{"email": "you@example.com", "code": "123456"}'
// Step 1: Request OTP
await fetch('https://moin.net/api/v1/auth/login', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  credentials: 'include',
  body: JSON.stringify({ email: 'you@example.com' })
});

// Step 2: Verify OTP (check your email for the 6-digit code)
const res = await fetch('https://moin.net/api/v1/auth/login/verify', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  credentials: 'include',
  body: JSON.stringify({ email: 'you@example.com', code: '123456' })
});
const { user } = await res.json();

Make your first API call

Fetch your profile to confirm authentication is working.

curl https://moin.net/api/v1/me -b cookies.txt
const me = await fetch('https://moin.net/api/v1/me', {
  credentials: 'include'
}).then(r => r.json());

Create your first post

curl -X POST https://moin.net/api/v1/posts \
  -H "Content-Type: application/json" \
  -H "X-CSRF-Token: YOUR_CSRF_TOKEN" \
  -b cookies.txt \
  -d '{"body": "Hello from the API!"}'
await fetch('https://moin.net/api/v1/posts', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-CSRF-Token': getCsrfToken()
  },
  credentials: 'include',
  body: JSON.stringify({ body: 'Hello from the API!' })
});

Base URL

https://moin.net/api/v1

All API endpoints are prefixed with /api/v1. Responses are JSON (application/json). Request bodies should use Content-Type: application/json except for file uploads which use multipart/form-data.

Versioning

The API is currently at version 1. Breaking changes will be introduced under a new version prefix (e.g. /api/v2).

Authentication Overview

MOiN uses passwordless OTP authentication. There are no API keys, and no OAuth flow is required for API access. Authentication works via cookie-based JWT sessions, or via a bearer token for non-browser clients.

How it works

  1. Send your email to the login endpoint, and a 6-digit code is emailed to you
  2. Submit the code to the verify endpoint, which sets a JWT as an HttpOnly cookie and also returns it as token in the response body
  3. Include the cookie in subsequent requests (automatic in browsers with credentials: 'include')
  4. When authenticating via cookie, include a X-CSRF-Token header for all state-changing requests (POST, PATCH, DELETE)

Bearer tokens (non-browser clients)

Native apps, scripts, and server-side clients can skip cookies entirely: the login verify response includes the JWT as token. Send it on every request as an Authorization header:

curl https://moin.net/api/v1/me \
  -H "Authorization: Bearer YOUR_TOKEN"
Note

CSRF tokens protect cookie-based sessions against cross-site request forgery. Requests authenticated purely via Authorization: Bearer (without the session cookie) do not need a CSRF header. Treat the token like a password. It is long-lived until you log out.

Cookie details

PropertyValue
Namemoin-auth-token
HttpOnlytrue (not accessible via JavaScript)
Securetrue (HTTPS only)
SameSiteStrict
Max-Age10 years (sessions are long-lived; they end on logout or server-side revocation, and each account keeps at most 10 active sessions, with the oldest revoked beyond that)

Registration Status

GET/api/v1/auth/registration-status
No Authentication

Check whether new account registration is currently open.

{ "enabled": true }

Register

Create a new account. An OTP code will be sent to the provided email for verification.

POST/api/v1/auth/register
No Authentication

Parameters

ParameterTypeRequiredDescription
usernamestringRequired3-15 characters, alphanumeric and underscore only
emailstringRequiredValid email address
displayNamestringRequired1-25 characters
biostringOptionalMax 200 characters, up to 3 lines
browserLanguagesstring[]OptionalBrowser language preferences for content localization

Response

{
  "user": { ... },
  "email": "y***@example.com",
  "expiresAt": "2026-01-15T10:05:00.000Z",
  "message": "Account created. We've emailed a verification code to y***@example.com.",
  "retryAfterSeconds": 600
}
Note

The response includes the created user object. Registration checks email availability directly: if the address is already registered you receive an explicit Email already in use error. (The login and recovery endpoints, in contrast, always return the same response whether or not an account exists.) Emails are accepted from a curated allowlist of common TLDs; exotic TLDs are rejected. Registration may also be temporarily closed. Check GET /api/v1/auth/registration-status first, otherwise this endpoint returns 403.

Login (OTP Flow)

Authentication is a two-step process: request an OTP code, then verify it.

Step 1: Request OTP

POST/api/v1/auth/login
No Authentication
ParameterTypeRequiredDescription
emailstringRequiredYour account email address
{
  "email": "y***@example.com",
  "expiresAt": "2026-01-15T10:05:00.000Z",
  "message": "If this email is registered, a one-time passcode has been sent to y***@example.com.",
  "retryAfterSeconds": 600,
  "requiresTwoFactor": false
}

Step 2: Verify OTP

POST/api/v1/auth/login/verify
ParameterTypeRequiredDescription
emailstringRequiredSame email from step 1
codestringRequired6-digit OTP from your email
twoFactorCodestringOptionalTOTP code if 2FA is enabled

On success, the server sets an HttpOnly cookie and returns the user object plus the JWT as token (for bearer-token clients):

{
  "user": {
    "id": "clx1abc2d0000abcd1234efgh",
    "username": "johndoe",
    "email": "john@example.com",
    "displayName": "John Doe",
    "bio": "Hello world",
    "handle": "johndoe",
    "avatarUrl": "/uploads/avatars/clx1abc.webp",
    "headerImageUrl": null,
    "role": "USER",
    "verified": false,
    "creditBalance": 0,
    "twoFactorEnabled": false,
    "pinnedPostId": null,
    "createdAt": "2026-01-01T00:00:00.000Z"
  },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Email Recovery

Recover access to your account if you've lost access to your email.

Step 1: Request Recovery

POST/api/v1/auth/login/recover-email
No Authentication
ParameterTypeRequiredDescription
usernamestringRequiredYour account username

Returns the masked email address associated with the account (if found). An OTP code is sent to the account's email.

Step 2: Verify Recovery Code

POST/api/v1/auth/login/recover-verify
ParameterTypeRequiredDescription
usernamestringRequiredSame username from step 1 (3-15 characters, alphanumeric and underscore only)
codestringRequired6-digit OTP from your email

On success, sets the auth cookie and returns the user object (same as login verify).

Rate Limit

Recovery requests are limited to one attempt per 24 hours per username.

CSRF Tokens

All state-changing requests (POST, PATCH, DELETE) made with a cookie session require a X-CSRF-Token header. The CSRF token is provided in the non-HttpOnly csrf_token cookie set by the server once you are logged in. Requests authenticated via Authorization: Bearer without the session cookie are exempt.

Reading the CSRF token

# The CSRF token is in the cookies from your login response.
# Extract it and pass as a header:
curl -X POST https://moin.net/api/v1/posts \
  -H "Content-Type: application/json" \
  -H "X-CSRF-Token: YOUR_CSRF_TOKEN" \
  -b cookies.txt \
  -d '{"body": "Hello!"}'
function getCsrfToken() {
  const match = document.cookie.match(/(?:^|;\s*)csrf_token=([^;]*)/);
  return match ? decodeURIComponent(match[1]) : '';
}

// Use it in every state-changing request:
await fetch('/api/v1/posts', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-CSRF-Token': getCsrfToken()
  },
  credentials: 'include',
  body: JSON.stringify({ body: 'Hello!' })
});
Warning

Requests without a valid CSRF token will return 403 Forbidden.

Session Management

Logout

POST/api/v1/auth/logout
Authentication Optional

Revokes the current JWT and clears the auth cookie. Works without authentication. If no valid session exists, it simply clears the cookie.

Refresh Session

POST/api/v1/auth/session/refresh
Authentication Required

Rotates the session: a new long-lived JWT is issued and the old token is revoked. Sessions do not expire on a fixed schedule. They remain valid until you log out, the session is revoked server-side, or the account exceeds its limit of 10 active sessions (the oldest is revoked automatically).

Re-authentication (elevated session)

Security-sensitive operations (changing your email and enabling or disabling 2FA) require a recently re-authenticated (“elevated”) session. Without it they return 403 with { "requiresReauth": true }.

POST/api/v1/auth/reauth/request
Authentication Required

Sends a 6-digit verification code to your account email.

POST/api/v1/auth/reauth/verify
Authentication Required
ParameterTypeRequiredDescription
codestringRequired6-digit code from your email

On success the response is { "elevated": true, "expiresIn": 300 }. The elevation lasts 5 minutes.

The Post Object

Posts are the core content unit on MOiN.

idstring

Unique identifier (CUID)

entryIdstring

Feed entry identifier

bodystring

Post content text

typestring

Post type: QUICK, DEEP, or SIGNAL

networkstring

Network identifier (default ECHOSPHERE)

visibilitystring

PUBLIC, FOLLOWERS, or HIDDEN (system-assigned by moderation, not user-selectable)

tagstring | null

Optional tag (max 64 chars)

sourceUrlstring | null

Optional source link URL

publishAtstring

ISO 8601 datetime when the post becomes visible

createdAtstring

ISO 8601 creation timestamp

updatedAtstring

ISO 8601 last update timestamp (returned on create; not part of feed/single-post payloads)

replyToIdstring | null

Parent post ID if this is a reply (returned on create; not part of feed/single-post payloads)

isRepostboolean

Whether this feed entry is a repost. Repost entries carry a repostContext object ({ id, username, displayName, handle, isSelf, verified } of the reposter), a repostEntryId, and originalCreatedAt; the remaining fields describe the original post.

hideLinkPreviewboolean

Whether link preview cards are hidden for this post

languagestring | null

Auto-detected language code

authorobject

Author profile: { id, username, handle, displayName, avatarUrl, verified }

mediaarray

Attached media objects (see Media)

pollobject | null

Poll data if attached (see Polls)

mentionedUsersarray

Users mentioned in the post via @username

replyCountnumber

Number of replies

reactionsobject

Reaction counts keyed by type, e.g. { "LIKE": 5, "BOOST": 2 }. Types with zero reactions are omitted, so treat missing keys as 0.

Note

Feed and single-post payloads include further contextual fields not listed here, e.g. relationship and reactedByCurrentUser (authenticated requests only), isPinned, linkPreview, factCheckStatus/factCheckVerdict, and signals.

Create a Post

POST/api/v1/posts
Authentication Required

Create a new post. Use application/json for text-only posts, or multipart/form-data for posts with media.

ParameterTypeRequiredDescription
bodystringOptionalPost text. Max 300 chars (free) or 1,000 chars (with extended_posts). At least one of body, media, video, or poll is required.
typestringOptionalquick (default), deep, or signal
visibilitystringOptionalPUBLIC (default) or FOLLOWERS
tagstringOptionalTag for the post (max 64 chars)
sourceUrlstringOptionalSource URL link
publishAtstringOptionalISO 8601 datetime for scheduled posts (min 60s in the future). Requires scheduling feature.
replyToIdstringOptionalPost ID to reply to (see the reply restrictions below)
mediaFileOptionalImage file (multipart/form-data). Repeat the media field once per image for multiple attachments.
videoFileOptionalSingle video file (multipart/form-data)
mediaAltTextstringOptionalALT text for the media files: repeat the field in the same order as the media fields
pollstringOptionalJSON string with poll data (see Polls)
hideLinkPreviewbooleanOptionalSet true to hide link preview cards
# Text-only post
curl -X POST https://moin.net/api/v1/posts \
  -H "Content-Type: application/json" \
  -H "X-CSRF-Token: YOUR_CSRF_TOKEN" \
  -b cookies.txt \
  -d '{"body": "Hello from the API!", "type": "quick"}'

# Post with images (repeat "media" once per file)
curl -X POST https://moin.net/api/v1/posts \
  -H "X-CSRF-Token: YOUR_CSRF_TOKEN" \
  -b cookies.txt \
  -F "body=Check out these photos" \
  -F "media=@photo.jpg" \
  -F "mediaAltText=A beautiful sunset" \
  -F "media=@second.jpg" \
  -F "mediaAltText=The same sunset, minutes later"
// Text-only post
await fetch('/api/v1/posts', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-CSRF-Token': getCsrfToken()
  },
  credentials: 'include',
  body: JSON.stringify({ body: 'Hello from the API!' })
});

// Post with images (append 'media' once per file)
const form = new FormData();
form.append('body', 'Check out these photos');
form.append('media', imageFile);
form.append('mediaAltText', 'A beautiful sunset');
form.append('media', secondImageFile);
form.append('mediaAltText', 'The same sunset, minutes later');

await fetch('/api/v1/posts', {
  method: 'POST',
  headers: { 'X-CSRF-Token': getCsrfToken() },
  credentials: 'include',
  body: form
});
Posting Limits

Free accounts can post 5 times per day. Enable the unlimited_posts feature (5 credits/day) for unlimited posting.

Attachment rules

A post can carry either images or one video or a poll. These cannot be combined. body text can accompany any of them.

Reply restrictions

Replying via replyToId only works if the post author has enabled replies (allowFriendsReply in their settings, off by default) and you are mutual follows (“friends”). You can always reply to your own posts. Otherwise the request fails with 400.

Get a Post

GET/api/v1/posts/:postId
Authentication Optional

Retrieve a single post by ID. Authenticated requests include relationship context and user reaction status.

Get Replies

GET/api/v1/posts/:postId/replies
ParameterTypeRequiredDescription
limitnumberOptionalNumber of replies to return (default 20, max 50)
cursorstringOptionalPagination cursor from previous response

Edit a Post

PATCH/api/v1/posts/:postId
Authentication Required

Edit an existing post. You must be the author. It uses the same parameters as Create a Post. You can update the text, add or replace media, change visibility, and more.

Send as application/json for text-only changes, or multipart/form-data when updating media.

ParameterTypeRequiredDescription
bodystringOptionalUpdated post text
visibilitystringOptionalPUBLIC or FOLLOWERS
tagstringOptionalTag for the post (max 64 chars)
sourceUrlstringOptionalSource URL link
publishAtstringOptionalISO 8601 datetime to reschedule the post (only for unpublished scheduled posts)
hideLinkPreviewbooleanOptionalSet true to hide link preview cards
mediaFileOptionalAdditional image files (multipart/form-data). Repeat the field once per image; new images are appended to the existing ones
videoFileOptionalVideo file (multipart/form-data); only allowed when the post has no images
mediaAltTextstringOptionalALT text per new media file: repeat the field in the same order as media
keepMediaIdsstring[]OptionalIDs of existing media to keep (JSON array; as a JSON string in multipart requests). Existing media not listed here is removed. Omit the field to keep all existing media.
Edit Window

Free accounts: 1 edit within 5 minutes of creation. With extended_edits feature: 5 edits within 60 minutes.

Delete a Post

DELETE/api/v1/posts/:postId
Authentication Required

Permanently delete a post. You must be the author.

Bulk Delete

DELETE/api/v1/me/posts/bulk
ParameterTypeRequiredDescription
rangestringRequiredtoday, week, month, year, or all
tzOffsetnumberOptionalTimezone offset in minutes as returned by JavaScript's getTimezoneOffset() (positive = west of UTC; accepted range covers UTC-12 to UTC+14), for accurate day/week/month boundaries

Pin / Unpin

POST/api/v1/posts/:postId/pin
DELETE/api/v1/posts/:postId/pin
Authentication Required

Pin a post to the top of your profile. Only one post can be pinned at a time; pinning a new post automatically unpins the previous one.

Reactions

POST/api/v1/posts/:postId/react
Authentication Required

React to a post. Calling again with the same reaction type removes it (toggle behavior).

ParameterTypeRequiredDescription
reactionstringRequiredLIKE, BOOST, or SAVE
curl -X POST https://moin.net/api/v1/posts/POST_ID/react \
  -H "Content-Type: application/json" \
  -H "X-CSRF-Token: YOUR_CSRF_TOKEN" \
  -b cookies.txt \
  -d '{"reaction": "LIKE"}'
await fetch(`/api/v1/posts/${postId}/react`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-CSRF-Token': getCsrfToken()
  },
  credentials: 'include',
  body: JSON.stringify({ reaction: 'LIKE' })
});

Fact Check

Request an AI-powered fact-check on a post or retrieve a cached result.

Request Fact Check

POST/api/v1/posts/:postId/fact-check
Authentication Required

Submit a post for AI fact-checking. Rate limited.

curl -X POST https://moin.net/api/v1/posts/POST_ID/fact-check \
  -H "X-CSRF-Token: YOUR_CSRF_TOKEN" \
  -b cookies.txt
await fetch(`/api/v1/posts/${postId}/fact-check`, {
  method: 'POST',
  headers: { 'X-CSRF-Token': getCsrfToken() },
  credentials: 'include'
});

Get Fact Check Result

GET/api/v1/posts/:postId/fact-check
Authentication Optional

Retrieve the cached fact-check result for a post, if available.

Translation

Translate a post into another language or retrieve a cached translation.

Translate Post

POST/api/v1/posts/:postId/translate
Authentication Required

Request a translation of a post. Rate limited.

ParameterTypeRequiredDescription
targetLangstringRequired2-character language code (e.g. en, de, fr)
curl -X POST https://moin.net/api/v1/posts/POST_ID/translate \
  -H "Content-Type: application/json" \
  -H "X-CSRF-Token: YOUR_CSRF_TOKEN" \
  -b cookies.txt \
  -d '{"targetLang": "de"}'
await fetch(`/api/v1/posts/${postId}/translate`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-CSRF-Token': getCsrfToken()
  },
  credentials: 'include',
  body: JSON.stringify({ targetLang: 'de' })
});

Get Cached Translation

GET/api/v1/posts/:postId/translate/:lang
Authentication Optional

Retrieve a previously generated translation for a post in the specified language.

Get Feed

GET/api/v1/feed
Authentication Optional

Retrieve the chronological feed. Authenticated users see personalized content; unauthenticated users see public posts.

ParameterTypeRequiredDescription
filterstringOptionalFeed filter: all (default), news, friends, following, followers, verified, reposts, saves, scheduled. All filters except all and news require authentication.
searchstringOptionalFilter posts by text (max 140 characters)
limitnumberOptionalPosts per page (default 40, max 100)
cursorstringOptionalPagination cursor

Search Posts

GET/api/v1/posts/search
Authentication Required

Search posts with the filter options below.

ParameterTypeRequiredDescription
qstringOptionalSearch text (matches post body, display name, and handle)
hasMediabooleanOptionalFilter by media presence
hasPollbooleanOptionalFilter by poll presence
fromUserstringOptionalFilter by author username
followingOnlybooleanOptionalOnly posts from people you follow
verifiedOnlybooleanOptionalOnly posts from verified accounts
dateFromstringOptionalISO 8601 start date
dateTostringOptionalISO 8601 end date
minFavsnumberOptionalMinimum like count
minRepostsnumberOptionalMinimum repost count
mediaTypestringOptionalFilter by media type: image or video
toUserstringOptionalFilter by @mentioned username
followersOnlybooleanOptionalOnly posts from your followers
friendsOnlybooleanOptionalOnly posts from mutual follows
isRepostbooleanOptionalFilter for reposts (true) or original posts (false)
languagesstringOptionalComma-separated list of language codes to filter by (e.g. en,de)
limitnumberOptionalResults per page (default 20, max 50)
cursorstringOptionalPagination cursor from the previous response's nextCursor

Without q, the endpoint returns an empty result set. The text query is what drives the search; all other parameters narrow it down.

Upload Images

Images are uploaded as part of post creation using multipart/form-data. Use the media field for image files (repeat it once per image) and mediaAltText for corresponding ALT text in the same order.

LimitFreeWith Feature
Daily quota5 images/day30/day (more_images)
Max file size5 MB15 MB (bigger_images)
CompressionAuto-compressedNo compression (hd_images)

Images are automatically processed: EXIF metadata is stripped, auto-rotation is applied, and preview thumbnails are generated. Animated GIFs and animated WebPs are preserved.

Upload Video

Use the video field (singular) in your post creation request. Only one video per post is allowed.

LimitFreeWith Feature
Daily quota2 videos/day10/day (more_videos)
Max file size100 MB500 MB (bigger_videos)

Videos are generally stored as-is without re-encoding. The one exception: HEVC/H.265 videos (typical for iPhone recordings) are transcoded to H.264 for browser compatibility. File type is detected from the file contents, not the client-supplied MIME type.

Supported Formats

Images

FormatMIME Types
JPEGimage/jpeg, image/pjpeg
PNGimage/png, image/x-png
WebPimage/webp
GIFimage/gif

Videos

FormatMIME Type
MP4video/mp4
WebMvideo/webm
MOVvideo/quicktime

Media Object

idstring

Unique media ID

urlstring

Full-size media URL

previewUrlstring | null

Thumbnail preview URL (images only)

mimeTypestring

MIME type of the file

widthnumber

Width in pixels

heightnumber

Height in pixels

altTextstring | null

ALT text description

fileSizenumber

File size in bytes

checksumstring

File content hash for deduplication

isAnimatedboolean

Whether the media is animated (GIF/animated WebP)

positionnumber

Display order (0-based)

AI ALT Text Generation

POST/api/v1/generate-alt-text
Authentication Required

Generate descriptive ALT text for an image using AI. Requires the auto_alt_text feature (3 credits/day).

Upload a single image as multipart/form-data with field name image. Returns:

{ "altText": "A golden retriever playing fetch in a sunlit park" }

Create a Poll

Polls are attached to posts. Include a poll parameter as a JSON string when creating a post. Requires the polls feature (3 credits/day).

FieldTypeRequiredDescription
questionstringRequiredPoll question (max 240 characters)
optionsstring[]RequiredArray of option strings (2-4 options, max 50 chars each, must be unique)
allowsMultiplebooleanOptionalAllow selecting multiple options (default: false)
durationSecondsnumberRequiredPoll duration. Allowed values: 300 (5 min), 3600 (1 hr), 21600 (6 hr), 86400 (24 hr), 259200 (3 days), 604800 (7 days)
curl -X POST https://moin.net/api/v1/posts \
  -H "Content-Type: application/json" \
  -H "X-CSRF-Token: YOUR_CSRF_TOKEN" \
  -b cookies.txt \
  -d '{
    "body": "What is your favorite language?",
    "poll": "{\"question\":\"Favorite language?\",\"options\":[\"JavaScript\",\"Python\",\"Rust\",\"Go\"],\"durationSeconds\":86400}"
  }'
await fetch('/api/v1/posts', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-CSRF-Token': getCsrfToken()
  },
  credentials: 'include',
  body: JSON.stringify({
    body: 'What is your favorite language?',
    poll: JSON.stringify({
      question: 'Favorite language?',
      options: ['JavaScript', 'Python', 'Rust', 'Go'],
      durationSeconds: 86400
    })
  })
});

Vote on a Poll

POST/api/v1/posts/:postId/poll/vote
Authentication Required
ParameterTypeRequiredDescription
optionIdsstring[]RequiredArray of option IDs to vote for (1–4). Multiple selections only work if the poll has allowsMultiple: true.

Users can vote once per poll. Voting again replaces the previous selection.

The User Object

idstring

Unique user identifier

usernamestring

Unique handle (3-15 characters)

displayNamestring

Display name (1-25 characters)

biostring

User bio (max 200 characters)

avatarUrlstring | null

Avatar image URL

headerImageUrlstring | null

Profile header image URL

verifiedboolean

Whether the account is verified

createdAtstring

Account creation date (ISO 8601)

followerCountnumber

Number of followers

followingCountnumber

Number of accounts followed

postCountnumber

Total number of posts

Get Authenticated User

GET/api/v1/me
Authentication Required

Retrieve the currently authenticated user's full profile, including private fields like email, credit balance, and settings.

{
  "id": "clx1abc2d0000abcd1234efgh",
  "username": "johndoe",
  "email": "john@example.com",
  "displayName": "John Doe",
  "bio": "Hello world",
  "handle": "johndoe",
  "avatarUrl": "/uploads/avatars/clx1abc.webp",
  "headerImageUrl": null,
  "role": "USER",
  "verified": false,
  "creditBalance": 250,
  "twoFactorEnabled": false,
  "pinnedPostId": null,
  "createdAt": "2026-01-01T00:00:00.000Z",
  "followerCount": 42,
  "followingCount": 18,
  "postCount": 137
}
Note

This endpoint returns private fields (email, creditBalance, twoFactorEnabled) that are not included in public profile responses. The full payload also contains additional private objects not shown above, e.g. settings, metrics, notificationCount, antiPhishingCode, and pendingEmailChange.

Get Profile

GET/api/v1/profiles/:username
Authentication Optional

Retrieve a user's public profile. Authenticated requests include relationship context (whether you follow them, etc.).

Update Profile

PATCH/api/v1/me
Authentication Required

Update your profile information. Rate limited to 10 updates per 15 minutes.

ParameterTypeRequiredDescription
displayNamestringOptional1-25 characters
biostringOptionalMax 200 characters, max 3 lines
usernamestringOptionalNew username (3-15 characters, alphanumeric and underscore). Must be available and not reserved; your previous username is released.

Avatar & Header

POST/api/v1/me/avatar

Upload avatar image (max 3 MB). Saved as WebP.

POST/api/v1/me/header

Upload header image (max 5 MB). Saved as WebP.

Authentication Required

Both use multipart/form-data with the field name avatar or header respectively.

Followers & Following

GET/api/v1/profiles/:username/followers
GET/api/v1/profiles/:username/following
Authentication Optional

Returns the most recent connections, up to 200 entries per list. These endpoints are not paginated.

User Replies

GET/api/v1/profiles/:username/replies
Authentication Optional

Retrieve a user's replies. Returns the 20 most recent replies (no pagination parameters). Returns 404 if the user is not found.

Search Profiles

GET/api/v1/profiles/search
Authentication Optional
ParameterTypeRequiredDescription
qstringRequiredSearch query (matches username and display name)

Returns up to 8 matches as { "items": [...] }. There is no limit parameter.

Follow / Unfollow

POST/api/v1/social/follow
Authentication Required

Follow or unfollow a user. Use the action parameter to specify the operation.

ParameterTypeRequiredDescription
targetIdstringRequiredUser ID to follow/unfollow
actionstringOptionalfollow (default) or unfollow

Response includes the full relationship object:

{
  "relationship": {
    "isFollowing": true,
    "isFollower": false,
    "isMuted": false,
    "isBlocked": false,
    "hasBlockedYou": false
  }
}

Mute / Unmute

POST/api/v1/social/mute
Authentication Required

Mute or unmute a user. Muted users' posts are hidden from your feed.

ParameterTypeRequiredDescription
targetIdstringRequiredUser ID to mute/unmute
actionstringOptionalmute (default) or unmute

Block / Unblock

POST/api/v1/social/block
Authentication Required

Block or unblock a user. Blocking a user automatically unfollows both directions.

ParameterTypeRequiredDescription
targetIdstringRequiredUser ID to block/unblock
actionstringOptionalblock (default) or unblock

Relationship Status

GET/api/v1/social/relationship/:targetId
Authentication Required

Get the full relationship between you and another user.

{
  "relationship": {
    "isFollowing": true,
    "isFollower": false,
    "isMuted": false,
    "isBlocked": false,
    "hasBlockedYou": false
  }
}

Blocked & Muted Users

Authentication Required

List Blocked Users

GET/api/v1/social/blocked-users

Returns the list of users you have blocked.

List Muted Users

GET/api/v1/social/muted-users

Returns the list of users you have muted.

Report Content

POST/api/v1/social/report
Authentication Required

Report a post or a user for review. Rate limited to 10 reports per 15 minutes. At least one of postId or reportedUserId is required.

ParameterTypeRequiredDescription
postIdstringOptional*Post ID to report (CUID format)
reportedUserIdstringOptional*User ID to report (for profile-level reports)
categorystringRequiredReport category enum value (use GET /api/v1/social/report/categories)
subcategorystringOptionalReport subcategory (max 100 characters)
descriptionstringOptionalAdditional context (max 2,000 characters)

Get Report Categories

GET/api/v1/social/report/categories
Authentication Optional

List Notifications

GET/api/v1/notifications
Authentication Required

Retrieve your most recent 50 notifications. Supports limit (max 50) and cursor query parameters; the first page (request without cursor) automatically marks the fetched notifications as read.

Unread Count

GET/api/v1/notifications/count
Authentication Required
{ "count": 5 }

Drafts

Authentication Required

Save posts as drafts before publishing. Maximum 50 drafts per user.

GET/api/v1/drafts

List all drafts.

POST/api/v1/drafts

Create a draft.

ParameterTypeRequiredDescription
bodystringOptionalDraft text (max 10,000 characters, default empty)
visibilitystringOptionalPUBLIC (default) or FOLLOWERS
pollDataobject | nullOptionalPoll data: { question, options, duration }. question max 500 chars, options string array (2-4, max 100 chars each), duration positive integer in seconds
scheduledAtstring | nullOptionalISO 8601 datetime for scheduling
PATCH/api/v1/drafts/:id

Update a draft.

DELETE/api/v1/drafts/:id

Delete a draft.

Settings

GET/api/v1/settings
Authentication Required

Get your current settings.

PATCH/api/v1/settings

Update settings. Pass only the fields you want to change.

Languages

GET/api/v1/settings/languages
No Authentication

Get the list of supported language codes.

Two-Factor Authentication

Authentication Required

MOiN supports TOTP-based two-factor authentication.

Elevated session required

enable and disable require a recently re-authenticated session (see Re-authentication). Without it they return 403 with { "requiresReauth": true }.

POST/api/v1/settings/two-factor/setup

Initialize 2FA setup. Returns a TOTP secret and QR code data URL for authenticator apps.

POST/api/v1/settings/two-factor/enable

Enable 2FA by submitting a valid TOTP code from your authenticator app.

ParameterTypeRequiredDescription
codestringRequired6-digit TOTP code from your authenticator
POST/api/v1/settings/two-factor/disable

Disable 2FA. Requires a valid TOTP code for confirmation.

ParameterTypeRequiredDescription
codestringRequired6-digit TOTP code from your authenticator
POST/api/v1/settings/two-factor/cancel

Cancel a pending 2FA setup before it is enabled.

Credits Overview

MOiN uses a credit-based system for premium features. 1 credit = 0,01 €. Credits are purchased by card, Apple Pay, Google Pay, or bank transfer (via Stripe). Stripe is a US provider — the one part of MOiN where data leaves the EU/EEA. We plan to move payments to a European provider once a suitable one exists.

Features are unlocked on a daily basis. Enabling a feature deducts its daily cost from your balance. Features auto-renew each day if you have sufficient credits.

How it works

1. Purchase a credit package
2. Enable features you want
3. Credits are deducted daily
4. Disable anytime, and the feature stays active until the current period ends

Balance & Transactions

Get Balance

GET/api/v1/credits/balance
Authentication Required
{ "balance": 250 }

Transaction History

GET/api/v1/credits/transactions
Authentication Required

Returns a paginated list of credit transactions (purchases, feature charges, transfers, etc.).

ParameterTypeRequiredDescription
limitnumberOptionalResults per page
offsetnumberOptionalNumber of records to skip
filterstringOptionalRestrict to a type group: purchases, features, factchecks, translations, or transfers
directionstringOptionalin (credits received) or out (credits spent)

Get Pricing

GET/api/v1/credits/pricing
No Authentication

Returns the current feature pricing list.

Credit Packages

GET/api/v1/credits/packages
No Authentication
PackageCreditsPrice (EUR)Discount
pack_1001001,- €—
pack_5005004,50 €10%
pack_10001,0008,50 €15%
pack_50005,00040,- €20%
pack_1000010,00075,- €25%

Features & Pricing

GET/api/v1/credits/features
Authentication Required

Lists all available features with their pricing and your current activation status.

FeatureCredits/DayDescription
unlimited_posts5Remove the 5 posts/day limit
extended_posts31,000 character limit (vs 300)
extended_edits25 edits in 60 min (vs 1 in 5 min)
more_images330 images/day (vs 5)
bigger_images215 MB max (vs 5 MB)
hd_images2No auto-compression
more_videos510 videos/day (vs 2)
bigger_videos4500 MB max (vs 100 MB)
polls3Attach polls to posts
scheduling4Schedule posts for later
friends_only2Friends-only posts (visible to mutual follows only)
auto_alt_text3AI-generated image descriptions
direct_messaging5End-to-end encrypted direct messages to mutual friends
hide_display_name2Hide your display name; only your @username is shown
highlight_palette2Custom accent color for the app's highlights
no_limits35All features bundled (saves 12/day vs. enabling everything individually)

Enable a Feature

POST/api/v1/credits/features/:featureId/enable

Disable Auto-Renew

POST/api/v1/credits/features/:featureId/disable

Re-enable Auto-Renew

POST/api/v1/credits/features/:featureId/reenable

Account Limits

GET/api/v1/credits/limits
Authentication Required

Returns your current account limits based on your active features. Useful for checking quotas before uploading or posting.

{
  "postCharacterLimit": 300,
  "dailyPostAllowance": "5",
  "allowImages": true,
  "imageQuota": 5,
  "imageMaxSizeMb": 5,
  "allowVideos": true,
  "videoQuota": 2,
  "videoMaxSizeMb": 100,
  "allowPolls": false,
  "allowScheduling": false,
  "allowFriendsOnly": false,
  "compressImages": true,
  "hasAutoAltText": false,
  "allowHideDisplayName": false,
  "allowHighlightPalette": false,
  "editWindowMs": 300000
}

Purchase Credits

POST/api/v1/credits/purchase
Authentication Required
ParameterTypeRequiredDescription
packageIdstringRequiredPackage ID (e.g. pack_500)

Returns a checkout URL. Redirect the user there to complete the payment:

{
  "paymentId": "cs_test_a1b2c3",
  "checkoutUrl": "https://checkout.stripe.com/c/pay/cs_test_a1b2c3",
  "credits": 500,
  "priceEur": 4.5
}

Transfer Credits

POST/api/v1/credits/transfer
Authentication Required

Send credits to another user. Limited to 10 transfers per day. Minimum transfer: 10 credits.

ParameterTypeRequiredDescription
recipientIdstringRequiredUser ID of the recipient
amountnumberRequiredNumber of credits to send (min 10)
Restrictions

You cannot transfer credits to users you have blocked or who have blocked you.

Real-time: Connecting

GET/api/v1/feed/stream
Authentication Required

Open a Server-Sent Events connection for real-time updates. The server sends heartbeats every 25 seconds to keep the connection alive.

curl -N https://moin.net/api/v1/feed/stream \
  -b cookies.txt \
  -H "Accept: text/event-stream"
const es = new EventSource('/api/v1/feed/stream', {
  withCredentials: true
});

es.addEventListener('feed', (event) => {
  const data = JSON.parse(event.data);
  console.log('Event:', data.type, data);
});

es.addEventListener('error', () => {
  console.log('Connection lost, reconnecting...');
});

SSE Event Types

All events arrive as event: feed with JSON payloads in the data field. The type field distinguishes event types.

feed.refresh

Indicates new content is available in the feed.

{ "type": "feed.refresh", "trigger": "post" }

post.reaction

Real-time reaction count update.

{
  "type": "post.reaction",
  "postId": "clx...",
  "reaction": "LIKE",
  "counts": { "LIKE": 5, "BOOST": 2, "SAVE": 1 },
  "userId": "clx...",
  "isActive": true
}

profile.updated

A user's profile has changed.

{ "type": "profile.updated", "userId": "clx...", "username": "newname" }

notification.update

Unread notification count has changed.

{ "type": "notification.update", "userId": "clx...", "unreadCount": 3 }

announcement.updated

A platform announcement has been created or modified.

{ "type": "announcement.updated" }
Note

The stream also carries an event: dm channel used by the encrypted messaging system of the official apps; its payloads are internal and not part of the stable API.

Request Verification

POST/api/v1/verification/request
Authentication Required

Submit a request to verify your account. Rate limited to 5 requests per 15 minutes.

Verification Status

GET/api/v1/verification/status
Authentication Required

Check the current status of your verification request.

DNS Verification

POST/api/v1/verification/check-dns

Manually trigger a DNS re-check for domain-based verification. Rate limited to 5 per 15 minutes.

Change Email

Authentication Required

Change your account email address. A verification code is sent to the new email.

Elevated session required

Starting an email change requires a recently re-authenticated session (see Re-authentication). Without it the request returns 403 with { "requiresReauth": true }.

Start Email Change

POST/api/v1/me/email-change
ParameterTypeRequiredDescription
emailstringRequiredNew email address

Resend Verification Code

POST/api/v1/me/email-change/resend

Verify Email Change

POST/api/v1/me/email-change/verify
ParameterTypeRequiredDescription
codestringRequired6-digit verification code sent to the new email

Cancel Email Change

POST/api/v1/me/email-change/cancel

Cancel a pending email change request.

Limits

Verification codes expire after 15 minutes. You can resend a code once per 60 seconds, with a maximum of 5 attempts per change request.

Data Export (GDPR)

Authentication Required

Request a full export of your data in compliance with GDPR Article 20.

GET/api/v1/me/export

Check the status of your export request.

POST/api/v1/me/export

Request a new data export. Processing may take a few minutes.

GET/api/v1/me/export/download/:token

Download your export as a ZIP file using the token from the export status response.

Login History

GET/api/v1/security/login-history
Authentication Required

View your login history from the last 30 days. Each entry contains the timestamp (date), an anonymized IP address (last octet masked), and a human-readable device label derived from the user agent.

ParameterTypeRequiredDescription
limitnumberOptionalResults per page (max 50, default 10)
pagenumberOptionalPage number (min 1, default 1)

Delete Account

DELETE/api/v1/me
Authentication Required

Permanently delete your account.

ParameterTypeRequiredDescription
deletePostsstringOptionalQuery parameter. Set to "true" to also delete all your posts (default: "false")
Irreversible

This action permanently deletes your account and all associated data. It cannot be undone.

Announcements

Get Active Announcement

GET/api/v1/announcements/active
Authentication Optional

Returns the currently active platform announcement, if any. May include a poll for community feedback.

{
  "announcement": {
    "id": "clx...",
    "headline": "Platform Update",
    "body": "We've added new features...",
    "active": true,
    "createdAt": "2026-01-15T00:00:00.000Z"
  }
}

Vote on Announcement Poll

POST/api/v1/announcements/vote
Authentication Required
ParameterTypeRequiredDescription
optionIdstringRequiredID of the poll option to vote for

Rate Limits

The API enforces rate limits to ensure fair usage. When you exceed a limit, you'll receive a 429 Too Many Requests response.

Endpoint CategoryWindowLimitKey
General API60 seconds180User ID or IP
Auth (login/register)60 seconds20IP only
OG / embed crawl10 minutes30IP
Profile update15 minutes10User ID or IP
Content report15 minutes10User ID or IP
Credit transfer15 minutes10User ID or IP
Verification request15 minutes5User ID or IP
Bug report60 minutes5User ID or IP
Fact-check request15 minutes5User ID or IP
Translation request15 minutes20User ID or IP
Billing webhook60 seconds20IP
Rate Limit Headers

Responses include a RateLimit header using the IETF draft-7 format (e.g. RateLimit: limit=180, remaining=179, reset=60). Authenticated requests are tracked by user ID; unauthenticated requests are tracked by IP address.

Errors

All errors return a JSON body with a human-readable message field:

{
  "message": "Posts can be up to 300 characters."
}

Some validation endpoints additionally include an errors payload with per-field detail. Its shape varies by endpoint (Zod issues array or a fieldErrors object), so treat message as the reliable field and errors as optional debugging detail:

{
  "message": "Invalid draft data",
  "errors": [
    { "code": "too_big", "path": ["body"], "message": "String must contain at most 10000 character(s)" }
  ]
}

Status Codes

CodeMeaning
200Success
201Created
202Accepted: request received, processing started (e.g. OTP sent)
400Bad Request: validation error or malformed request
401Unauthorized: missing or invalid authentication
403Forbidden: CSRF token missing, insufficient permissions
404Not Found: resource does not exist. Note: some mutation endpoints (e.g. editing or deleting a post that does not exist) report “not found” as a 400 with an explanatory message instead.
413Payload Too Large: avatar/header upload exceeds its size limit. Oversized post media (images/videos) returns 400 with a size message instead.
429Too Many Requests: rate limit exceeded
500Internal Server Error
503Service Unavailable: maintenance mode or feature disabled

Webhooks

This endpoint receives billing events from our payment provider, Stripe. It is documented for transparency — it is not a subscription you can register for, and MOiN does not send webhooks to third-party applications.

POST/api/v1/billing/stripe/webhook
No Authentication (Signature Verified)

Payloads are signed by Stripe. The Stripe-Signature header is verified against the raw request body before anything is acted on; unsigned or mismatched requests are rejected.

Events

EventDescription
checkout.session.completedCheckout finished — credited once the payment status says the money arrived
checkout.session.async_payment_succeededA delayed method (SEPA debit, bank transfer) has now been paid
checkout.session.async_payment_failedA delayed payment ultimately failed
checkout.session.expiredCheckout expired without payment
Session done is not money received

A Checkout Session carries status and payment_status separately. With SEPA debit and bank transfer the session completes immediately while the payment stays unpaid for days, so a completed session alone never grants credits.

Verifying Signatures

const crypto = require('crypto');

// Header looks like: t=<unix>,v1=<hex>[,v1=<hex>]
// Several v1 entries appear while the endpoint secret is rotated.
function verifyWebhookSignature(rawBody, header, secret) {
  const parts = Object.create(null);
  const signatures = [];
  for (const part of header.split(',')) {
    const i = part.indexOf('=');
    const key = part.slice(0, i).trim();
    const value = part.slice(i + 1).trim();
    if (key === 't') parts.t = value;
    else if (key === 'v1') signatures.push(value);
  }
  if (!parts.t || signatures.length === 0) return false;
  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false;

  const expected = crypto
    .createHmac('sha256', secret)
    .update(`${parts.t}.${rawBody}`)
    .digest();

  return signatures.some((sig) => {
    const provided = Buffer.from(sig, 'hex');
    return provided.length === expected.length
      && crypto.timingSafeEqual(provided, expected);
  });
}
Replay protection

The timestamp is part of the signed payload, so webhooks older than 5 minutes are rejected rather than processed, and a completed purchase is only credited once.

Internal Endpoints

Beyond what is documented here, the API serves a number of internal endpoints used by the official web, iOS, and Android apps, including end-to-end encrypted direct messaging (/dm, /e2ee), passkey and OAuth sign-in (/auth/passkey, /auth/oauth/*), session management (/sessions), push notifications (/push), newsletter management (/newsletter), connect/shake features, and subscription billing (/billing/* besides the webhook).

These are not part of the stable public API: they may change or disappear without notice and are intentionally undocumented. Build integrations only against the endpoints described in this documentation.