REST API দিয়ে আপনার স্ক্রিপ্ট ও অ্যাপ সেই সব কাজ করতে পারে যা আপনি ড্যাশবোর্ডে করেন: এখনই পোস্ট, শিডিউল, ছবি আপলোড আর কী প্রকাশ হলো তা দেখা। এটি HTTPS-এর ওপর JSON ব্যবহার করে এবং একটি API কী দিয়ে চলে।
কী-টির একটি নাম দিন, যেমন “রিলিজ স্ক্রিপ্ট”, তারপর তৈরি করুন।
সঙ্গে সঙ্গে কী-টি কপি করে নিন। এটি smcp_ দিয়ে শুরু হয় এবং মাত্র একবারই দেখানো হয়।
কী-টি পাসওয়ার্ডের মতো গোপন রাখুন: যার কাছে এটি থাকবে, সে আপনার অ্যাকাউন্টে পোস্ট করতে পারবে। এটি একটি এনভায়রনমেন্ট ভেরিয়েবলে বা আপনার CI সিক্রেটে রাখুন, কখনো কোডে নয়। কী ফাঁস হয়ে গেলে একই জায়গা থেকে সেটি মুছে একটি নতুন কী তৈরি করুন।
আগে ড্যাশবোর্ডে আপনার অ্যাকাউন্ট (X এবং LinkedIn) সংযুক্ত করুন। API শুধু আপনার সংযুক্ত অ্যাকাউন্টগুলোতেই পোস্ট করে।
আপনার প্রথম রিকোয়েস্ট
প্রতিটি রিকোয়েস্টের সঙ্গে 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"। রেসপন্সে পোস্টটি আর প্রতিটি নেটওয়ার্কে তার ফলাফল দেখা যায়।
জেনে রাখা ভালো
সময়: অফসেট বা Z সহ ISO 8601 সময় পাঠান। রেসপন্সে UTC ব্যবহার হয়।
X-এ থ্রেড:text-এর বদলে parts পাঠান, থ্রেডের প্রতিটি পোস্টের জন্য একটি আইটেম। আপনার সেটিংস অনুযায়ী LinkedIn সব অংশ মিলিয়ে একটি পোস্ট পায়, অথবা শুধু প্রথম অংশটি।
প্রতিটি নেটওয়ার্কের জন্য আলাদা সংস্করণ:overrides ব্যবহার করুন, যেমন একই রিকোয়েস্টে LinkedIn-এর জন্য লম্বা লেখা আর X-এর জন্য ছোট থ্রেড।
ছবি:POST /media দিয়ে আপলোড করুন (একটি ফাইল, অথবা একটি https লিংক), তারপর ফেরত পাওয়া id mediaIds-এ পাঠান।
পোস্ট করার সময়:"postingTime": "next" দিলে পোস্টটি আপনার ড্যাশবোর্ডে ঠিক করা পোস্ট করার সময়ের পরের খালি স্লটে চলে যায়।
দুবার পোস্ট নয়: একটি idempotencyKey পাঠান। আপনার স্ক্রিপ্ট একই কী দিয়ে আবার চেষ্টা করলে আপনি প্রথম পোস্টটিই ফেরত পাবেন, কিছুই দুবার পোস্ট হবে না।
ফলাফলের পাতা:GET /posts একটি nextCursor ফেরত দেয়। পরের পাতা পেতে সেটি cursor হিসেবে পাঠান।
অনুমোদন: আপনার নিজের API কী দিয়ে করা পোস্ট পরিকল্পনা অনুযায়ী প্রকাশ হয়। “আগে এখানে আমার অনুমোদনের জন্য অপেক্ষা করুন” সেটিংটি শুধু AI এজেন্টের ক্ষেত্রে প্রযোজ্য।
এরর
প্রতিটি এররের গঠন একই। code দেখে সিদ্ধান্ত নিন; message মানুষের পড়ার জন্য লেখা এবং বদলাতে পারে।
{
"error": {
"code": "too_long",
"message": "Part 1 is 312 characters on X; the limit is 280.",
"details": { }
}
}
সাধারণ কোড:
invalid_api_key (401): কী-টি ভুল বা মুছে ফেলা হয়েছে।
invalid_request বা too_long (422): রিকোয়েস্টটি মিলছে না। মেসেজে বলা থাকে কী বদলাতে হবে।
daily_limit, posting_gap বা monthly_limit (429): ওই সময়ে আপনার প্ল্যানে জায়গা নেই। দিন ভরে গেলে বা পোস্ট খুব কাছাকাছি হলে details পরের খালি সময়ের পরামর্শ দেয়।
plan_no_images ও অন্যান্য plan_ কোড (403): আপনার প্ল্যানে এটি নেই। মেসেজে বলা থাকে কোন প্ল্যানে আছে।
dashboard_only (403): এটি শুধু ড্যাশবোর্ডেই করা যায়, যেমন API কী তৈরি করা।
গৃহীত একটি পোস্ট পরে কোনো একটি নেটওয়ার্কে ব্যর্থ হতে পারে, যেমন কোনো নেটওয়ার্ক যখন SocialMCP-কে সাইন আউট করে দেয়। সেটি পোস্টেই দেখা যায়: targets-এর প্রতিটি এন্ট্রিতে একটি status থাকে এবং ব্যর্থ হলে reconnect_needed-এর মতো একটি error থাকে। GET /posts/<id> দিয়ে দেখে নিন।
সীমা
API-তে SocialMCP-এর বাকি সবকিছুর মতোই একই প্ল্যান ও সীমা প্রযোজ্য: দিনে ও মাসে পোস্টের সংখ্যা, X-এ লিংক, ছবি, আর একটি অ্যাকাউন্টে দুটি পোস্টের মধ্যে অল্প বিরতি। GET /me আপনার সীমা আর আপনি কতটা ব্যবহার করেছেন তা দেখায়।
API কী দিয়ে আপনি যত এন্ডপয়েন্ট কল করতে পারেন, সবই এখানে, সরাসরি 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