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

# Bulk Post

> Schedule many posts at once by uploading a CSV file as multipart/form-data. Covers the required CSV fields, duplicate post rules, and a CSV template.

> [!NOTE]
>
> **Targeting X/Twitter?** Starting March 31, 2026, all X operations require your own API credentials. After linking X via OAuth, include these 2 headers in your request:
>
> `X-Twitter-OAuth1-Api-Key` — Your API Key (Consumer Key)
>
> `X-Twitter-OAuth1-Api-Secret` — Your API Key Secret (Consumer Secret)
>
> **One-time setup per Ayrshare account.** You create one X Developer App and reuse the same API Key and Secret across every sub-profile / end-user you link. You do *not* create a new app per customer.
>
> Not linked yet? See the [full setup guide](https://www.ayrshare.com/docs/dashboard/connect-social-accounts/x-twitter-byo-keys.md) to connect your X account.
>
> Your keys are never logged or stored by Ayrshare.

Bulk schedule posts with CSV (Comma Separated Values) file of posts data.
Content-Type must be `multipart/form-data`.

> [!WARNING]
>
> We recommend using the direct [Post endpoint](https://www.ayrshare.com/docs/apis/post/post.md) instead of this bulk method for
> scheduling posts. The direct endpoint provides a more comprehensive feature set and easier
> debugging capabilities.

## Header Parameters

**Authorization** `string` *required*

Format: `Authorization: Bearer API_KEY`. See [API overview](https://www.ayrshare.com/docs/apis/overview.md#authorization) for more
information.

**Profile-Key** `string`

Profile Key of a user profile.

**Content-Type** `string` *required*

`Content-Type: multipart/form-data`

## Body Parameters

**file** `object`

Multipart form-data CSV file of scheduled posts. See below for [CSV template](#csv-template).

## Request Examples

A multipart form-data containing a CSV file of posts will schedule them for a future date.

The CSV file contains the following fields (template below) and are required:

<ul>
  <li>`post`: The post text.</li>
  <li>`platforms`: Comma separated list of platforms, e.g. "twitter, facebook, instagram".</li>
  <li>`mediaUrls`: URL of media, such as an image or video to include in the post.</li>

  <li>
    `scheduleDate`: Datetime to schedule the post in UTC format. For example, use format
    `YYYY-MM-DDThh:mm:ssZ` and send as `2026-07-08T12:30:00Z`. Please see
    [utctime](https://www.utctime.net/) for more examples.
  </li>
</ul>

> [!WARNING]
>
> Don't schedule duplicate posts within 24 hours of each other.
>
> Each post is checked against a 48-hour window centered on its own `scheduleDate` — 24 hours before through 24 hours after. If another post with identical or near-identical text falls inside that window, the post is rejected with [error 137](https://www.ayrshare.com/docs/errors/errors-ayrshare.md#duplicate-content-errors). The window looks forward as well as back, so a row can be rejected because of a row scheduled after it. The check runs when a post is submitted or scheduled, not only when it is about to publish.
> This is to protect your account at the networks; they can suspend or shadow-ban accounts with frequent duplicate posts.

## CSV Template

Download the template and save as a .csv file.

[Ayrshare CSV Template](https://img.ayrshare.com/012/Ayrshare_CSV_Template.csv)

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: multipart/form-data' \
-F 'file=@"./Ayrshare CSV Template.csv"' \
-X POST https://api.ayrshare.com/api/post/bulk
```

```javascript JavaScript theme={"system"}
const API_KEY = "API_KEY";
const FormData = require("form-data");
const fs = require("fs");

const formData = new FormData();
formData.append("file", fs.createReadStream("./Ayrshare CSV Template.csv"));

fetch("https://api.ayrshare.com/api/post/bulk", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${API_KEY}`,
    ...formData.getHeaders()
  },
  body: formData
})
  .then((res) => res.json())
  .then((data) => {
    console.log(JSON.stringify(data));
  })
  .catch((error) => {
    console.log(error);
  });
```

```python Python theme={"system"}
import requests

API_KEY = "API_KEY"

# Open the CSV file in binary read mode
with open('./Ayrshare CSV Template.csv', 'rb') as file:
    # Prepare the files dictionary for the multipart/form-data request
    files = {'file': file}

    # Set up the authorization header
    headers = {'Authorization': f'Bearer {API_KEY}'}

    try:
        # Make the POST request to the API
        response = requests.post(
            'https://api.ayrshare.com/api/post/bulk',
            headers=headers,
            files=files
        )

        # Parse and print the JSON response
        data = response.json()
        print(data)

    except Exception as e:
        print(f"Error: {e}")
```

```javascript 200: OK Example with two scheduled posts. theme={"system"}
{
    "status": "success",
    "posts": [
        {
            "status": "scheduled",
            "scheduleDate": "4/6/21 12:50",
            "id": "X3uTExuEJhyM3u8wCRsA",
            "post": "A great post"
        },
        {
            "status": "scheduled",
            "scheduleDate": "4/6/21 13:00",
            "id": "8RGrekuxMnVa7lVnARFm",
            "post": "An even better post"
        }
    ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.