# Create post

Creates a post.

```http
POST https://api.pozy.ai/v1/posts
```

- Area: Publishing / Posts
- Auth: Authorization: Bearer pz_live_...

## Header parameters

- `Idempotency-Key` (string)
- `x-request-id` (string (uuid))

## Request body

Content type: `application/json`

- `title`, string
- `content`, string
- `mediaItems`, array of object
  - `type`, string: One of `image`, `video`, `gif`, `document`
  - `url`, string (URL)
  - `fileId`, string
  - `accountId`, string
  - `title`, string
  - `altText`, string
  - `filename`, string
  - `size`, integer
  - `mimeType`, string
  - `thumbnail`, string (URL)
  - `instagramThumbnail`, string (URL)
  - `subtitles`, array of object: Up to 20 items
    - `url`, string (URL), required
    - `language`, string, required
  - `tiktokProcessed`, boolean
- `platforms`, array of object
  - `platform`, string, required
  - `accountId`, string, required
  - `customContent`, string
  - `customMedia`, array of object
    - `type`, string: One of `image`, `video`, `gif`, `document`
    - `url`, string (URL)
    - `fileId`, string
    - `accountId`, string
    - `title`, string
    - `altText`, string
    - `filename`, string
    - `size`, integer
    - `mimeType`, string
    - `thumbnail`, string (URL)
    - `instagramThumbnail`, string (URL)
    - `subtitles`, array of object: Up to 20 items
      - `url`, string (URL), required
      - `language`, string, required
    - `tiktokProcessed`, boolean
  - `scheduledFor`, string (date-time)
  - `platformSpecificData`, object
    - one of: X settings
      - `article`, object
        - `title`, string, required
        - `content_state`, object, required
          - `blocks`, array of object, required: At least 1 item
            - `type`, string, required: One of `unstyled`, `header-one`, `header-two`, `header-three`, `unordered-list-item`, `ordered-list-item`, `blockquote`, `atomic`
            - `text`, string, required
            - `key`, string
            - `data`, object
              - `cashtags`, array of object
              - `hashtags`, array of object
              - `mentions`, array of object
              - `urls`, array of object
            - `inline_style_ranges`, array of object
              - `offset`, integer, required: At least 0
              - `length`, integer, required: At least 0
              - `style`, string, required: One of `bold`, `italic`, `strikethrough`
            - `entity_ranges`, array of object
              - `key`, integer, required: At least 0
              - `offset`, integer, required: At least 0
              - `length`, integer, required: At least 0
          - `entities`, array of object, required
            - one of: Option 1
              - `key`, string, required
              - `value`, object, required
                - `type`, string, required: Always `post`
                - `mutability`, string, required: One of `immutable`, `mutable`, `segmented`
                - `data`, object, required
            - one of: Option 2
              - `key`, string, required
              - `value`, object, required
                - `type`, string, required: Always `link`
                - `mutability`, string, required: One of `immutable`, `mutable`, `segmented`
                - `data`, object, required
            - one of: Option 3
              - `key`, string, required
              - `value`, object, required
                - `type`, string, required: Always `image`
                - `mutability`, string, required: One of `immutable`, `mutable`, `segmented`
                - `data`, object, required
            - one of: Option 4
              - `key`, string, required
              - `value`, object, required
                - `type`, string, required: Always `emoji`
                - `mutability`, string, required: One of `immutable`, `mutable`, `segmented`
                - `data`, object, required
            - one of: Option 5
              - `key`, string, required
              - `value`, object, required
                - `type`, string, required: Always `markdown`
                - `mutability`, string, required: One of `immutable`, `mutable`, `segmented`
                - `data`, object, required
            - one of: Option 6
              - `key`, string, required
              - `value`, object, required
                - `type`, string, required: One of `divider`, `latex`
                - `mutability`, string, required: One of `immutable`, `mutable`, `segmented`
                - `data`, object, required
        - `mode`, string: One of `publish`, `draft`. Default `publish`
        - `cover`, object
          - `url`, string (URL), required: Matches `^https?://.+\.(?:[jJ][pP][eE]?[gG]|[pP][nN][gG]|[wW][eE][bB][pP])(?:[?#].*)?$`
          - `altText`, string: Up to 1000 characters
      - `replyToTweetId`, string
      - `quoteTweetId`, string
      - `replySettings`, string: One of `following`, `mentionedUsers`, `subscribers`, `verified`
      - `threadItems`, array of object
        - `content`, string
        - `mediaItems`, array of object
          - `type`, string: One of `image`, `video`, `gif`, `document`
          - `url`, string (URL)
          - `fileId`, string
          - `accountId`, string
          - `title`, string
          - `altText`, string
          - `filename`, string
          - `size`, integer
          - `mimeType`, string
          - `thumbnail`, string (URL)
          - `instagramThumbnail`, string (URL)
          - `subtitles`, array of object: Up to 20 items
            - `url`, string (URL), required
            - `language`, string, required
          - `tiktokProcessed`, boolean
      - `poll`, object
        - `options`, array of string, required: At least 2 items. Up to 4 items. Each item: 1 to 25 characters
        - `duration_minutes`, integer, required: 5 to 10080
      - `longVideo`, boolean: Default `false`
      - `geoRestriction`, object
        - `countries`, array of string, required: At least 1 item. Up to 25 items. Each item: matches `^[A-Z]{2}$`
      - `paidPartnership`, boolean: Default `false`
      - `madeWithAi`, boolean: Default `false`
      - `sensitiveMedia`, object
        - `adultContent`, boolean
        - `graphicViolence`, boolean
        - `other`, boolean
      - `mediaTaggedUsers`, array of string: Up to 10 items. Each item: matches `^@?\w{1,15}$`
    - one of: Threads settings
      - `topic_tag`, string: 1 to 50 characters
      - `firstComment`, string: Up to 500 characters
      - `threadItems`, array of object
        - `content`, string
        - `mediaItems`, array of object
          - `type`, string: One of `image`, `video`, `gif`, `document`
          - `url`, string (URL)
          - `fileId`, string
          - `accountId`, string
          - `title`, string
          - `altText`, string
          - `filename`, string
          - `size`, integer
          - `mimeType`, string
          - `thumbnail`, string (URL)
          - `instagramThumbnail`, string (URL)
          - `subtitles`, array of object: Up to 20 items
            - `url`, string (URL), required
            - `language`, string, required
          - `tiktokProcessed`, boolean
    - one of: Facebook settings
      - `contentType`, string: One of `story`, `reel`
      - `title`, string
      - `firstComment`, string
      - `pageId`, string
      - `geoRestriction`, object
        - `countries`, array of string, required: At least 1 item. Up to 25 items. Each item: matches `^[A-Z]{2}$`
      - `facebookSettings`, object
        - `draft`, boolean: Default `false`
        - `carouselCards`, array of object: At least 2 items. Up to 10 items
          - `link`, string (URL), required
          - `name`, string: Up to 255 characters
          - `description`, string: Up to 255 characters
        - `carouselLink`, string (URL)
        - `textFormatPresetId`, string: Matches `^\d+$`
    - one of: Instagram settings
      - `contentType`, string: One of `story`
      - `shareToFeed`, boolean: Default `true`
      - `collaborators`, array of string
      - `firstComment`, string
      - `trialParams`, object
        - `graduationStrategy`, string: One of `MANUAL`, `SS_PERFORMANCE`
      - `userTags`, array of object
        - `username`, string, required
        - `x`, number: 0 to 1
        - `y`, number: 0 to 1
        - `mediaIndex`, integer: At least 0
      - `audioName`, string
      - `audioConfiguration`, object
        - `audioId`, string, required
        - `audioVolume`, integer: 0 to 100
        - `videoVolume`, integer: 0 to 100
      - `muteAudio`, boolean: Default `false`
      - `thumbOffset`, integer: At least 0
      - `instagramThumbnail`, string (URL)
      - `reelCover`, string (URL)
      - `isAiGenerated`, boolean: Default `false`
      - `isPaidPartnership`, boolean: Default `false`
      - `brandedContentSponsors`, array of string: Up to 2 items
      - `commentsEnabled`, boolean: Default `true`
      - `locationId`, string: Matches `^[0-9]+$`
    - one of: Linked In settings
      - `documentTitle`, string
      - `organizationUrn`, string
      - `firstComment`, string
      - `disableLinkPreview`, boolean
      - `audience`, object
        - `countries`, array of string: Up to 25 items
        - `geoLocations`, array of string
        - `interfaceLocales`, array of object
          - `language`, string, required
          - `country`, string, required
        - `industries`, array of string
        - `jobFunctions`, array of string
        - `seniorities`, array of string
        - `staffCountRanges`, array of string: Each item: one of `SIZE_1`, `SIZE_2_TO_10`, `SIZE_11_TO_50`, `SIZE_51_TO_200`, `SIZE_201_TO_500`, `SIZE_501_TO_1000`, `SIZE_1001_TO_5000`, `SIZE_5001_TO_10000`, `SIZE_10001_OR_MORE`
        - `degrees`, array of string
        - `fieldsOfStudy`, array of string
        - `organizations`, array of string
      - `reshareUrl`, string
      - `geoRestriction`, object
        - `countries`, array of string, required: At least 1 item. Up to 25 items. Each item: matches `^[A-Z]{2}$`
      - `poll`, object
        - `question`, string, required: 1 to 140 characters
        - `options`, array of string, required: At least 2 items. Up to 4 items. Each item: 1 to 30 characters
        - `duration`, string: One of `ONE_DAY`, `THREE_DAYS`, `SEVEN_DAYS`, `FOURTEEN_DAYS`. Default `SEVEN_DAYS`
    - one of: Pinterest settings
      - `title`, string: Up to 100 characters
      - `boardId`, string
      - `boardSectionId`, string
      - `link`, string (URL)
      - `coverImageUrl`, string (URL)
      - `coverImageKeyFrameTime`, integer
      - `isAiGenerated`, boolean: Default `false`
    - one of: You Tube settings
      - `title`, string: Up to 100 characters
      - `visibility`, string: One of `public`, `private`, `unlisted`. Default `public`
      - `madeForKids`, boolean: Default `false`
      - `firstComment`, string: Up to 10000 characters
      - `containsSyntheticMedia`, boolean: Default `false`
      - `notifySubscribers`, boolean: Default `true`
      - `categoryId`, string: Default `22`
      - `playlistId`, string
    - one of: Google Business settings
      - `locationId`, string
      - `languageCode`, string
      - `topicType`, string: One of `STANDARD`, `EVENT`, `OFFER`. Default `STANDARD`
      - `callToAction`, object
        - `type`, string, required: One of `LEARN_MORE`, `BOOK`, `ORDER`, `SHOP`, `SIGN_UP`, `CALL`
        - `url`, string (URL), required
      - `event`, object
        - `title`, string, required
        - `schedule`, object, required
          - `startDate`, object, required
            - `year`, integer, required
            - `month`, integer, required: 1 to 12
            - `day`, integer, required: 1 to 31
          - `startTime`, object
            - `hours`, integer: 0 to 23
            - `minutes`, integer: 0 to 59
          - `endDate`, object, required
            - `year`, integer, required
            - `month`, integer, required: 1 to 12
            - `day`, integer, required: 1 to 31
          - `endTime`, object
            - `hours`, integer: 0 to 23
            - `minutes`, integer: 0 to 59
      - `offer`, object
        - `redeemOnlineUrl`, string (URL)
        - `termsConditions`, string
        - `couponCode`, string
    - one of: Tik Tok settings
      - `draft`, boolean
      - `privacyLevel`, string
      - `allowComment`, boolean
      - `allowDuet`, boolean
      - `allowStitch`, boolean
      - `commercialContentType`, string: One of `none`, `brand_organic`, `brand_content`
      - `brandPartnerPromote`, boolean
      - `isBrandOrganicPost`, boolean
      - `contentPreviewConfirmed`, boolean
      - `expressConsentGiven`, boolean
      - `mediaType`, string: One of `video`, `photo`
      - `videoCoverTimestampMs`, integer: At least 0
      - `videoCoverImageUrl`, string (URL)
      - `photoCoverIndex`, integer: At least 0
      - `autoAddMusic`, boolean
      - `musicSoundInfo`, object
        - `musicSoundId`, string, required
        - `musicSoundVolume`, integer: Default `50`. 0 to 100
        - `musicSoundStart`, integer: At least 0
        - `musicSoundEnd`, integer: At least 0
      - `videoOriginalSoundVolume`, integer: 0 to 100
      - `videoMadeWithAi`, boolean
      - `locationId`, string
      - `locationName`, string
      - `isAdsOnly`, boolean
      - `description`, string: Up to 4000 characters
    - one of: Telegram settings
      - `parseMode`, string: One of `HTML`, `Markdown`, `MarkdownV2`
      - `disableWebPagePreview`, boolean
      - `disableNotification`, boolean
      - `protectContent`, boolean
    - one of: Snapchat settings
      - `contentType`, string: One of `story`, `saved_story`, `spotlight`. Default `story`
    - one of: Reddit settings
      - `subreddit`, string
      - `title`, string: Up to 300 characters
      - `url`, string (URL)
      - `forceSelf`, boolean
      - `flairId`, string
      - `flairText`, string
      - `nsfw`, boolean: Default `false`
      - `spoiler`, boolean: Default `false`
      - `sendreplies`, boolean: Default `true`
      - `nativeVideo`, boolean: Default `true`
      - `videogif`, boolean
      - `videoPosterUrl`, string (URL)
    - one of: Bluesky settings
      - `langs`, array of string: At least 1 item. Up to 3 items
      - `threadItems`, array of object
        - `content`, string
        - `mediaItems`, array of object
          - `type`, string: One of `image`, `video`, `gif`, `document`
          - `url`, string (URL)
          - `fileId`, string
          - `accountId`, string
          - `title`, string
          - `altText`, string
          - `filename`, string
          - `size`, integer
          - `mimeType`, string
          - `thumbnail`, string (URL)
          - `instagramThumbnail`, string (URL)
          - `subtitles`, array of object: Up to 20 items
            - `url`, string (URL), required
            - `language`, string, required
          - `tiktokProcessed`, boolean
    - one of: Discord settings
      - `channelId`, string, required
      - `embeds`, array of object: Up to 10 items
        - `title`, string
        - `description`, string
        - `url`, string
        - `color`, integer
        - `image`, object
          - `url`, string
        - `thumbnail`, object
          - `url`, string
        - `footer`, object
          - `text`, string
          - `icon_url`, string
        - `author`, object
          - `name`, string
          - `url`, string
          - `icon_url`, string
        - `fields`, array of object: Up to 25 items
          - `name`, string, required
          - `value`, string, required
          - `inline`, boolean
      - `poll`, object
        - `question`, object
          - `text`, string, required
        - `answers`, array of object: Up to 10 items
          - `poll_media`, object
            - `text`, string
        - `duration`, integer: 1 to 768
        - `allow_multiselect`, boolean
      - `crosspost`, boolean
      - `forumThreadName`, string
      - `forumAppliedTags`, array of string: Up to 5 items
      - `threadFromMessage`, object
        - `name`, string
        - `autoArchiveDuration`, integer: One of `60`, `1440`, `4320`, `10080`
        - `rateLimitPerUser`, integer: 0 to 21600
      - `tts`, boolean
      - `webhookUsername`, string
      - `webhookAvatarUrl`, string
    - one of: Slack settings
      - `threadTs`, string
      - `unfurlLinks`, boolean
      - `unfurlMedia`, boolean
      - `username`, string
      - `iconUrl`, string
- `scheduledFor`, string (date-time)
- `publishNow`, boolean: Default `false`
- `isDraft`, boolean: Default `false`
- `requiresApproval`, boolean: Default `false`
- `dryRun`, boolean: Default `false`
- `timezone`, string
- `tags`, array of string
- `hashtags`, array of string
- `mentions`, array of string
- `crosspostingEnabled`, boolean: Default `true`
- `metadata`, object
- `tiktokSettings`, object
  - `draft`, boolean
  - `privacyLevel`, string
  - `allowComment`, boolean
  - `allowDuet`, boolean
  - `allowStitch`, boolean
  - `commercialContentType`, string: One of `none`, `brand_organic`, `brand_content`
  - `brandPartnerPromote`, boolean
  - `isBrandOrganicPost`, boolean
  - `contentPreviewConfirmed`, boolean
  - `expressConsentGiven`, boolean
  - `mediaType`, string: One of `video`, `photo`
  - `videoCoverTimestampMs`, integer: At least 0
  - `videoCoverImageUrl`, string (URL)
  - `photoCoverIndex`, integer: At least 0
  - `autoAddMusic`, boolean
  - `musicSoundInfo`, object
    - `musicSoundId`, string, required
    - `musicSoundVolume`, integer: Default `50`. 0 to 100
    - `musicSoundStart`, integer: At least 0
    - `musicSoundEnd`, integer: At least 0
  - `videoOriginalSoundVolume`, integer: 0 to 100
  - `videoMadeWithAi`, boolean
  - `locationId`, string
  - `locationName`, string
  - `isAdsOnly`, boolean
  - `description`, string: Up to 4000 characters
- `facebookSettings`, object
  - `draft`, boolean: Default `false`
  - `carouselCards`, array of object: At least 2 items. Up to 10 items
    - `link`, string (URL), required
    - `name`, string: Up to 255 characters
    - `description`, string: Up to 255 characters
  - `carouselLink`, string (URL)
  - `textFormatPresetId`, string: Matches `^\d+$`
- `recycling`, object
  - `enabled`, boolean: Default `true`
  - `gap`, integer: At least 1
  - `gapFreq`, string: One of `week`, `month`. Default `month`
  - `startDate`, string (date-time)
  - `expireCount`, integer: At least 1. Can be null
  - `expireDate`, string (date-time): Can be null
  - `contentVariations`, array of string: Up to 20 items
- `queuedFromProfile`, string
- `queueId`, string

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/posts" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Launch day",
  "content": "Hello from Pozy",
  "mediaItems": [
    {
      "type": "image",
      "url": "https://pozy.ai/media/example-1.jpg",
      "fileId": "6035bf6bd3aac3067c336c50"
    }
  ],
  "platforms": [
    {
      "platform": "instagram",
      "accountId": "696e0b682d0a31188e7a2ba9"
    }
  ]
}'
```

```ts
import { randomUUID } from "node:crypto";

const res = await fetch("https://api.pozy.ai/v1/posts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Idempotency-Key": randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    title: "Launch day",
    content: "Hello from Pozy",
    mediaItems: [
      {
        type: "image",
        url: "https://pozy.ai/media/example-1.jpg",
        fileId: "6035bf6bd3aac3067c336c50"
      }
    ],
    platforms: [
      {
        platform: "instagram",
        accountId: "696e0b682d0a31188e7a2ba9"
      }
    ]
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/posts",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "title": "Launch day",
        "content": "Hello from Pozy",
        "mediaItems": [
            {
                "type": "image",
                "url": "https://pozy.ai/media/example-1.jpg",
                "fileId": "6035bf6bd3aac3067c336c50",
            },
        ],
        "platforms": [
            {
                "platform": "instagram",
                "accountId": "696e0b682d0a31188e7a2ba9",
            },
        ],
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200


```json
{
  "dryRun": true,
  "canPublish": true,
  "tiktok": [
    {
      "accountId": "696e0b682d0a31188e7a2ba9",
      "canPublish": true,
      "alreadyPostedToday": true,
      "reason": "string"
    }
  ]
}
```
