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/posts/:id
POST /api/v1/communities/:community_id/posts
PATCH /api/v1/communities/:community_id/posts/:id
DELETE /api/v1/communities/:community_id/posts/:id

Overview

Community posts allow community creators to share content with their members. Posts support rich content including HTML text, external links, images, and interactive polls. This API is designed for mobile app consumption.

Authentication

Authorization levels:
  • Community Owner: Full access to create, edit, and delete posts
  • Admin: Full access to all community posts
  • Community Member: Read access to posts visible to their tier

Community Post Object

{
  "id": "abc123-def456-...",
  "title": "Welcome to the Community!",
  "content": "<p>This is the first post...</p>",
  "status": "published",
  "published_at": "2024-11-01T10:00:00Z",
  "link_url": "https://example.com/article",
  "link_title": "Related Article",
  "link_description": "Check out this article...",
  "post_type": "text",
  "has_poll": true,
  "has_link": true,
  "has_images": true,
  "image_urls": ["https://...", "https://..."],
  "like_count": 42,
  "liked_by_current_user": false,
  "requires_upgrade": false,
  "scheduled": false,
  "user": {
    "id": "user-uuid",
    "username": "whisky_master",
    "avatar_url": "https://storage.googleapis.com/onlydrams/avatars/user.jpg"
  },
  "poll": {
    "id": 1,
    "question": "What's your favorite whisky type?",
    "multiple_choice": false,
    "expires_at": "2024-11-15T00:00:00Z",
    "poll_options": [...]
  },
  "created_at": "2024-11-01T09:30:00Z",
  "updated_at": "2024-11-01T10:00:00Z"
}

Post Status

Posts have three possible statuses:
  • draft - Not visible to members, work in progress
  • published - Visible to members based on tier visibility settings
  • archived - Hidden from members but preserved

Content Types

Posts must have at least one of:
  • Text Content: HTML-formatted content (max 10,000 characters)
  • External Link: URL with optional title and description
  • Poll: Interactive voting component
Posts can also include:
  • Images: Up to 10 images (uploaded as base64)
  • Mixed Content: Combination of text, links, images, and polls

Tier Visibility

Control which members can view posts:
  • All Tiers: Set visible_to_all_tiers: true
  • Specific Tiers: Set visible_to_all_tiers: false and provide visible_tier_ids array
  • Access Control: Members can only see posts visible to their subscribed tier

Content Access

For members without access to a post:
  • Content is replaced with placeholder text
  • Link URLs are hidden
  • Poll data is hidden
  • Images are not returned
  • requires_upgrade flag is set to true

Polls

Posts can include interactive polls with:
  • Question: Main poll question (max 500 characters)
  • Options: 2-10 answer choices
  • Voting Mode: Single choice or multiple choice
  • Expiration: Optional expiration date

Images

Images can be attached to posts:
  • Format: Base64-encoded strings
  • Limit: Maximum 10 images per post
  • Supported Types: PNG, JPEG, GIF, WebP
  • Storage: Automatically uploaded to cloud storage