Scheduling

Schedule posts for a specific date, time, and timezone.

Schedule a Post

To schedule a post, include scheduledAt (ISO 8601 datetime) and optionally timezone (IANA timezone string) in your request. Omit publishNow or set it to false.

curl -X POST "https://api.postpeer.dev/v1/posts" \
  -H "x-access-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "This post will go live tomorrow morning!",
    "platforms": [
      { "platform": "twitter", "accountId": "abc123" }
    ],
    "scheduledAt": "2026-03-29T09:00:00",
    "timezone": "America/New_York"
  }'

Response:

{
  "success": true,
  "status": "scheduled",
  "postId": "post_xyz789",
  "scheduledFor": "2026-03-29T13:00:00.000Z",
  "platforms": [
    { "platform": "twitter", "success": true }
  ]
}

The scheduledFor field shows the UTC time the post will be published.

Timezone Support

Pass any IANA timezone string:

  • America/New_York
  • Europe/London
  • Asia/Jerusalem
  • Asia/Tokyo
  • UTC (default)

If no timezone is provided, scheduledAt is treated as UTC.

List Scheduled Posts

curl https://api.postpeer.dev/v1/posts/scheduled \
  -H "x-access-key: YOUR_API_KEY"

Response:

{
  "success": true,
  "posts": [
    {
      "postId": "post_xyz789",
      "content": "This post will go live tomorrow morning!",
      "scheduledFor": "2026-03-29T13:00:00.000Z",
      "timezone": "America/New_York",
      "platforms": [
        { "platform": "twitter", "status": "pending" }
      ],
      "createdAt": "2026-03-28T15:00:00.000Z"
    }
  ]
}

Posts are sorted by scheduledFor (ascending — next post first).

Cancel a Scheduled Post

curl -X DELETE "https://api.postpeer.dev/v1/posts/scheduled/post_xyz789" \
  -H "x-access-key: YOUR_API_KEY"

Response:

{
  "success": true,
  "message": "Post cancelled and moved to draft."
}

Returns 404 if not found, 409 if the post has already been published.

Reschedule a Post

curl -X PATCH "https://api.postpeer.dev/v1/posts/scheduled/post_xyz789" \
  -H "x-access-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "scheduledAt": "2026-03-30T14:00:00",
    "timezone": "Asia/Jerusalem"
  }'

Response:

{
  "success": true,
  "message": "Post rescheduled.",
  "scheduledFor": "2026-03-30T11:00:00.000Z"
}

On this page