> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trypost.it/llms.txt
> Use this file to discover all available pages before exploring further.

# Create post

> Create a new draft post targeting one or more social accounts. Returns the created post with status 201.

Creates a `draft`. To schedule or publish, follow up with [`PUT /posts/{post}`](/api-reference/endpoint/update-post) using `status=scheduled` or `status=publishing`.

<Note>
  Per-platform settings go in `platforms[].meta` and are accepted here on create (and on [`PUT /posts/{post}`](/api-reference/endpoint/update-post)). A few are **required to publish** — Pinterest `board_id`, TikTok `privacy_level`, Discord `channel_id` — but they're only enforced when you move the post to `scheduled`/`publishing`, not on this draft create. See [`PUT /posts/{post}`](/api-reference/endpoint/update-post) for the full `meta` reference.
</Note>

## Request

<ParamField body="platforms" type="array" required>
  At least one platform entry. Each entry pins this post to a connected social account and a `content_type`.

  <Expandable>
    <ParamField body="social_account_id" type="string" required>
      UUID of an active social account in the current workspace. Inactive or external accounts are rejected.
    </ParamField>

    <ParamField body="content_type" type="string" required>
      Format for this platform — must match the social account's platform. Discover the catalog with [`GET /content-types`](/api-reference/endpoint/list-content-types).

      Allowed values: `linkedin_post`, `linkedin_carousel`, `linkedin_page_post`, `linkedin_page_carousel`, `x_post`, `facebook_post`, `facebook_reel`, `facebook_story`, `instagram_feed`, `instagram_carousel`, `instagram_reel`, `instagram_story`, `tiktok_video`, `tiktok_photo`, `youtube_short`, `threads_post`, `pinterest_pin`, `pinterest_video_pin`, `pinterest_carousel`, `bluesky_post`, `mastodon_post`, `telegram_post`, `discord_message`.
    </ParamField>

    <ParamField body="meta" type="object">
      Optional per-platform settings (Instagram/Facebook `aspect_ratio`, TikTok `privacy_level` + flags, Pinterest `board_id`, Discord `channel_id`/`mentions`/`embeds`, …). Stored on the post platform and merged on update. See [`PUT /posts/{post}`](/api-reference/endpoint/update-post) for the full per-platform reference.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="content" type="string">
  The post body shared across all platforms. Up to 10 000 characters at the API level (per-platform hard caps are enforced separately — see [`GET /content-types`](/api-reference/endpoint/list-content-types) for the matrix). Defaults to empty.
</ParamField>

<ParamField body="media" type="array">
  Media items to attach to the post. Each item should match the shape returned by [`POST /posts/{post}/media`](/api-reference/endpoint/upload-media) — `id`, `path`, `url`, `type`, `mime_type`, `original_filename`. Most callers use the dedicated upload or [attach-from-URL](/api-reference/endpoint/attach-media-from-url) endpoint instead.
</ParamField>

<ParamField body="scheduled_at" type="string">
  ISO 8601 datetime in the future (e.g. `2026-05-10T15:30:00Z`). Stored on the draft so a follow-up `PUT` with `status=scheduled` doesn't have to repeat it. Defaults to today at 09:00 UTC.
</ParamField>

<ParamField body="label_ids" type="array">
  Workspace label UUIDs to attach. Must belong to the same workspace as the API key.
</ParamField>

## Response

Returns `201` with the created post. Response shape is identical to [`GET /posts/{post}`](/api-reference/endpoint/get-post) — see that endpoint for full field documentation.

<RequestExample>
  ```bash theme={null}
  curl -X POST https://app.trypost.it/api/posts \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "content": "Hello from the TryPost API!",
      "platforms": [
        {
          "social_account_id": "b2c3d4e5-f6a7-8b9c-0d1e-2f3a4b5c6d7e",
          "content_type": "linkedin_post"
        }
      ],
      "scheduled_at": "2026-05-10T15:30:00Z",
      "label_ids": ["c3d4e5f6-a7b8-9c0d-1e2f-3a4b5c6d7e8f"]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "id": "9f1a2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    "content": "Hello from the TryPost API!",
    "media": [],
    "status": "draft",
    "scheduled_at": "2026-05-10 15:30:00",
    "published_at": null,
    "platforms": [
      {
        "id": "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d",
        "platform": "linkedin",
        "content_type": "linkedin_post",
        "status": "pending",
        "enabled": true,
        "platform_url": null,
        "published_at": null,
        "error_message": null,
        "display_name": "John Doe",
        "display_username": "johndoe",
        "display_avatar": "https://media.licdn.com/.../avatar.jpg",
        "social_account": {
          "id": "b2c3d4e5-f6a7-8b9c-0d1e-2f3a4b5c6d7e",
          "platform": "linkedin",
          "display_name": "John Doe",
          "username": "johndoe",
          "is_active": true,
          "status": "connected"
        }
      }
    ],
    "labels": [
      {
        "id": "c3d4e5f6-a7b8-9c0d-1e2f-3a4b5c6d7e8f",
        "name": "Product Launch",
        "color": "#4f46e5",
        "created_at": "2025-01-10 08:00:00",
        "updated_at": "2025-01-10 08:00:00"
      }
    ],
    "created_at": "2025-01-14 09:00:00",
    "updated_at": "2025-01-14 09:00:00"
  }
  ```
</ResponseExample>
