---
title: "Update a draft or scheduled post"
method: PUT
path: "/api/posts/{id}"
---

# Update a draft or scheduled post

`PUT /api/posts/{id}`

## Request

- Base URL: `https://octopost.ink`
- URL: `https://octopost.ink/api/posts/{id}`
- Auth: HTTP bearer

## Request body

- CreatePost
  - `content` string, required: Main post text. X counts links as 23 characters.
  - `platforms` Platform[], required
  - `scheduledFor` string, date-time, nullable: ISO 8601 with a timezone offset.
  - `published` boolean: true = publish now.
  - `queueStatus` 'queued' | 'pending' | 'null', nullable: queued = interval queue; pending = wait for approval.
  - `mediaUrls` Media[]
    - union
      - string, uri
      - object
        - `url` string, uri, required
        - `altText` string
  - `segments` object[]: Thread replies after the main post.
    - `content` string, required
    - `mediaUrls` Media[]
      - union
        - string, uri
        - object
          - `url` string, uri, required
          - `altText` string
  - `poll` object
    - `options` string[]
    - `durationMinutes` integer

## Response `200`

Updated

- object
  - `post` Post
    - `id` string
    - `content` string
    - `platforms` string[]
    - `scheduledFor` string, nullable
    - `published` boolean
    - `queueStatus` string, nullable
    - `platformPostIds` object, nullable: Per network: id, url, or error.
    - `createdAt` string

## Other responses

- `400`: Validation error, or the post is already published.
- `401`: Missing or invalid API key. Send `Authorization: Bearer op_...` with the key from https://octopost.ink/dashboard/api-keys.
- `404`: No post with this id in this account.
- `429`: Rate limited (per minute per IP; publishing 50/hour). Retry after the `Retry-After` seconds.
- `500`: Server error. Safe to retry; email hello@greatwork.company if it persists.

---

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