Skip to main content

Documentation Index

Fetch the complete documentation index at: https://api.docs.onlydrams.app/llms.txt

Use this file to discover all available pages before exploring further.

ENDPOINTS
GET /api/v1/communities/:community_id/messages/conversations
GET /api/v1/communities/:community_id/messages/:user_id
POST /api/v1/communities/:community_id/messages
DELETE /api/v1/communities/:community_id/messages/:id

Overview

Community messaging allows community creators and members to communicate with each other. Messages are organized into conversations between two users within a community context.

Key Features

  • Creator ↔ Member Messaging: Creators can message members, and members can message creators
  • No Member-to-Member: Members cannot message other members directly
  • Conversation History: Message history remains visible even if membership ends
  • Blocking: When a creator blocks a member, the conversation disappears from both users’ views
  • Message Deletion: Users can delete their own messages, but only if it’s the last message in a conversation
  • Notifications: Email and push notifications are sent when messages are received (if enabled)

Authentication

Authorization levels:
  • Community Creator: Can message any member of their community
  • Community Member: Can message the community creator
  • Blocked Members: Cannot send or receive messages

Conversation Object

{
  "id": "abc123-def456-...",
  "updated_at": "2024-12-01T10:30:00Z",
  "user": {
    "id": "user-uuid",
    "username": "whisky_lover",
    "avatar_url": "https://storage.googleapis.com/onlydrams/avatars/user.jpg"
  },
  "latest_message": {
    "id": "msg-uuid",
    "content": "Thanks for the update!",
    "created_at": "2024-12-01T10:30:00Z",
    "sender": {
      "id": "sender-uuid",
      "username": "community_creator",
      "avatar_url": "https://storage.googleapis.com/onlydrams/avatars/creator.jpg"
    }
  }
}

Message Object

{
  "id": "msg-uuid",
  "content": "Hello! How can I help?",
  "created_at": "2024-12-01T10:30:00Z",
  "updated_at": "2024-12-01T10:30:00Z",
  "sender": {
    "id": "sender-uuid",
    "username": "community_creator",
    "avatar_url": "https://storage.googleapis.com/onlydrams/avatars/creator.jpg"
  },
  "recipient": {
    "id": "recipient-uuid",
    "username": "whisky_lover",
    "avatar_url": "https://storage.googleapis.com/onlydrams/avatars/member.jpg"
  }
}

Access Control

  • Users must be active members of the community (or the creator) to access messages
  • Conversations are only visible to the two participants
  • Blocked conversations are hidden from both users
  • Historical messages remain accessible even after membership ends, but new messages cannot be sent

Notifications

When a message is received:
  • Email notification is sent if the recipient has messages.email preference enabled
  • Push notification is sent if the recipient has messages.push preference enabled
  • Notifications are only sent if the recipient is an active member

Message Deletion

  • Users can only delete their own messages
  • Only the last message in a conversation can be deleted
  • When the last message is deleted, the entire conversation disappears from both users’ conversation lists
  • If a conversation has no messages remaining, it is effectively removed