---
title: "Preview or atomically create a scheduled calendar"
method: POST
path: "/v1/posts/calendar"
tags: ["Posts"]
---

# Preview or atomically create a scheduled calendar

`POST /v1/posts/calendar`

## Request

- Base URL: `https://api.postlake.dev`
- URL: `https://api.postlake.dev/v1/posts/calendar`
- Auth: `bearerAuth` (a scheme the document does not define)

Validate 1 to 200 scheduled posts as a batch. Preview with dryRun=true, then apply with the returned snapshot and a unique idempotencyKey. Either every post and the receipt are stored or none are. A cadence may assign UTC instants from startAt and everyMinutes; omit it to give each post its own scheduledAt. Credits are charged when posts publish, not when the calendar is created. Timer arming is best-effort, with the due-post runner as a backstop.

## Request body

- object
  - `posts` object[], required: Normal POST /v1/posts bodies with a future scheduledAt, unless cadence assigns the times. Drafts and partial destinations are not accepted.
    - `text` string, required
    - `accounts` string[]
    - `profile` string
    - `platforms` string[]
    - `scheduledAt` string, date-time
    - `timezone` string
    - `media` string[]
    - `textOverrides` object
    - `campaign` string
    - `assetMetadata` object
    - `platformOptions` object
  - `cadence` object
    - `startAt` string, date-time, required: Timezone-qualified start instant.
    - `everyMinutes` integer, required: Elapsed minutes between consecutive posts.
  - `dryRun` boolean, required
  - `snapshot` string: Required for apply; return value from preview.
  - `idempotencyKey` string: Required for apply; 8 to 128 letters, digits, underscores or hyphens.

## Response `200`

Preview with exact UTC slots and snapshot.

- object
  - `dryRun` boolean
  - `snapshot` string
  - `matched` integer
  - `results` object[]

## Other responses

- `201`: All posts created, or a safe idempotent replay.
- `400`: A calendar entry or destination is invalid. No posts created.
- `409`: Stale preview or conflicting idempotency key. No new posts created.

---

[API](https://skmtc.dev/postlake/apis/postlake-api.md) · [All operations](https://skmtc.dev/postlake/apis/postlake-api/llms.txt) · [OpenAPI document](https://skmtc.dev/postlake/apis/postlake-api/revisions/f81060e31f69?raw)
