Skip to content

Document single-channel posts (API, MCP, webhooks) - #27

Open
paulocastellano wants to merge 2 commits into
mainfrom
docs/single-channel-posts
Open

paulocastellano wants to merge 2 commits into
mainfrom
docs/single-channel-posts

Conversation

@paulocastellano

Copy link
Copy Markdown
Contributor

Documents the contract change in trypostit/trypost#397 (merge post_platforms into posts). Merge together with that deploy, not before.

What changes

  • Post object (openapi.json): the PostPlatform schema and every platforms[] are gone. The channel fields sit at the top, in the order of app/Http/Resources/Api/PostResource.php:45-55. partially_published is removed from status (app/Enums/Post/Status.php), and publish_status is added (app/Enums/Post/PublishStatus.php).
  • Create / update post: top-level social_account_id (create only), content_type and meta. platforms is refused (app/Support/Requests/Post/PostRequestRules.php:58-68, :117-118).
  • Validation errors: meta.* / content_type on single posts, destinations.N.* on batches (app/Support/PostCompositionValidator.php, forSinglePost).
  • Preview and post metrics: one object each (app/Services/Post/PostPreviewer.php:44-75, app/Actions/Analytics/ReadPublicationAnalytics.php:38-47). Analytics uses post_id instead of post_platform_id. Each repurpose item post is {id, platform, publish_status} (app/Http/Resources/Api/RepurposeItemResource.php:24-28).
  • Webhooks: flat payload (app/Services/WebhookService.php:110-144). post.partially_published is removed, and stored subscriptions move to post.published + post.failed (database/migrations/2026_10_08_222943_backfill_posts_from_post_platforms.php:190-206). A replayed old delivery keeps its old payload.
  • MCP tools reference: create-post-tool arguments, the get/preview/metrics output, and the event list.
  • Platform pages: platforms[].meta.X becomes meta.X (rules unchanged, app/Support/PostPlatformMetaRules.php).
  • Publish overview: Partially Published removed from Sent (app/Actions/Post/BuildPublishPageProps.php:48).
  • Self-hosting / upgrading: new section "Upgrading past TryPost 2.0". Installs on v1.1.0 must stop at v2.0.0 and run release:trypost-2 first; the first new migration stops otherwise and rolls back (database/migrations/2026_10_08_222940_prepare_post_platforms_for_merge_into_posts.php).

Line numbers refer to the PR branch feat/merge-post-platforms-into-posts.

Before merging

  • The v2.0.0 tag/release must exist on trypostit/trypost (today the latest is v1.1.0). The upgrade page links to it.

Checks

  • npx mint validate: passed
  • npx mint broken-links: no broken links
  • python3 -m json.tool openapi.json: valid

A post has one channel, stored at the top of the post. The platforms
list, post.partially_published and post_platform_id are gone from the
REST API, MCP tools and webhooks.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant