---
title: "Create a draft"
method: POST
path: "/posts"
---

# Create a draft

`POST /posts`

## Request

- Base URL: `https://govir.app/api/v1`
- URL: `https://govir.app/api/v1/posts`
- Auth: HTTP bearer

Scope: `write`.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `account_ids` string[], required
  - `text` string: A single-part post. Send either text or parts.
  - `parts` object[]
    - `text` string
    - `media` object[]
      - `id` string, uuid, required
      - `alt_text` string, nullable
    - `link_attachment` string, nullable: A link shown as a preview card (text posts only).
    - `poll_options` string[], nullable
    - `text_attachment` object, nullable
      - `text` string, required: Long text under the post, up to 10,000 characters. Text parts only: not with media, a poll or a GIF.
      - `link_url` string, nullable: A link shown with the long text.
    - `gif` object, nullable
      - `id` string, required: A GIPHY GIF's id (giphy.com/gifs/…-<id>). Text parts only: not with media or a poll.
  - `topic` string, nullable
  - `reply_control` 'everyone' | 'accounts_you_follow' | 'mentioned_only' | 'parent_post_author_only' | 'followers_only', nullable
  - `part_numbers` 'off' | 'end' | 'start'
  - `quote_post_id` string, uuid, nullable: One of your published posts to quote (its Govir id). The first part needs text.

## Response `201`

Created

- PostGroup
  - `group_id` string, uuid, nullable
  - `posts` Post[]
    - `id` string, uuid
    - `status` 'draft' | 'scheduled' | 'publishing' | 'published' | 'partially_published' | 'failed' | 'needs_review' | 'deleted'
    - `account_id` string, uuid
    - `group_id` string, uuid, nullable
    - `scheduled_at` string, date-time, nullable
    - `published_at` string, date-time, nullable
    - `permalink` string, nullable
    - `topic` string, nullable
    - `reply_control` string, nullable
    - `part_numbers` string
    - `quote` object, nullable
      - `post_id` string, uuid
      - `permalink` string, nullable
      - `username` string
    - `error_code` string, nullable
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `parts` object[]
      - `position` integer
      - `text` string
      - `link_attachment` string, nullable
      - `poll_options` string[], nullable
      - `text_attachment` object, nullable
        - `text` string
        - `link_url` string, nullable
      - `gif` object, nullable
        - `id` string
        - `title` string
        - `width` integer
        - `height` integer
        - `url` string
      - `published` boolean
      - `media` object[]
        - `id` string, uuid
        - `kind` string
        - `url` string, nullable
        - `alt_text` string, nullable

## Other responses

- `400`: The request isn't valid
- `401`: No key, a wrong key, or a revoked one
- `402`: Your plan doesn't include this
- `403`: The key lacks the scope, or publishing right away isn't allowed
- `404`: Not found in your workspace
- `422`: The Idempotency-Key was used with another request
- `429`: Too many requests; see Retry-After

---

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