---
title: "Schedule a post"
description: "Schedule a video on a connected account (see list_accounts for each account's platform). The post waits in mixetape (editable, cancellable) until shortly before scheduledAt. YouTube and Facebook get it leadMinutes early, unpublished, and publish it themselves at scheduledAt; Instagram and Threads get it prepared leadMinutes early and mixetape publishes it at scheduledAt; TikTok and Pinterest cannot hold a post, so mixetape posts it at scheduledAt. Each platform takes its own metadata (Facebook format reel for a Reel, Pinterest boardId is required, TikTok privacyLevel). Thumbnail, playlists and captions are applied right after upload where the platform supports them; firstComment is posted once it is public. mediaUrl: a public https URL, or an r2:// URL from mixetape storage (create_upload / import_file). Needs the **publish** permission."
---

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

Path: mixetape API › Accounts and posts

`POST /api/v1/posts`

Schedule a video on a connected account (see list_accounts for each account's platform). The post waits in mixetape (editable, cancellable) until shortly before scheduledAt. YouTube and Facebook get it leadMinutes early, unpublished, and publish it themselves at scheduledAt; Instagram and Threads get it prepared leadMinutes early and mixetape publishes it at scheduledAt; TikTok and Pinterest cannot hold a post, so mixetape posts it at scheduledAt. Each platform takes its own metadata (Facebook format reel for a Reel, Pinterest boardId is required, TikTok privacyLevel). Thumbnail, playlists and captions are applied right after upload where the platform supports them; firstComment is posted once it is public. mediaUrl: a public https URL, or an r2:// URL from mixetape storage (create_upload / import_file). Needs the **publish** permission.

## Authentication

- `apiKey`, http, header `Authorization`

## Request body

_Required._

- `createPostRest.accountId` (string, required) — mixetape account id (list_accounts)
- `createPostRest.mediaUrl` (string, required)
- `createPostRest.caption` (string, optional)
- `createPostRest.scheduledAt` (string, optional) — ISO 8601 with timezone offset — when it goes live. Omit to post now (live after leadMinutes).
- `createPostRest.leadMinutes` (number, optional) — Minutes before go-live that mixetape uploads or prepares it, so the platform finishes processing first (defaults: YouTube and Facebook 30, Instagram 15, Threads 10; TikTok and Pinterest always 0). 0 uploads at go-live time. Facebook needs 0 or at least 15.
- `createPostRest.metadata` (any of, optional)
  - any of: `YouTube`, `Facebook`, `Instagram`, `Threads`, `TikTok`, `Pinterest`

## Example request

```json
{
  "accountId": "string",
  "mediaUrl": "string",
  "caption": "string",
  "scheduledAt": "string",
  "leadMinutes": 0,
  "metadata": {
    "title": "string",
    "description": "string",
    "category": "string",
    "tags": [
      "string"
    ],
    "privacyStatus": "public",
    "madeForKids": true,
    "notifySubscribers": true,
    "defaultLanguage": "string",
    "localizations": {
      "property1": {
        "title": "string",
        "description": "string"
      },
      "property2": {
        "title": "string",
        "description": "string"
      }
    },
    "thumbnailUrl": "string",
    "playlistIds": [
      "string"
    ],
    "captions": [
      {
        "language": "string",
        "name": "string",
        "url": "string"
      }
    ],
    "firstComment": "string"
  }
}
```

## Code samples

### cURL

```curl
curl --request POST \
  --url https://mixetape.com/api/v1/posts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "accountId": "string",
  "mediaUrl": "string",
  "caption": "string",
  "scheduledAt": "string",
  "leadMinutes": 0,
  "metadata": {
    "title": "string",
    "description": "string",
    "category": "string",
    "tags": [
      "string"
    ],
    "privacyStatus": "public",
    "madeForKids": true,
    "notifySubscribers": true,
    "defaultLanguage": "string",
    "localizations": {
      "property1": {
        "title": "string",
        "description": "string"
      },
      "property2": {
        "title": "string",
        "description": "string"
      }
    },
    "thumbnailUrl": "string",
    "playlistIds": [
      "string"
    ],
    "captions": [
      {
        "language": "string",
        "name": "string",
        "url": "string"
      }
    ],
    "firstComment": "string"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://mixetape.com/api/v1/posts';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    accountId: 'string',
    mediaUrl: 'string',
    caption: 'string',
    scheduledAt: 'string',
    leadMinutes: 0,
    metadata: {
      title: 'string',
      description: 'string',
      category: 'string',
      tags: ['string'],
      privacyStatus: 'public',
      madeForKids: true,
      notifySubscribers: true,
      defaultLanguage: 'string',
      localizations: {
        property1: {title: 'string', description: 'string'},
        property2: {title: 'string', description: 'string'}
      },
      thumbnailUrl: 'string',
      playlistIds: ['string'],
      captions: [{language: 'string', name: 'string', url: 'string'}],
      firstComment: 'string'
    }
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://mixetape.com/api/v1/posts"

payload = {
    "accountId": "string",
    "mediaUrl": "string",
    "caption": "string",
    "scheduledAt": "string",
    "leadMinutes": 0,
    "metadata": {
        "title": "string",
        "description": "string",
        "category": "string",
        "tags": ["string"],
        "privacyStatus": "public",
        "madeForKids": True,
        "notifySubscribers": True,
        "defaultLanguage": "string",
        "localizations": {
            "property1": {
                "title": "string",
                "description": "string"
            },
            "property2": {
                "title": "string",
                "description": "string"
            }
        },
        "thumbnailUrl": "string",
        "playlistIds": ["string"],
        "captions": [
            {
                "language": "string",
                "name": "string",
                "url": "string"
            }
        ],
        "firstComment": "string"
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

The scheduled post.

#### Example

```json
{
  "post": {
    "id": "string",
    "accountId": "string",
    "provider": "string",
    "mediaUrl": "string",
    "caption": "string",
    "metadata": {},
    "scheduledAt": "2019-08-24T14:15:22Z",
    "leadMinutes": 0,
    "status": "scheduled",
    "platformPostId": "string",
    "platformUrl": "string",
    "error": "string",
    "attempts": 0,
    "publishedAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
```

- `createPostRest.response.201.post` (object, required)
  - `createPostRest.response.201.post.id` (string, required)
  - `createPostRest.response.201.post.accountId` (string, required)
  - `createPostRest.response.201.post.provider` (string, required)
  - `createPostRest.response.201.post.mediaUrl` (string, required)
  - `createPostRest.response.201.post.scheduledAt` (string, required) — When it goes live
    - format `date-time`
  - `createPostRest.response.201.post.status` (string, required)
    - one of `"scheduled"`, `"publishing"`, `"uploaded"`, `"published"`, `"failed"`, `"cancelled"`
  - `createPostRest.response.201.post.caption` (string | null, optional)
  - `createPostRest.response.201.post.metadata` (object | null, optional) — The platform's own fields
  - `createPostRest.response.201.post.leadMinutes` (integer | null, optional) — Uploaded or prepared this long before scheduledAt
  - `createPostRest.response.201.post.platformPostId` (string | null, optional)
  - `createPostRest.response.201.post.platformUrl` (string | null, optional)
  - `createPostRest.response.201.post.error` (string | null, optional) — Why it failed, when it did
  - `createPostRest.response.201.post.attempts` (integer, optional)
  - `createPostRest.response.201.post.publishedAt` (string | null, optional)
    - format `date-time`
  - `createPostRest.response.201.post.createdAt` (string, optional)
    - format `date-time`
  - `createPostRest.response.201.post.updatedAt` (string, optional)
    - format `date-time`

### 400

The request is invalid; `error` says why.

#### Example

```json
{
  "error": "string"
}
```

- `createPostRest.response.400.error` (string, required) — What went wrong, in plain words

### 401

No valid API key.

#### Example

```json
{
  "error": "string"
}
```

- `createPostRest.response.401.error` (string, required) — What went wrong, in plain words

### 403

The key lacks the permission this needs.

#### Example

```json
{
  "error": "string"
}
```

- `createPostRest.response.403.error` (string, required) — What went wrong, in plain words


Source: https://docs.mixetape.com/api/Accounts-and-posts/createPostRest/index.md
