REST API آپ کی اسکرپٹس اور ایپس کو وہی کرنے دیتا ہے جو آپ ڈیش بورڈ میں کرتے ہیں: ابھی پوسٹ کرنا، شیڈول کرنا، تصاویر اپ لوڈ کرنا اور دیکھنا کہ کیا شائع ہوا۔ یہ HTTPS پر JSON استعمال کرتا ہے اور ایک API key سے چلتا ہے۔
API key حاصل کریں
سائن اِن کریں اور ڈیش بورڈ میں سیٹنگز ← API کیز کھولیں۔
key کو ایک نام دیں، جیسے "ریلیز اسکرپٹ"، اور اسے بنائیں۔
key فوراً کاپی کر لیں۔ یہ smcp_ سے شروع ہوتی ہے اور صرف ایک بار دکھائی جاتی ہے۔
key کو پاس ورڈ کی طرح خفیہ رکھیں: جس کے پاس یہ ہو وہ آپ کے اکاؤنٹس پر پوسٹ کر سکتا ہے۔ اسے environment variable یا اپنے CI secrets میں رکھیں، کبھی اپنے کوڈ میں نہیں۔ اگر کوئی key لیک ہو جائے تو اسی جگہ سے اسے ڈیلیٹ کریں اور نئی بنائیں۔
پہلے ڈیش بورڈ میں اپنے اکاؤنٹس (X اور LinkedIn) جوڑیں۔ API انہی اکاؤنٹس پر پوسٹ کرتا ہے جو آپ نے جوڑے ہیں۔
آپ کی پہلی ریکوئسٹ
ہر ریکوئسٹ کے ساتھ key کو Authorization ہیڈر میں بھیجیں:
یہ آپ کے اکاؤنٹس، سیٹنگز اور پلان واپس کرتا ہے۔ فوراً پوسٹ کرنے کے لیے:
curl https://getsocialmcp.com/api/v1/posts \
-H "Authorization: Bearer $SOCIALMCP_KEY" \
-H "Content-Type: application/json" \
-d '{ "text": "v2.4 is live: faster search and dark mode.", "networks": ["x", "linkedin"] }'
اس کے بجائے شیڈول کرنے کے لیے ٹائم زون آفسیٹ کے ساتھ ایک وقت شامل کریں، مثلاً "scheduledAt": "2026-12-01T09:00:00+01:00"۔ جواب میں پوسٹ اور ہر نیٹ ورک پر اس کا نتیجہ دکھایا جاتا ہے۔
جاننے کی باتیں
اوقات: ISO 8601 اوقات آفسیٹ یا Z کے ساتھ بھیجیں۔ جوابات UTC استعمال کرتے ہیں۔
X پر تھریڈز:text کے بجائے parts بھیجیں، تھریڈ کی ہر پوسٹ کے لیے ایک آئٹم۔ LinkedIn کو حصے ملا کر ایک پوسٹ میں ملتے ہیں، یا صرف پہلا حصہ، جیسا آپ کی سیٹنگز میں طے ہو۔
ہر نیٹ ورک کے لیے الگ ورژن:overrides استعمال کریں، مثلاً ایک ہی ریکوئسٹ میں LinkedIn کے لیے لمبا متن اور X کے لیے مختصر تھریڈ۔
تصاویر:POST /media سے اپ لوڈ کریں (فائل، یا https لنک)، پھر واپس ملنے والی id کو mediaIds میں بھیجیں۔
پوسٹنگ کے اوقات:"postingTime": "next" کے ساتھ پوسٹ ڈیش بورڈ میں طے کیے گئے پوسٹنگ کے اوقات کے اگلے خالی سلاٹ میں چلی جاتی ہے۔
دوہری پوسٹس نہیں: ایک idempotencyKey بھیجیں۔ اگر آپ کی اسکرپٹ اسی key کے ساتھ دوبارہ کوشش کرے تو آپ کو پہلی پوسٹ واپس ملتی ہے اور کچھ بھی دو بار پوسٹ نہیں ہوتا۔
نتائج کے صفحات:GET /posts ایک nextCursor واپس کرتا ہے۔ اگلا صفحہ لینے کے لیے اسے cursor کے طور پر بھیجیں۔
منظوریاں: آپ کی اپنی API key سے بنی پوسٹس طے شدہ منصوبے کے مطابق جاتی ہیں۔ "پہلے یہاں میری منظوری کا انتظار کریں" والی سیٹنگ صرف AI ایجنٹس پر لاگو ہوتی ہے۔
ایررز
ہر ایرر کی شکل ایک جیسی ہوتی ہے۔ اپنا فیصلہ code کی بنیاد پر کریں؛ message لوگوں کے لیے لکھا جاتا ہے اور بدل سکتا ہے۔
{
"error": {
"code": "too_long",
"message": "Part 1 is 312 characters on X; the limit is 280.",
"details": { }
}
}
عام کوڈز:
invalid_api_key (401): key غلط ہے یا ڈیلیٹ ہو چکی ہے۔
invalid_request یا too_long (422): ریکوئسٹ ٹھیک نہیں بیٹھتی۔ میسج بتاتا ہے کہ کیا بدلنا ہے۔
daily_limit، posting_gap یا monthly_limit (429): اس وقت آپ کے پلان میں گنجائش نہیں۔ بھرے ہوئے دن یا بہت قریب پوسٹ کے لیے details اگلا ایسا وقت تجویز کرتا ہے جس میں گنجائش ہو۔
plan_no_images اور دوسرے plan_ کوڈز (403): آپ کے پلان میں یہ شامل نہیں۔ میسج بتاتا ہے کہ کس پلان میں ہے۔
dashboard_only (403): یہ صرف ڈیش بورڈ میں ہو سکتا ہے، مثلاً API keys بنانا۔
قبول ہو جانے والی پوسٹ بعد میں کسی ایک نیٹ ورک پر ناکام ہو سکتی ہے، مثلاً جب کوئی نیٹ ورک SocialMCP کو سائن آؤٹ کر دے۔ یہ پوسٹ پر ہی نظر آتا ہے: targets کی ہر انٹری میں ایک status ہوتا ہے اور ناکامی کی صورت میں ایک error، جیسے reconnect_needed۔ اسے GET /posts/<id> سے چیک کریں۔
حدیں
API وہی پلان اور حدیں استعمال کرتا ہے جو SocialMCP میں باقی سب کچھ: روزانہ اور ماہانہ پوسٹس، X پر لنکس، تصاویر، اور ایک اکاؤنٹ پر پوسٹس کے درمیان مختصر وقفہ۔ GET /me آپ کی حدیں اور آپ کا استعمال دکھاتا ہے۔
ہر وہ اینڈ پوائنٹ جسے آپ API key سے کال کر سکتے ہیں، خود API سے تیار کیا گیا۔ اینڈ پوائنٹس کے نام، فیلڈز اور ان کی تفصیل انگریزی میں ہیں۔
بیس URL: https://getsocialmcp.com/api/v1
Networks
GET/networks
Networks you can post to
Without an API key: the networks open to everyone on SocialMCP. With a key: the networks you can connect and post to, which can include ones still in testing.
جوابات
200Networksobject
401Not signed in, or the API key is wrong
Account
GET/me
Who you are, your settings, connected accounts, and your plan with what you’ve used
422Invalid request (e.g. too long for the network)
POST/login-links
Get a link that opens the dashboard already signed in
Single-use, valid 10 minutes. path is where it opens: /app (calendar), /app?post={id} or /app/settings. Approving agent posts, API keys and agents still need an email sign-in.
403This network is not available (network_unavailable)
Posting times
PUT/posting-times
Set when you usually post
Saves posting times on the given accounts (all connected accounts when none are given). An empty list turns them off. Upcoming posts placed in a time that no longer exists move to the first open posting time from the start of their day (moved); posts left with no posting time keep their time (kept).
409Conflicts with the current state (e.g. account not connected)
422Invalid request (e.g. too long for the network)
GET/posting-times/open
Open posting times in a range
Upcoming posting times that have no post yet, each with the accounts it is open on. Up to about two months at a time.
پیرامیٹرز
fromstring (date-time)(query)لازمی
tostring (date-time)(query)لازمی
جوابات
200Open posting timesobject
401Not signed in, or the API key is wrong
422Invalid request (e.g. too long for the network)
GET/posting-times/next
Where a new post would go
The next open posting time of each account, as POST /posts with postingTime next would use them. Nothing is saved.
پیرامیٹرز
accountsstring(query)لازمی
Comma-separated account ids.
unitsinteger(query)
Number of thread parts, on networks that take threads. Default 1.
جوابات
200Next posting timesobject
401Not signed in, or the API key is wrong
404Not found
409Conflicts with the current state (e.g. account not connected)
Posts
POST/posts
Post now or schedule
Checks length and limits for every network before accepting. Each network’s result appears in targets. With postingTime next, accounts whose next open times differ get a post each: the others are in alsoCreated.
One item per post in a thread, on networks that take threads. Other networks get a single post.
networks("x" | "linkedin")[]
Defaults to your default networks (Settings).
accountsstring[]
Specific account ids, instead of networks.
scheduledAtstring (date-time)
ISO 8601 time. Omit to post now. e.g. 2026-11-21T09:00:00Z
postingTime"next" | string (date-time)
Put the post in your posting times: next for each account’s next open one (accounts whose next times differ get a post each), or one open posting time from GET /posting-times/open. e.g. next
overridesobject
A network’s own version of the post. LinkedIn takes a single part.
idempotencyKeystring
Sending the same key again returns the first post instead of posting twice.
جوابات
200Already created with this idempotencyKeyPost + object
One item per post in a thread, on networks that take threads. Other networks get a single post.
networks("x" | "linkedin")[]
Defaults to your default networks (Settings).
accountsstring[]
Specific account ids, instead of networks.
scheduledAtstring (date-time)
ISO 8601 time. Omit to post now. e.g. 2026-11-21T09:00:00Z
postingTime"next" | string (date-time)
Put the post in your posting times: next for each account’s next open one (accounts whose next times differ get a post each), or one open posting time from GET /posting-times/open. e.g. next
overridesobject
A network’s own version of the post. LinkedIn takes a single part.
idempotencyKeystring
Sending the same key again returns the first post instead of posting twice.
PostingTime
timestringلازمی
Time of day, 24-hour, in your timezone. e.g. 09:00