Documentation

Stories

Ephemeral 24-hour content with view tracking.

A story is a short-lived post — image, video, or short text — that auto-expires 24 hours after creation. Stories live in their own collection (community_story) and never appear in the main feed; the customer UI typically renders them as a horizontal carousel grouped by author.

Endpoints

GET/client/community/storiesNo auth
POST/client/community/storiesJWT
POST/client/community/stories/:storyId/viewJWT
DELETE/client/community/stories/:storyIdJWT

Listing stories

GET /client/community/stories returns all currently active stories (TTL not yet hit), grouped by author email. Pass ?page=<pageId> to scope to a community page.

const res = await fetch('/client/community/stories', {
  headers: { orgid: 'my-org' },
});
const groups = await res.json();
// [{ author: 'alice@...', authorInfo: {...}, stories: [...] }, ...]

Creating a story

await fetch('/client/community/stories', {
  method: 'POST',
  headers: {
    orgid: 'my-org',
    Authorization: `Bearer ${customerJwt}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    page: 'optional-page-id',
    content: {
      type: 'image',
      url: 'https://cdn/.../story.png',
      caption: 'Friday studio dump',
    },
    duration: 86400, // seconds; default 24h
  }),
});

The story record carries an expiresAt timestamp; a scheduled sweeper purges expired stories from the listing endpoint. Direct reads via /data/community_story/:id will still return the record until it's deleted, which is useful for analytics.

View tracking

await fetch(`/client/community/stories/${storyId}/view`, {
  method: 'POST',
  headers: { orgid: 'my-org', Authorization: `Bearer ${customerJwt}` },
});

The service appends the viewer's email + timestamp to the story's views array. Re-viewing the same story is idempotent — only the first view is recorded.

Reactions

Stories use the same unified /client/community/react endpoint with targetType: 'story'. See Posts and feed.

Deleting

DELETE /client/community/stories/:storyId removes a story before its TTL. Only the author can delete their own story; admins use the moderation endpoints (see Moderation and blocking).

Stories are intentionally not part of the feed query — they have their own listing pattern and viewer state. If you need them inline with regular posts, post them as community_post instead.