Skip to content
Menu
DocsSDKPosts

Posts

Updated Oct 2026·1 min

Create and publish posts across connected channels, using the same composer pipeline the app uses, from code.

The composer with per-channel editors, a quality score, and the Review & Publish panel.The composer with per-channel editors, a quality score, and the Review & Publish panel.

Quick example

Type-checked against @medalsocial/sdk v1.3.0 (2026-07-20). A release that changes a signature fails this page's build.

ts
import { Medal } from '@medalsocial/sdk';

const medal = new Medal(process.env.MEDAL_API_KEY as string);

// Create a draft targeting connected channels
const { data: post } = await medal.posts.create({
  content: 'Our Midsummer Blend is back — bright, honeyed, small batches.',
  channel_ids: ['ch_1', 'ch_2'],
});

// Schedule it (ISO 8601 or epoch millis)
await medal.posts.schedule(post.id, {
  scheduled_at: '2026-08-01T09:00:00Z',
});

// …or publish immediately
await medal.posts.publish(post.id);

// List recent posts, newest first
const { data: posts, pagination } = await medal.posts.list({ limit: 20 });
console.log(posts.length, 'posts, more:', pagination.has_more);

medal.posts.list()

List posts with cursor-based pagination and optional filters.

ts
list(options?: ListPostsOptions): Promise<PaginatedResponse<Post>>
Added in v1.0.0

medal.posts.create()

Create a new post with content and target channels.

ts
create(input: CreatePostInput): Promise<ApiResponse<{ id: string; }>>
Added in v1.0.0

medal.posts.get()

Get a post by ID, including its per-channel variants.

ts
get(id: string): Promise<ApiResponse<PostDetail>>
Added in v1.0.0

medal.posts.update()

Update a draft post's title or content.

ts
update(id: string, input: UpdatePostInput): Promise<ApiResponse<{ success: boolean; }>>
Added in v1.0.0

medal.posts.remove()

Delete a post.

ts
remove(id: string): Promise<ApiResponse<{ success: boolean; }>>
Added in v1.0.0

medal.posts.schedule()

Schedule a post for future publication.

ts
schedule(id: string, input: SchedulePostInput): Promise<ApiResponse<ScheduleResult>>
Added in v1.0.0

medal.posts.publish()

Publish a post immediately to all target channels.

ts
publish(id: string): Promise<ApiResponse<PublishResult>>
Added in v1.0.0

medal.posts.channels()

List connected publishing channels for this workspace.

ts
channels(): Promise<ApiResponse<Channel[]>>
Added in v1.0.0