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.

Updates an existing community post. Supports updating content, links, images, tier visibility, and polls.

URL Parameters

community_id
integer
required
The ID of the community
id
integer
required
The ID of the community post

Request Body

All fields are optional. Only provided fields will be updated.
title
string
Post title (max 200 characters)
content
string
Post content (max 10,000 characters)
External link URL
Link title
Link description
visible_to_all_tiers
boolean
Make visible to all tiers
visible_tier_ids
array
Array of tier IDs for visibility
images
array
Array of base64-encoded images (replaces all existing images)
poll_attributes
object
Poll update object with nested attributes

Poll Update

To update poll options, use nested attributes with id for existing options:
{
  "poll_attributes": {
    "question": "Updated question?",
    "poll_options_attributes": [
      {
        "id": 1,
        "option_text": "Updated option"
      },
      {
        "id": 2,
        "_destroy": true
      },
      {
        "option_text": "New option",
        "position": 3
      }
    ]
  }
}

Returns

Returns the updated community post object.
curl -X PATCH https://api.onlydrams.app/odis/v1/communities/1/posts/2 \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
       "title": "Updated Title",
       "content": "Updated content",
       "visible_to_all_tiers": true
     }'
{
  "id": 2,
  "title": "Updated Title",
  "content": "Updated content",
  "status": "draft",
  "visible_to_all_tiers": true,
  "visible_tier_names": ["All Tiers"],
  "updated_at": "2024-11-14T11:00:00Z"
}

Notes

  • Authorization: Community owner or admin only
  • Images: Setting new images replaces all existing images
  • Poll Options: Can be updated, added, or removed using nested attributes
  • Destruction: Use _destroy: true to remove poll options
  • Vote Integrity: Cannot modify poll options after votes are cast