API Reference

All endpoints are served from https://maskr.space. Authenticated endpoints require a valid session cookie or bearer token obtained via the authentication flow. Request and response bodies are JSON unless otherwise noted.

Authentication

EndpointMethodDescription
/api/auth/[...nextauth]GET / POSTNextAuth.js handler — OAuth sign-in, sign-out, and session callbacks
/api/account/createPOSTCreate a new Maskr account and associate it with the current session
/api/sessionPOSTCheck session status and retrieve the public key for the current user
/api/webauthn/*POSTWebAuthn passkey registration and authentication endpoints

Nostr Operations

EndpointMethodDescription
/api/nostr/keysPOSTRetrieve existing Nostr keys or generate a new key pair for the session
/api/nostr/signPOSTServer-side event signing for passkey users (decrypts nsec and signs the provided event object)
/api/nostr/encryptPOSTEncrypt a message using NIP-04 (shared-secret ECDH + AES-256-CBC)
/api/nostr/decryptPOSTDecrypt a NIP-04 encrypted message for the current user

Content

EndpointMethodDescription
/api/draftsPOSTCreate, retrieve, update, or delete post drafts stored server-side
/api/scheduled-postsPOSTSchedule a post to be published to Nostr relays at a future time
/api/mediaPOSTUpload an image or file; returns a public URL for embedding in posts
/api/link-previewGETFetch Open Graph metadata for a URL to render inline link previews

Social & Discovery

EndpointMethodDescription
/api/profile/[id]GETRetrieve a cached Nostr profile (kind 0 metadata) by public key or NIP-05 identifier
/api/searchPOSTGlobal search across posts, profiles, articles, and hashtags
/api/trending/hashtagsPOSTReturn currently trending hashtags based on recent relay activity
/api/suggested-followsPOSTReturn a list of suggested accounts to follow based on the current user's network

Social Graph

EndpointMethodDescription
/api/followers/[pubkey]GETGet followers for a given public key
/api/following/[pubkey]GETGet following list for a given public key
/api/mutuals/[pubkey]GETGet mutual followers for a given public key
/api/following-feedGETFetch the following feed for the current user

Media & Files

EndpointMethodDescription
/api/blossom/recordPOSTRecord a Blossom file upload operation
/api/blossom/verifyPOSTVerify a Blossom media upload
/api/blossom/tierGETGet the storage tier for the current user

AI & Translation

EndpointMethodDescription
/api/ai/generate-imagePOSTGenerate an image from a text prompt (OpenAI DALL-E)
/api/ai/suggest-replyPOSTGet AI-suggested replies for a given post
/api/ai/summarizePOSTSummarise a post or article
/api/translatePOSTTranslate content between languages

Lightning

EndpointMethodDescription
/api/lightning/configurePOSTSet a Lightning address for the current user's profile
/api/lightning/nwcGETCheck Nostr Wallet Connect status
/api/lightning/nwc/payPOSTPay a Lightning invoice via NWC (coming soon)

Identity

EndpointMethodDescription
/api/nip05/registerPOSTRegister a NIP-05 identifier (e.g. handle@maskr.space) for the current user's public key
/api/nip05/checkGETVerify whether a NIP-05 identifier is available or already registered
/.well-known/nostr.jsonGETNIP-05 resolution endpoint — returns the public key for a given ?name= query parameter