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.

Sends a new message to another user in the community. If no conversation exists between the two users, one is automatically created.

URL Parameters

community_id
string
required
The unique identifier of the community

Request Body

recipient_id
string
required
The unique identifier of the message recipient
content
string
required
Message content (max 5,000 characters)

Returns

Returns the created message object.
curl -X POST https://api.onlydrams.app/api/v1/communities/abc123-def456/messages \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
       "recipient_id": "user-uuid-123",
       "content": "Hello! I wanted to reach out about the upcoming event."
     }'
{
  "id": "msg-uuid",
  "content": "Hello! I wanted to reach out about the upcoming event.",
  "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": "user-uuid-123",
    "username": "whisky_lover",
    "avatar_url": "https://storage.googleapis.com/onlydrams/avatars/user.jpg"
  }
}

Error Responses

403 Forbidden
object
Returned when:
  • The sender is not a member of the community
  • The recipient is not a member of the community
  • The recipient is blocked
  • A member tries to message another member (only creator ↔ member messaging allowed)
ERROR
{
  "message": ["You cannot send messages to this user"]
}
422 Unprocessable Entity
object
Returned when validation fails (e.g., content is blank or too long)
ERROR
{
  "message": ["Content can't be blank"]
}

Notes

  • Authorization: User must be an active member of the community or the community creator
  • Messaging Rules:
    • Creators can message any member
    • Members can only message the creator
    • Members cannot message other members
  • Conversation Creation: A conversation is automatically created if one doesn’t exist
  • Notifications: The recipient receives email and push notifications (if enabled)
  • Blocking: Messages cannot be sent to blocked users
  • Content Length: Maximum 5,000 characters