Social Post Discovery, Updates, Likes and Assets
These APIs supplement the nested social-stream post resource. Configure streams, moderation and the installed app's permissions through Communication and AI first. A registered route or returned URL is not proof a post is approved, a caller may act as an attendee, or an asset can be downloaded.
Context and identifiers
Use the supported project API or portal integration context for the intended host and caller. Preserve effective page/resource grants and project scope; Project API Keys describes retained key-enforcement limitations. Do not place management secrets in public app code.
All paths below follow /api/v1/projects/{teamSlug}/{projectSlug}. Team/project are slugs; social stream and post identifiers on these nested routes are numeric IDs. The like route's stream/post segments have numeric constraints. Asset routes use numeric handler arguments even though the placeholder spelling is {socialStream} in registration.
Discover posts across scoped streams
GET /social-streams/posts is a distinct cross-parent discovery route, registered before the stream resource's individual lookup. When a compiled permission plan exists, its social-stream abilities must allow view_social_stream_posts (including supported scope suffixes), otherwise it aborts with 404. With no plan, the reviewed ability/slot helpers pass through; this controller does not independently require a plan. The query constrains parent streams to the resolved project when present and applies the slot's row scope. It differs from parent-anchored /social-streams/{id}/posts and stream includes.
At develop commit 25e1564 (reviewed 2026-10-19), if the effective social-stream grant for viewing posts is own-only, this discovery query additionally narrows posts to the signed-in attendee. With no attendee it matches no posts. This is separate from parent-stream/project row scope and response-field filtering. A broader applicable grant can prevent the own-only condition; adding an own grant is not a redaction policy or an approval filter.
The limit parameter defaults to 25 and is capped at 100; choose a positive value. The handler does not clamp a lower bound. Results use a paginated data/links/meta envelope and the social post resource's field-scope filter. Fields can include approval, caption/media, metadata and loaded relationships; do not assume every field is always present or a fixed redacted attendee projection.
Approval boundary: this discovery controller adds no explicit is_approved filter. An approval field in the serialized resource does not establish that unapproved posts were excluded server-side. Verify the actual audience/approval query behavior before using it as a public moderated feed; client hiding alone is not a disclosure boundary.
Update post content, approval and attendee tags
Use PUT or PATCH /social-streams/{social_stream}/posts/{post} on the project base above, with numeric stream and post row IDs. Supply the post ID explicitly; this is not an upsert or a request to update every post. The child is fetched through its parent's posts relation and the parent is project-scoped. The base update gate is update_social_stream_posts through the post policy and applicable context. The request's authorize method returns true because the controller handles authorization; that is not anonymous write permission. The controller does not independently compare post author with current attendee. Verify actual owner/nonowner, page/data scope and foreign-project/stream refusal before enabling edits for untrusted callers.
Both methods share a partial updater. With ordinary stream rules, a synthetic caption edit is:
{
"caption": "Updated partner announcement"
}
Selected base fields include poster_name (string), caption (nullable string), metadata (array after preparation), is_approved (boolean), approval actor/time fields, upload_status and file/attachment inputs. tagged_attendees is added by the request. Stream validation_rules can add or tighten rules, including making caption required on update, so the reference's client schema is not a guarantee every stream accepts a body. Parent/author IDs are not base update fields; a static model field list is not the complete configured request contract.
Metadata preparation differs from ordinary partial updates
Preparation reconstructs metadata on every request. It decodes custom metadata only when the incoming metadata value is a JSON string, optionally adds a string user_session, and assigns request_host from the request Host header. The supplied host/session are request context, not verified attendee identity. A JSON object supplied under metadata does not retain its custom keys in this code path. Omitting metadata still supplies a new object containing request_host, so a caption-only update can replace previously stored custom metadata rather than preserving it.
If an authorized integration must retain metadata, read the allowed current value, deliberately merge intended keys on the client and encode the resulting object as a JSON string for this request. For example, this synthetic body illustrates encoding only; it does not preserve unrelated keys or verify a real record:
{
"metadata": "{\"integration\":\"documentation-example\"}"
}
Use a valid JSON object, not a scalar or malformed JSON string. The selected rules validate the prepared array, not a complete domain-specific metadata schema. Concurrent writers can still overwrite each other; this path supplies no version precondition or idempotent receipt. Verify actual stored metadata and do not copy private response fields into public clients, logs or analytics.
Approval and tagging are separate effects
Send is_approved as an actual JSON boolean. Preparation uses truthiness: the string false is truthy and becomes approved, so do not send it as an alternative to boolean false. Supplying is_approved true stamps the authenticated actor's short class name, ID and current time; false clears those actor/time values. This stamping is not an additional ownership or moderation permission check. The reviewed controller/request adds no separate approval gate beyond its update authorization. Raw approval actor/time fields are also selected by base rules and can be supplied without is_approved, so do not treat them as an immutable audit trail. The supported client body excludes those manual actor/time keys. Restrict moderation writes through the intended server-side grants and verify actual principal behavior. Omitting is_approved on an existing post does not auto-approve it merely because the stream auto-approves new posts.
For tagged_attendees, use distinct attendee IDs from this project. The custom rule checks that every submitted value exists in the project; repeated IDs can fail its count comparison. An omitted or null list skips tag synchronization. An empty array synchronizes to no attendee tags, while a nonempty list replaces the attendee-tag set rather than appending to it. Tags for other model types are separate. New attendee-tag events are dispatched by afterSave only when the post is approved and new tags were added.
The post saves before afterSave tag synchronization. Approval observers can emit events for existing tags during save, followed by events for newly added tags after synchronization. Do not infer exactly-once recipient delivery from one accepted combined approval/tag update. A later tag/cache/event/refetch/serialization failure can leave the post and earlier effects persisted; tag removal/upsert is not enclosed in a whole-request transaction here, and outer Orion transactions are disabled. Reconcile post approval/content/metadata, actual tags and downstream processing before retrying an uncertain result.
Media and returned content
Attachment input is remapped to file_path after supported base64 preparation. The FileOrArray rule accepts an uploaded file or an array with a truthy large_upload marker; it does not by itself validate a complete upload descriptor. A plain storage path string is not a valid replacement through that rule. The JSON content/tag/moderation client example excludes file transfer and caller-set upload_status. Use the supported upload workflow and verify byte transfer, malware/moderation, variants and actual downloads separately. Changing post data or receiving an upload URL is not completed media processing.
A successful update returns the scoped social-post resource in data. The serializer exposes conditional content/media/approval/metadata and loaded attendee/tag/like fields subject to its output scope; it is not a fixed public-safe projection. It does not echo every writable control. Inspect the returned and freshly read post as the intended caller, including unapproved/private cases, before showing it in a feed. Test stream-specific validation, metadata object/string behavior, allowed/denied moderation, omitted/null/empty tags, partial failures and actual media/event delivery in an authorized environment. Isolated preparation/rule checks do not establish those deployed outcomes.
Like routes and current limitations
The registered routes are GET /social-streams/{social_stream}/posts/{post}/likes and POST /social-streams/{social_stream}/posts/{post}/likes/toggle. Their intended lookup constrains stream/post to the route project. The list defaults to 50 per page and caps at 200, without an explicit lower clamp; use positive values. It loads attendee relationships, so output/privacy needs caller-specific acceptance.
Route dispatch limitation: both handlers omit the leading team/project slug parameters in their method signatures. The reviewed Laravel dispatcher passes route values positionally, so slug strings can occupy the integer stream/post arguments and fail before the intended lookup. Require an implementation correction and actual project-prefixed HTTP tests before relying on either operation. Direct controller/service tests do not establish route dispatch.
The toggle request accepts either a UUID session_id or a numeric project attendee ID, plus optional user_name up to 255 characters. This synthetic request describes the session branch; it is not sent here:
{
"session_id": "6fb3a098-1a40-4fa2-b8e9-d645a81e6706",
"user_name": "Documentation Test"
}
Identity/permission boundary: the request checks attendee existence in the project, but does not bind a supplied attendee ID to the authenticated caller. The controller does not invoke a post policy or explicit approval/tag-visibility check. A session UUID is caller-supplied correlation, not verified attendee identity. Require effective server-side ownership/action/visibility enforcement before exposing this write or liker data to untrusted callers. It is not a substitute for the documentation feedback survey.
The service prefers attendee identity when supplied; otherwise it matches session ID among attendee-less likes. Toggle creates a missing like or removes an existing one, returning data.action (liked/unliked), data.like_count and the created like or null. A duplicate-create database race can also take the unlike branch. Retrying is not idempotent: do not blindly replay a timed-out toggle, because it can undo the intended state. Reconcile through a verified read before presenting success or deciding another action.
Fetch asset variants
The four shortcut GET paths end in /thumbnail, /medium, /large or /original after /social-streams/{socialStream}/posts/{post}. GET /assets/{assetType} supports those plus:
video-small-thumbnail, video-large-thumbnail, hd, fhd, sd, manifest,
large-sprite, small-sprite, transcription,
thumbnail-overlay, medium-overlay, large-overlay
These selectors request a stored variant; they do not create/transcode it or guarantee every post has it. Unknown type returns 400 with valid_types; missing project/stream/post or unavailable mapped path returns 404.
The intended default result is a 303 redirect, not JSON or the asset bytes from this controller. It signs the mapped path for five minutes through the direct storage disk. To request a direct JSON object instead, send ?return_url=1:
{
"url": "https://assets.example.invalid/synthetic-signed-object"
}
Use 1 for URL mode and omit the query for redirect mode. The handler uses raw query truthiness, not a boolean validator: the string false is truthy and can select JSON mode. A 303 is not a credential/privacy guarantee for every client. Use normal safe redirect handling and do not manually forward API credentials to storage hosts. Signed URLs expire; fetch a new one through the authorized endpoint rather than persisting it as a permanent asset URL. The signing helper does not verify file existence or successful storage delivery.
Lookup/authorization limitations: the asset controller queries projects.team_slug directly, while the inspected model/migrations use the team relation and the similarly named service value is a derived lookup field. No persisted team_slug project column was found in this source review. Verify/fix that lookup against the deployed schema before relying on asset routes. The handler also adds no explicit post policy, approval or tag-visibility check; nested existence alone does not establish the intended audience boundary. These are source findings, not executed storage/HTTP tests.
Verify the consuming integration
After required implementation fixes, test actual project-prefixed routes with allowed and denied identities, wrong project/stream/post, unapproved/hidden posts and liker field output. For toggle, use one approved test subject and verify create/remove and uncertain-response behavior without replay loops. For assets, test 303 versus return_url=1, unsupported/missing variants, actual storage retrieval and refresh after expiry. Keep URLs/tokens and attendee payloads out of public diagnostic reports.
The REST reference records the reviewed operations with these limitations. Retained source snapshots, schema/examples and isolated preparation checks do not close route dispatch, identity, approval, project/schema, persistence or storage acceptance. No post, like, attendee, asset or feedback record is changed by this guide.