Write Post API
Bulk Upload
Validate and submit multiple posts from a CSV file.
POST
/api/v1/write-post/bulk/
Live
Multipart CSV upload. Optional dry-run: POST /api/v1/write-post/bulk/validate/ with the same file field.
Notes
- Supported format: CSV only.
- Default max file size: 2 MB (BULK_UPLOAD_MAX_MB).
- Default max rows: 100 (BULK_UPLOAD_MAX_ROWS).
- CSV columns: headline, content, media_url.
- Validate first with POST /api/v1/write-post/bulk/validate/ (file field only).
Body fields
| Name | Type | Required | Description |
|---|---|---|---|
file |
file | Yes | CSV file. Alias field name: csv. |
connection_ids |
integer|list | Yes | Target connection ID(s). |
schedule_mode |
string | No | publish_now (default), schedule, or auto_space. |
schedule_start |
string (ISO 8601) | No | Required when schedule_mode is schedule or auto_space. |
spacing_minutes |
integer | No | For auto_space only: 15, 30, 60, 120, 360, or 1440. |
idempotency_key |
string | No | Optional idempotency key (max 64 chars). |
Headers
HTTP
Authorization: Bearer YOUR_API_KEY
Content-Type: multipart/form-data
Examples
cURL
curl -X POST "https://YOUR-DOMAIN/api/v1/write-post/bulk/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F [email protected] \
-F connection_ids=1 \
-F schedule_mode=publish_now
JavaScript
const response = await fetch("https://engagegrove.com/api/v1/write-post/bulk/", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
Accept: "application/json",
"Content-Type": "application/json"
}
});
const data = await response.json();
Python
import requests
url = "https://engagegrove.com/api/v1/write-post/bulk/"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.request("POST", url, headers=headers)
print(response.json())
PHP
$ch = curl_init("https://engagegrove.com/api/v1/write-post/bulk/");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"Accept: application/json",
"Content-Type: application/json"
]
]);
$response = curl_exec($ch);
curl_close($ch);
Response example
JSON
{
"success": true,
"request_id": "req_...",
"data": {
"batch": {
"id": "bu_...",
"filename": "posts.csv",
"status": "processing",
"schedule_mode": "publish_now",
"row_count": 10,
"valid_count": 10,
"invalid_count": 0
}
}
}
Status codes
| Status | Meaning |
|---|---|
201 | Batch accepted |
400 | Missing file or validation error |
401 | Invalid API key |
403 | Missing write_post permission |
429 | Rate limit exceeded |
Errors
INVALID_API_KEY— missing/invalid Bearer tokenSERVICE_ACCESS_DENIED— key lackswrite_postVALIDATION_ERROR— invalid payload or domain validationRESOURCE_NOT_FOUND— unknown resourceRATE_LIMIT_EXCEEDED— too many requests