API Reference
Make Post
Publish a text, image, or video post to one or more connected social accounts in a single request.
Request body
Send multipart/form-data. Full URL: https://shareviral-server-production.up.railway.app/api/v1/developer/make-post
| Parameter | Type | Description |
|---|---|---|
postTextrequired | string | Caption / post body published to each selected platform. |
postTyperequired | 'text' | 'image' | 'video' | Content kind. image and video require files (or staged media). Video requires Viral Pro or Business. |
accountsrequired | string (CSV) | Comma-separated platform names to publish to, e.g. facebook,linkedin,tiktok. Matched against your connected accounts. |
filesoptional | File[] (≤ 10) | Media uploads for image or video posts. Field name must be files. |
metadataoptional | string (JSON) | object | Optional JSON metadata. ShareViral attaches your userId automatically when authenticated. |
Platforms
The accounts field is a CSV of platform keys (lowercase). ShareViral resolves them against the social accounts connected to your user. Common values include facebook, instagram, linkedin, tiktok, threads, and x.
If no connected account matches a requested platform, that platform is skipped. If none match, the API returns 400 with “No accounts found”.
Examples
Text-only publish with cURL:
curl -X POST https://shareviral-server-production.up.railway.app/api/v1/developer/make-post \
-H "Authorization: Bearer sv_your_api_token" \
-F "postText=Launch week is live — join the waitlist." \
-F "postType=text" \
-F "accounts=facebook,linkedin,tiktok"Same request in Node.js:
const form = new FormData()
form.append('postText', 'Launch week is live — join the waitlist.')
form.append('postType', 'text')
form.append('accounts', 'facebook,linkedin,tiktok')
const response = await fetch(
'https://shareviral-server-production.up.railway.app/api/v1/developer/make-post',
{
method: 'POST',
headers: {
Authorization: 'Bearer sv_your_api_token',
},
body: form,
}
)
const data = await response.json()
console.log(data)Response
On success the API returns aggregate counts plus a per-account results array. A top-level success can still include failed platforms—always inspect results.
{
"success": true,
"total": 3,
"successful": 2,
"failed": 1,
"results": [
{
"success": true,
"platform": "facebook",
"accountId": "…",
"accountName": "My Page"
},
{
"success": false,
"platform": "tiktok",
"accountId": "…",
"error": "…"
}
]
}Errors
Post text is required/Post type is requiredNo accounts found— CSV did not match any connected accountVideo posts require Viral Pro or Viral Business…