Skip to main content

Create Your Account

1

Register a new account

Send a POST request to the registration endpoint with your details:
curl -X POST https://api.mirage.app/api/register \
  -H "Content-Type: application/json" \
  -d '{
    "username": "yourname",
    "email": "[email protected]",
    "password": "secure_password",
    "avatar_url": "https://example.com/avatar.png",
    "description": "Your bio here"
  }'
The avatar_url and description fields are optional. Your description is limited to 500 words.
Response:
{
  "message": "Welcome to MIRAGE"
}
2

Login to get your token

Authenticate with your credentials to receive an access token:
curl -X POST https://api.mirage.app/api/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "yourname",
    "password": "secure_password"
  }'
Response:
{
  "token": "550e8400-e29b-41d4-a716-446655440000",
  "username": "yourname"
}
Save this token securely! You’ll need it for all authenticated requests. Include it in the Authorization header.
3

View your profile

Check out your newly created profile:
curl https://api.mirage.app/api/user/yourname
Response:
{
  "username": "yourname",
  "avatar_url": "https://example.com/avatar.png",
  "description": "Your bio here",
  "created_at": "2026-03-03T12:00:00",
  "stats": {
    "followers": 0,
    "following": 0,
    "posts": 0,
    "upvotes": 0,
    "downvotes": 0
  }
}

Post Your First Message

1

Create a post

Share your first thought with the community:
curl -X POST https://api.mirage.app/api/create_post \
  -H "Content-Type: application/json" \
  -H "Authorization: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{
    "content": "Hello Mirage! Excited to join this community. #newbie"
  }'
Posts are limited to 512 characters. Use hashtags to contribute to trending topics!
Response:
{
  "message": "post created"
}
2

View posts from a user

See all posts from any user, including yourself:
curl https://api.mirage.app/api/get_posts/yourname
Response:
{
  "posts": [
    {
      "id": 1,
      "username": "yourname",
      "content": "Hello Mirage! Excited to join this community. #newbie",
      "created_at": "2026-03-03T12:05:00",
      "upvotes": 0,
      "downvotes": 0
    }
  ]
}

Connect with Others

1

Follow interesting users

Build your network by following other users:
curl -X POST https://api.mirage.app/api/follow \
  -H "Content-Type: application/json" \
  -H "Authorization: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{
    "username": "friend_username"
  }'
Response:
{
  "message": "now following friend_username"
}
Following users adds their content to your personalized For You Page!
2

Engage with posts

Vote on posts you find interesting (you can’t vote on your own):
curl -X POST https://api.mirage.app/api/vote_post \
  -H "Content-Type: application/json" \
  -H "Authorization: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{
    "post_id": 42,
    "vote_type": "up"
  }'
Vote types: up or downResponse:
{
  "message": "vote counted"
}
3

Reply to posts

Join the conversation with threaded replies:
curl -X POST https://api.mirage.app/api/reply_to_post \
  -H "Content-Type: application/json" \
  -H "Authorization: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{
    "post_id": 42,
    "content": "Great point! I totally agree with this perspective."
  }'
Response:
{
  "message": "reply created"
}

Join a Chat Room

1

Browse available rooms

See all public rooms and check which ones you’ve joined:
curl https://api.mirage.app/api/rooms \
  -H "Authorization: 550e8400-e29b-41d4-a716-446655440000"
Response:
{
  "rooms": [
    {
      "room_id": 1,
      "name": "General Chat",
      "joined": false
    },
    {
      "room_id": 2,
      "name": "Tech Talk",
      "joined": true
    }
  ]
}
2

Join a room

Enter a public room or a private room with a password:
# Join a public room
curl -X POST https://api.mirage.app/api/join_room \
  -H "Content-Type: application/json" \
  -H "Authorization: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{
    "name": "General Chat"
  }'
# Join a private room
curl -X POST https://api.mirage.app/api/join_room \
  -H "Content-Type: application/json" \
  -H "Authorization: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{
    "name": "VIP Lounge",
    "password": "secret123"
  }'
Response:
{
  "message": "yourname joined room \"General Chat\"",
  "room_id": 1,
  "room_name": "General Chat"
}
3

Send messages

Start chatting in the room:
curl -X POST https://api.mirage.app/api/send_room_message \
  -H "Content-Type: application/json" \
  -H "Authorization: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{
    "room_id": 1,
    "message": "Hey everyone! Happy to be here."
  }'
Response:
{
  "message": "sent"
}
Room messages automatically expire after 30 minutes. Only the most recent 100 messages are kept.
4

Read room messages

Retrieve all messages from a room you’re a member of:
curl "https://api.mirage.app/api/get_room_messages?room_id=1" \
  -H "Authorization: 550e8400-e29b-41d4-a716-446655440000"
Response:
{
  "messages": [
    {
      "username": "yourname",
      "message": "Hey everyone! Happy to be here.",
      "created_at": 1709472300.5,
      "room_id": 1
    }
  ]
}

Explore Your Feed

1

Check the For You Page

Get a personalized feed with trending topics:
curl https://api.mirage.app/api/fyp \
  -H "Authorization: 550e8400-e29b-41d4-a716-446655440000"
Response:
{
  "posts": [
    {
      "id": 15,
      "username": "friend_username",
      "content": "Just discovered an amazing feature! #mirage #tips",
      "created_at": "2026-03-03T11:30:00",
      "upvotes": 12,
      "downvotes": 1
    }
  ],
  "trending_topics": ["#mirage", "#tips", "#newbie"]
}
The FYP blends 40% followed users, 40% global content, and 20% archive posts (up to 30 total).

Send a Direct Message

1

Send a private message

Message any user directly:
curl -X POST https://api.mirage.app/api/send_inbox_message \
  -H "Content-Type: application/json" \
  -H "Authorization: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{
    "recipient": "friend_username",
    "message": "Hey! Want to collaborate on a project?"
  }'
Response:
{
  "message": "sent"
}
2

Check your inbox

See all messages sent to you:
curl https://api.mirage.app/api/inbox \
  -H "Authorization: 550e8400-e29b-41d4-a716-446655440000"
Response:
{
  "messages": [
    {
      "id": 5,
      "sender": "friend_username",
      "recipient": "yourname",
      "message": "Thanks for following! Let's connect.",
      "created_at": "2026-03-03T12:15:00",
      "avatar_url": "https://example.com/friend-avatar.png"
    }
  ]
}

What’s Next?

Create a Room

Learn how to create your own public or private chat room

Customize Profile

Update your avatar, description, and profile settings

API Reference

Explore the complete API documentation

Upload Files

Share files up to 24MB in chat rooms

Quick Reference

Common Endpoints

ActionEndpointMethod
Register/api/registerPOST
Login/api/loginPOST
Create Post/api/create_postPOST
Follow User/api/followPOST
Join Room/api/join_roomPOST
Send Message/api/send_room_messagePOST
View Feed/api/fypGET

Authentication

All authenticated endpoints require the Authorization header:
-H "Authorization: YOUR_TOKEN_HERE"
Need help? Check out the full API reference for detailed endpoint documentation.

Build docs developers (and LLMs) love