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
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);
});
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}")
{
"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"
}
]
}
Post
Bulk Post
multipart/form-data के रूप में CSV फ़ाइल अपलोड करके कई पोस्ट्स एक साथ schedule करें। ज़रूरी CSV फ़ील्ड, डुप्लिकेट पोस्ट के नियम और CSV template शामिल हैं।
POST
/
post
/
bulk
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
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);
});
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}")
{
"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"
}
]
}
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:
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 to connect your X account.
Your keys are never logged or stored by Ayrshare.
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 to connect your X account.
Your keys are never logged or stored by Ayrshare.
multipart/form-data होना चाहिए।
हम पोस्ट्स schedule करने के लिए इस bulk विधि के बजाय सीधे Post endpoint का उपयोग करने की अनुशंसा करते हैं।
Direct endpoint एक अधिक व्यापक सुविधा सेट और आसान
debugging क्षमताएँ प्रदान करता है।
Header Parameters
फ़ॉर्मैट:
Authorization: Bearer API_KEY। अधिक जानकारी के लिए API overview
देखें।Body Parameters
Scheduled पोस्ट्स की Multipart form-data CSV फ़ाइल। नीचे CSV template देखें।
अनुरोध उदाहरण
पोस्ट्स की CSV फ़ाइल वाले multipart form-data उन्हें भविष्य की तारीख के लिए schedule करेंगे। CSV फ़ाइल में निम्नलिखित fields (नीचे template) होते हैं और आवश्यक हैं:post: पोस्ट text।platforms: प्लेटफ़ॉर्म्स की comma separated सूची, जैसे “twitter, facebook, instagram”।mediaUrls: पोस्ट में शामिल करने के लिए media का URL, जैसे कि image या video।scheduleDate: UTC फ़ॉर्मैट में पोस्ट schedule करने की Datetime। उदाहरण के लिए, फ़ॉर्मैटYYYY-MM-DDThh:mm:ssZका उपयोग करें और2026-07-08T12:30:00Zके रूप में भेजें। अधिक उदाहरणों के लिए कृपया utctime देखें।
24 घंटों से कम के अंतर पर डुप्लिकेट पोस्ट schedule न करें।हर पोस्ट की जाँच उसकी अपनी
scheduleDate पर केंद्रित 48-घंटे की window के विरुद्ध की जाती है — 24 घंटे पहले से 24 घंटे बाद तक। यदि उस window के भीतर समान या लगभग समान text वाली कोई अन्य पोस्ट मौजूद है, तो पोस्ट को त्रुटि 137 के साथ अस्वीकार कर दिया जाता है। यह window पीछे के साथ-साथ आगे भी देखती है, इसलिए कोई row उसके बाद schedule की गई row के कारण भी अस्वीकार हो सकती है। यह जाँच पोस्ट के submit या schedule होते समय ही चल जाती है, केवल publish होने से ठीक पहले नहीं।
यह सोशल नेटवर्क पर आपके account की रक्षा के लिए है; वे बार-बार डुप्लिकेट पोस्ट्स वाले accounts को suspend या shadow-ban कर सकते हैं।CSV Template
Template डाउनलोड करें और .csv फ़ाइल के रूप में सहेजें। Ayrshare CSV Templatecurl \
-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
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);
});
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}")
{
"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"
}
]
}