REST API memungkinkan skrip dan aplikasi Anda melakukan apa yang Anda lakukan di dasbor: posting sekarang, menjadwalkan, mengunggah gambar, dan memeriksa apa yang sudah terbit. API ini memakai JSON lewat HTTPS dan satu kunci API.
Beri nama kunci, misalnya “Skrip rilis”, lalu buat.
Segera salin kuncinya. Kunci diawali smcp_ dan hanya ditampilkan sekali.
Rahasiakan kunci ini seperti kata sandi: siapa pun yang memilikinya bisa memposting ke akun Anda. Simpan di variabel lingkungan atau rahasia CI Anda, jangan pernah di dalam kode. Jika kunci bocor, hapus di tempat yang sama dan buat yang baru.
Hubungkan akun Anda (X dan LinkedIn) di dasbor terlebih dahulu. API memposting ke akun yang sudah Anda hubungkan.
Permintaan pertama Anda
Kirim kunci di header Authorization pada setiap permintaan:
Ini mengembalikan akun, pengaturan, dan paket Anda. Untuk langsung memposting:
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"] }'
Untuk menjadwalkannya, tambahkan waktu dengan offset zona waktu, misalnya "scheduledAt": "2026-12-01T09:00:00+01:00". Respons menampilkan postingan dan hasilnya di setiap jaringan.
Perlu diketahui
Waktu: kirim waktu ISO 8601 dengan offset atau Z. Respons memakai UTC.
Thread di X: kirim parts sebagai ganti text, satu item per postingan dalam thread. LinkedIn menerima bagian-bagian itu digabung menjadi satu postingan, atau hanya bagian pertama, sesuai pengaturan Anda.
Versi berbeda per jaringan: pakai overrides, misalnya teks LinkedIn yang lebih panjang dan thread X yang pendek dalam satu permintaan.
Gambar: unggah dengan POST /media (file, atau tautan https), lalu kirim id yang dikembalikan di mediaIds.
Waktu posting: dengan "postingTime": "next", postingan masuk ke slot kosong berikutnya dari waktu posting yang Anda atur di dasbor.
Tidak ada postingan ganda: kirim idempotencyKey. Jika skrip Anda mencoba lagi dengan kunci yang sama, Anda mendapat kembali postingan pertama dan tidak ada yang terposting dua kali.
Halaman hasil:GET /posts mengembalikan nextCursor. Kirim sebagai cursor untuk mendapatkan halaman berikutnya.
Persetujuan: postingan yang dibuat dengan kunci API Anda sendiri terbit sesuai rencana. Pengaturan “Tunggu persetujuan saya di sini dulu” hanya berlaku untuk agen AI.
Error
Setiap error punya bentuk yang sama. Gunakan code untuk percabangan; message ditulis untuk manusia dan bisa berubah.
{
"error": {
"code": "too_long",
"message": "Part 1 is 312 characters on X; the limit is 280.",
"details": { }
}
}
Kode yang umum:
invalid_api_key (401): kuncinya salah atau sudah dihapus.
invalid_request atau too_long (422): permintaannya tidak sesuai. Pesannya memberi tahu apa yang perlu diubah.
daily_limit, posting_gap atau monthly_limit (429): paket Anda tidak punya ruang pada waktu itu. Untuk hari yang penuh atau postingan yang terlalu berdekatan, details menyarankan waktu berikutnya yang masih ada ruang.
plan_no_images dan kode plan_ lainnya (403): paket Anda tidak mencakup ini. Pesannya memberi tahu paket mana yang mencakupnya.
dashboard_only (403): ini hanya bisa dilakukan di dasbor, misalnya membuat kunci API.
Postingan yang sudah diterima tetap bisa gagal di satu jaringan nanti, misalnya saat sebuah jaringan mengeluarkan SocialMCP dari akun. Hal itu terlihat di postingan itu sendiri: setiap entri di targets punya status dan, jika gagal, error seperti reconnect_needed. Periksa dengan GET /posts/<id>.
Batas
API memakai paket dan batas yang sama dengan bagian lain SocialMCP: postingan per hari dan per bulan, tautan di X, gambar, dan jeda singkat antarpostingan di satu akun. GET /me menampilkan batas Anda dan pemakaian Anda.
Spesifikasi yang bisa dibaca mesin
Spesifikasi lengkap OpenAPI 3.1 ada di https://getsocialmcp.com/api/v1/openapi.json. Gunakan untuk membuat klien dalam bahasa Anda atau untuk mengimpor API ke alat seperti Postman.
Semua endpoint yang bisa Anda panggil dengan kunci API, dibuat langsung dari API-nya. Nama endpoint, field, dan deskripsinya dalam bahasa Inggris.
URL dasar: 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.
Respons
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.
Parameter
fromstring (date-time)(query)wajib
tostring (date-time)(query)wajib
Respons
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.
Parameter
accountsstring(query)wajib
Comma-separated account ids.
unitsinteger(query)
Number of thread parts, on networks that take threads. Default 1.
Respons
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.
Respons
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
timestringwajib
Time of day, 24-hour, in your timezone. e.g. 09:00