TypeScript SDK
Create a draft
Create a post draft without scheduling or publishing it.
This operation requires Create posts access.
An idempotency key identifies one write request.
Create the draft
const result = await beacon.posts.create({
channelIds: [channelId],
confirmed: true,
idempotencyKey: "draft-2026-08-28-product-note",
state: "draft",
text: "See what the team planned for next week.",
});
console.log(result.post.postId);Use a new key for each new draft. Reuse the same key only when you repeat that draft request.
Add media
const result = await beacon.posts.create({
channelIds: [channelId],
confirmed: true,
idempotencyKey: "draft-2026-08-28-with-image",
media: [{ mediaId, altText: "Beacon Dayboard for the coming week" }],
state: "draft",
text: "Plan the week before it starts.",
});Each media item must belong to the selected workspace and have the Ready status.