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.

Creates a new community post with optional content, links, images, and polls.

URL Parameters

community_id
integer
required
The ID of the community

Request Body

title
string
required
Post title (max 200 characters)
content
string
Post content with HTML formatting (max 10,000 characters)
External link URL
Link title (max 100 characters)
Link description (max 500 characters)
status
string
Post status: draft, published, or archived (default: draft)
visible_to_all_tiers
boolean
Make visible to all tiers (default: true)
visible_tier_ids
array
Array of tier IDs that can see this post (only if visible_to_all_tiers is false)
images
array
Array of base64-encoded images
poll_attributes
object
Poll configuration object (optional)

Poll Attributes

poll_attributes.question
string
required
Poll question (max 500 characters)
poll_attributes.multiple_choice
boolean
Allow multiple selections (default: false)
poll_attributes.expires_at
string
Poll expiration date (ISO 8601 timestamp)
poll_attributes.poll_options_attributes
array
required
Array of poll options (2-10 options required)

Returns

Returns the created community post object.
curl -X POST https://api.onlydrams.app/odis/v1/communities/1/posts \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
       "title": "New Post Title",
       "content": "<p>Post content with HTML formatting...</p>",
       "link_url": "https://example.com/related",
       "link_title": "Related Content",
       "link_description": "Check this out",
       "status": "draft",
       "visible_to_all_tiers": false,
       "visible_tier_ids": [1, 2],
       "images": ["data:image/png;base64,...", "data:image/jpeg;base64,..."],
       "poll_attributes": {
         "question": "What'\''s your favorite?",
         "multiple_choice": false,
         "expires_at": "2024-12-01T00:00:00Z",
         "poll_options_attributes": [
           {
             "option_text": "Option 1",
             "position": 1
           },
           {
             "option_text": "Option 2",
             "position": 2
           }
         ]
       }
     }'
{
  "id": 2,
  "title": "New Post Title",
  "content": "<p>Post content with HTML formatting...</p>",
  "status": "draft",
  "published_at": null,
  "link_url": "https://example.com/related",
  "link_title": "Related Content",
  "link_description": "Check this out",
  "visible_to_all_tiers": false,
  "has_poll": true,
  "has_link": true,
  "has_images": true,
  "image_count": 2,
  "image_urls": [
    "https://storage.googleapis.com/onlydrams/posts/2_img1.jpg",
    "https://storage.googleapis.com/onlydrams/posts/2_img2.jpg"
  ],
  "visible_tier_names": ["Bronze Member", "Gold Member"],
  "user": {
    "id": 100,
    "username": "whisky_master"
  },
  "community": {
    "id": 1,
    "name": "Whisky Enthusiasts"
  },
  "poll": {
    "id": 2,
    "question": "What's your favorite?",
    "multiple_choice": false,
    "expires_at": "2024-12-01T00:00:00Z",
    "total_votes": 0,
    "poll_options": [
      {
        "id": 3,
        "option_text": "Option 1",
        "position": 1,
        "vote_count": 0
      },
      {
        "id": 4,
        "option_text": "Option 2",
        "position": 2,
        "vote_count": 0
      }
    ]
  },
  "created_at": "2024-11-14T10:30:00Z",
  "updated_at": "2024-11-14T10:30:00Z"
}

Notes

  • Authorization: Community owner or admin only
  • Content Requirement: Must have at least one of: content, link_url, or poll
  • Poll Validation: Must have 2-10 options; expiration must be in future
  • Tier Visibility: Visible tiers must belong to the same community
  • Images: Automatically uploaded to cloud storage
  • Status: New posts default to draft status