للمطوّرين
توثيق الواجهة البرمجية وMCP في Lunar Post
جدول الفيديوهات والصور على حسابات عملائك من شيفرتك الخاصة، أو دع Claude وCursor يتوليان ذلك. مفتاح واحد يعمل مع الواجهة البرمجية وخادم MCP معًا.
العنوان الأساسيhttps://post.lnr.ae/api/post/v1
في هذه الصفحة
نظرة عامة
يوفّر Lunar Post واجهة برمجية REST لخوادمك، وخادم MCP لأدوات الذكاء الاصطناعي مثل Claude وCursor. وكلاهما يعمل في مساحة العمل التي يتبع لها المفتاح، ويتشاركان خطتها وملفاتها وحساباتها المتصلة.
- واجهة REST
- https://post.lnr.ae/api/post/v1
- خادم MCP
- https://post.lnr.ae/api/post/mcp
ما يمكنك فعله
- الملفات والحساباتالملف هو أحد عملائك. لكل ملف حساباته المتصلة الخاصة به، ولا تنتقل المنشورات بين الملفات أبدًا.
- الوسائطارفع فيديو أو صورة، أو أرسل رابطًا إليهما. يُفحص كل ملف قبل أن يصبح قابلًا للنشر.
- المنشوراتجدول عنصر وسائط واحدًا على حسابات ملف ما مع تعليق لكل شبكة، ثم تابع المنشورات وعدّلها.
- الاستهلاكموقف مساحة العمل من خطة Lunar Post هذا الشهر.
البدء السريع
احصل على مفتاح
افتح لوحة التحكم، ثم انتقل إلى مفاتيح API وأنشئ مفتاحًا. انسخه فورًا، فهو لا يظهر إلا مرة واحدة.
تحقّق من خطتك
اطلب استهلاك هذا الشهر. إذا كان المفتاح يعمل، تصلك خطتك وعدد المنشورات المتبقية.
curl https://post.lnr.ae/api/post/v1/usage \ -H "Authorization: Bearer YOUR_API_KEY"أضف عميلًا وانشر
أنشئ ملفًا، وأرسل رابط الربط الخاص به، وارفع الوسائط ثم جدولها. تجد كل نقطة نهاية في مرجع الواجهة البرمجية أدناه، مع مثال جاهز للنسخ.
إثبات الهوية
أرسل المفتاح في ترويسة Authorization مع كل طلب، على هيئة رمز Bearer.
Authorization: Bearer YOUR_API_KEYكل مفتاح إما للقراءة فقط، أو للقراءة والكتابة، أو (إذا أنشأه مالك مساحة العمل) للقراءة والكتابة والموافقة. توضح كل نقطة نهاية وكل أداة الصلاحية التي تحتاجها.
تعامل مع المفتاح كما تتعامل مع كلمة المرور. احفظه على خادمك أو في إعدادات أداة الذكاء الاصطناعي، ولا تضعه أبدًا في صفحة ويب أو مستودع عام. ألغِه من لوحة التحكم فور شكّك في تسرّبه.
اربط Claude أو Cursor
يتيح خادم MCP لأداة الذكاء الاصطناعي أن تستخدم Lunar Post نيابةً عنك: تعرض الملفات وترفع الوسائط وتجدول المنشورات حين تطلب ذلك. استبدل YOUR_API_KEY بمفتاحك.
Claude Code
شغّل هذا الأمر مرة واحدة في الطرفية، وبعدها يستطيع Claude Code استخدام Lunar Post في كل مشاريعك.
claude mcp add --transport http lunar-post \
https://post.lnr.ae/api/post/mcp \
--header "Authorization: Bearer YOUR_API_KEY"Claude Desktop
في Claude Desktop افتح Settings ثم Developer ثم Edit config، وأضف هذا إلى claude_desktop_config.json ثم أعد تشغيل Claude. يتصل Claude Desktop بالخادم عبر mcp-remote، لذا يحتاج إلى تثبيت Node.js.
{
"mcpServers": {
"lunar-post": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://post.lnr.ae/api/post/mcp",
"--header",
"Authorization:${LUNAR_POST_AUTH}"
],
"env": {
"LUNAR_POST_AUTH": "Bearer YOUR_API_KEY"
}
}
}
}Cursor
أضف هذا إلى ~/.cursor/mcp.json ليشمل كل المشاريع، أو إلى .cursor/mcp.json داخل مشروع واحد.
{
"mcpServers": {
"lunar-post": {
"url": "https://post.lnr.ae/api/post/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}عملاء MCP الآخرون
يمكن لأي عميل يدعم MCP عبر Streamable HTTP الاتصال. أعطه عنوان الخادم وأرسل المفتاح على هيئة رمز Bearer.
URL: https://post.lnr.ae/api/post/mcp
Header: Authorization: Bearer YOUR_API_KEYربط حسابات العميل
لا تربط حسابات عميلك بنفسك أبدًا. أنشئ رابط ربط لملفه وأرسله إليه: يسجّل الدخول من صفحة كل شبكة نفسها، ثم يعيده Lunar Post إلى موقعك.
أنشئ ملفًا للعميل مرة واحدة، وضع معرّفك الخاص به في
externalRef.أنشئ رابط ربط مع
returnUrlعلى موقعك. يعمل الرابط ساعة واحدة، أو حدّدttlSecondsمن 5 دقائق إلى 24 ساعة.أرسل العميل إلى الرابط. حين ينتهي، يصل إلى
returnUrlومعهstatusبقيمةconnectedأوcancelledأوfailed، ومعرّف الملف فيprofile.اعرض حسابات الملف لتحصل على المعرّفات التي تجدول المنشورات عليها.
curl -X POST https://post.lnr.ae/api/post/v1/profiles/PROFILE_ID/connect-links \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "returnUrl": "https://app.example.com/connected", "networks": ["instagram", "tiktok"] }'
# → { "data": { "url": "https://post.lnr.ae/connect/…", "expiresAt": "…" }, "error": null }يستطيع أي شخص يملك الرابط ربط حسابات بذلك الملف حتى تنتهي صلاحيته، فلا ترسله إلا إلى العميل.
أدوات MCP
في خادم MCP 18 أداة. تختار أداة الذكاء الاصطناعي الأداة المناسبة مما تطلبه، فنادرًا ما تحتاج إلى تسميتها بنفسك.
get_usageقراءةGet usage. Get the workspace's Lunar Post plan, this month's posts used against its limit (one post per account posted to, UTC calendar month) and live profiles against the plan's profiles.
list_profilesقراءةList profiles. List the workspace's profiles, newest first.
create_profileتسأل أولًاكتابةCreate profile. Create a profile for one of the developer's customers.
get_profileقراءةGet profile. Get one profile with its accounts: each account's id, network, handle and status (connected, needs_reauth or disconnected; only connected accounts can post).
create_connect_linkكتابةCreate connect link. Make a short-lived link (1 hour by default) to a Lunar Post page where the profile's owner connects their social accounts by signing in on each network's own page.
list_accountsقراءةList accounts. List a profile's connected accounts: the ids schedule_post takes in accountIds, with network, handle, status and timezone.
create_upload_urlكتابةCreate upload URL. Start uploading a video (MP4 or MOV, up to 1 GB) or image (JPEG, PNG or WebP, up to 20 MB) you have as a file.
complete_uploadكتابةComplete upload. Finish an upload after the PUT: checks the stored file's size and type, saves it as media and starts its content check.
import_media_from_urlكتابةImport media from a link. Fetch a video or image from a public https link, check its real type and size, save it as media and start its content check.
list_mediaقراءةList media. List the workspace's Lunar Post media, newest first, with each item's id, kind, profile and contentCheck (pending, passed or held; only passed media can be posted).
schedule_postتسأل أولًاكتابةSchedule post. Schedule one media item to one or more of a profile's accounts, with a caption per network.
publish_nowتسأل أولًاكتابةPublish now. Post one media item to one or more of a profile's accounts right away, with a caption per network.
list_postsقراءةList posts. List Lunar Post posts, latest scheduled first, with status, time, live link (externalUrl) and failureReason.
get_postقراءةGet post. Get one post: its status (scheduled, publishing, published, failed…), when it goes or went out, the live link once published and the reason if it failed.
update_postتسأل أولًاكتابةUpdate post. Move a post that hasn't gone out to a new time and/or change its caption and hashtags.
cancel_postتسأل أولًاكتابةCancel post. Cancel a post that hasn't gone out.
retry_postتسأل أولًاكتابةRetry post. Send a failed post again (it goes out in about 3 minutes).
approve_postتسأل أولًاموافقةApprove post. Approve a post waiting for the workspace owner's review, which schedules it.
تسأل أولًاتعرض معاينة وتنتظر موافقتك قبل أن تغيّر أي شيء.
الخطط والحدود
الحدود ثابتة: بعد بلوغها يُرفض الطلب بالرمز plan_limit ولا تُضاف أي رسوم. المنشور الواحد هو حساب واحد يُنشر عليه، ويُحتسب حسب الشهر الميلادي بتوقيت UTC.
| الخطة | المنشورات شهريًا | الملفات |
|---|---|---|
| التجربة | 50 | 1 |
| Starter | 500 | 5 |
| Growth | 2,500 | 25 |
| Scale | 10,000 | 100 |
يستطيع كل مفتاح إرسال 60 طلبًا في الدقيقة. بعد ذلك يصلك الرمز rate_limited (HTTP 429) مع ترويسة Retry-After تحدد عدد الثواني التي تنتظرها.
الاستجابات والأخطاء
كل استجابة بصيغة JSON بحقلين: data وerror. عند النجاح يحمل data النتيجة ويكون error فارغًا (null). وعند الإخفاق يحدث العكس، ويحمل error رمزًا code تتصرف بناءً عليه ورسالة message يمكنك عرضها على الشخص.
نجاح
{
"data": {
"posts": {
"used": 12,
"limit": 50
},
"profiles": {
"used": 2,
"limit": 3
}
},
"error": null
}إخفاق
{
"data": null,
"error": {
"code": "plan_limit",
"message": "This workspace has used its 50 posts for this month on the Trial plan. Posting opens again on the 1st (UTC)."
}
}| الرمز | حالة HTTP | معناه |
|---|---|---|
invalid_input | 400 | حقل مفقود أو خارج النطاق المسموح. توضح الرسالة أي حقل. |
plan_limit | 403 | استُهلكت منشورات الشهر أو ملفات الخطة أو مساحة تخزين الوسائط، أو انتهت التجربة. |
rate_limited | 429 | طلبات كثيرة من هذا المفتاح. انتظر عدد الثواني المذكور في Retry-After. |
unauthorized | 401 | المفتاح مفقود أو تالف أو ملغى أو منتهي الصلاحية. |
forbidden | 403 | لا يستطيع المفتاح فعل ذلك: مفتاح للقراءة فقط حاول الكتابة، أو ينقصه صلاحية الموافقة. |
not_found | 404 | لا يوجد شيء بهذا المعرّف في مساحة العمل. |
invalid_json | 400 | نص الطلب ليس JSON صالحًا. |
internal | 500 | حدث خطأ من جهتنا. حاول مرة أخرى، وإذا تكرر فأخبرنا. |
OpenAPI
الواجهة البرمجية كلها موصوفة في ملف OpenAPI 3.1 واحد. استورده إلى Postman أو Insomnia، أو أعطه لـ Cursor أو أداة ذكاء اصطناعي أخرى كسياق، أو أنشئ منه عميلًا بلغتك البرمجية.
curl -o lunar-post-openapi.json https://post.lnr.ae/api/post/v1/openapi.jsonمرجع الواجهة البرمجية
الملفات والحسابات
الملف هو أحد عملائك. لكل ملف حساباته المتصلة الخاصة به، ولا تنتقل المنشورات بين الملفات أبدًا.
/api/post/v1/profilesعرض الملفات
قراءةالملفات النشطة في مساحة العمل، من الأحدث إلى الأقدم. ابحث عن ملف بمعرّفك الخاص عبر `externalRef`، وأضف `includeArchived=true` لعرض الملفات المؤرشفة أيضًا.
أداة MCP: list_profiles
المعاملات
externalRefstringالاستعلاماختياريOnly the profile with this externalRef. (at most 200 characters)
includeArchivedbooleanالاستعلاماختياريInclude archived profiles. Default false.
limitintegerالاستعلاماختياريHow many to return. Default 100. (1–250)
مثال على الطلب
curl https://post.lnr.ae/api/post/v1/profiles \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
HTTP 200{
"data": {
"profiles": [
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Acme Coffee",
"externalRef": "cus_8841",
"createdAt": "2026-11-14T09:12:00.000Z",
"archivedAt": null
}
]
},
"error": null
}/api/post/v1/profilesإنشاء ملف
كتابةيضيف ملفًا لأحد عملائك. يستهلك ملفًا واحدًا من ملفات الخطة، ويُرفض بالرمز `plan_limit` عندما تكون كلها مستخدمة (أرشف ملفًا لتحريره).
أداة MCP: create_profile
المعاملات
preview"1"الاستعلاماختياري`1` runs every check and returns `{ preview }` (what would happen) without changing anything.
محتوى الطلب
namestringمطلوبThe customer's name, shown on the connect page. (1–80 characters)
externalRefstring | nullاختياريYour own id for this customer. Unique among live profiles; null clears it. (at most 200 characters)
مثال على الطلب
curl -X POST https://post.lnr.ae/api/post/v1/profiles \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Coffee",
"externalRef": "cus_8841"
}'مثال على الاستجابة
HTTP 201{
"data": {
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Acme Coffee",
"externalRef": "cus_8841",
"createdAt": "2026-11-14T09:12:00.000Z",
"archivedAt": null
},
"error": null
}/api/post/v1/profiles/{id}عرض ملف
قراءةملف واحد مع حساباته. وحدها الحسابات ذات الحالة `connected` يمكنها النشر، وتعني `needs_reauth` أن على العميل ربط الحساب من جديد.
أداة MCP: get_profile
المعاملات
idstring (uuid)المسارمطلوبThe profile's id, from List profiles or Create a profile.
مثال على الطلب
curl https://post.lnr.ae/api/post/v1/profiles/ID \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
HTTP 200{
"data": {
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Acme Coffee",
"externalRef": "cus_8841",
"createdAt": "2026-11-14T09:12:00.000Z",
"archivedAt": null,
"accounts": [
{
"id": "c4a1e2f3-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"platform": "instagram",
"handle": "acmecoffee",
"avatarUrl": "https://cdn.example.com/avatars/acme.jpg",
"status": "connected",
"timezone": "Asia/Dubai"
},
{
"id": "d7e8f9a0-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
"platform": "tiktok",
"handle": "acme.coffee",
"avatarUrl": null,
"status": "connected",
"timezone": "Asia/Dubai"
}
]
},
"error": null
}/api/post/v1/profiles/{id}تعديل ملف
كتابةيغيّر اسم ملف نشط، أو يغيّر قيمة externalRef أو يمسحها. أرسل واحدًا منهما على الأقل.
المعاملات
idstring (uuid)المسارمطلوبThe profile's id, from List profiles or Create a profile.
محتوى الطلب
namestringاختياريThe customer's name, shown on the connect page. (1–80 characters)
externalRefstring | nullاختياريYour own id for this customer. Unique among live profiles; null clears it. (at most 200 characters)
مثال على الطلب
curl -X PATCH https://post.lnr.ae/api/post/v1/profiles/ID \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Coffee Roasters"
}'مثال على الاستجابة
HTTP 200{
"data": {
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Acme Coffee Roasters",
"externalRef": "cus_8841",
"createdAt": "2026-11-14T09:12:00.000Z",
"archivedAt": null
},
"error": null
}/api/post/v1/profiles/{id}/archiveأرشفة ملف
كتابةيؤرشف الملف ليحرّر ملفًا من ملفات الخطة. يُرفض ما دامت لديه منشورات تنتظر النشر، فألغِها أولًا. أرشفة ملف مؤرشف لا تغيّر شيئًا.
المعاملات
idstring (uuid)المسارمطلوبThe profile's id, from List profiles or Create a profile.
مثال على الطلب
curl -X POST https://post.lnr.ae/api/post/v1/profiles/ID/archive \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
HTTP 200{
"data": {
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Acme Coffee",
"externalRef": "cus_8841",
"createdAt": "2026-11-14T09:12:00.000Z",
"archivedAt": "2026-11-18T12:00:00.000Z"
},
"error": null
}/api/post/v1/profiles/{id}/accountsعرض حسابات ملف
قراءةالحسابات المتصلة بالملف: المعرّفات التي يأخذها طلب جدولة المنشور في `accountIds`، مع الشبكة واسم المستخدم والحالة والمنطقة الزمنية.
أداة MCP: list_accounts
المعاملات
idstring (uuid)المسارمطلوبThe profile's id, from List profiles or Create a profile.
مثال على الطلب
curl https://post.lnr.ae/api/post/v1/profiles/ID/accounts \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
HTTP 200{
"data": {
"accounts": [
{
"id": "c4a1e2f3-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"platform": "instagram",
"handle": "acmecoffee",
"avatarUrl": "https://cdn.example.com/avatars/acme.jpg",
"status": "connected",
"timezone": "Asia/Dubai"
},
{
"id": "d7e8f9a0-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
"platform": "tiktok",
"handle": "acme.coffee",
"avatarUrl": null,
"status": "connected",
"timezone": "Asia/Dubai"
}
]
},
"error": null
}/api/post/v1/profiles/{id}/connect-linksإنشاء رابط ربط
كتابةرابط قصير الأجل إلى صفحة من Lunar Post يربط فيها عميلك حساباته، فيسجّل الدخول من صفحة كل شبكة نفسها. أرسله إليها، وعند الانتهاء يعود إلى `returnUrl` مع `?status=connected|cancelled|failed&profile=<id>`. من يملك الرابط يستطيع ربط حسابات بهذا الملف حتى تنتهي صلاحيته.
أداة MCP: create_connect_link
المعاملات
idstring (uuid)المسارمطلوبThe profile's id, from List profiles or Create a profile.
محتوى الطلب
returnUrlstringمطلوبFull https address on a public host name. (at most 2000 characters)
networksarray of "instagram" | "tiktok" | "linkedin" | "facebook" | "threads" | "youtube" | "pinterest"اختياريNetworks the page offers. All of them when left out. (at most 10 items)
ttlSecondsintegerاختياريHow long the link works. Default 3600 (an hour). (300–86400)
مثال على الطلب
curl -X POST https://post.lnr.ae/api/post/v1/profiles/ID/connect-links \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"returnUrl": "https://app.example.com/settings/social?customer=cus_8841",
"networks": [
"instagram",
"tiktok"
]
}'مثال على الاستجابة
HTTP 201{
"data": {
"url": "https://post.lnr.ae/connect/eyJ2IjoxLCJ3b3Jrc3BhY2VJZCI6Ii4uLiJ9.7c9e6679",
"expiresAt": "2026-11-14T11:12:00.000Z"
},
"error": null
}الوسائط
ارفع فيديو أو صورة، أو أرسل رابطًا إليهما. يُفحص كل ملف قبل أن يصبح قابلًا للنشر.
/api/post/v1/media/uploadsإنشاء رابط رفع
كتابةالخطوة الأولى في الرفع: يُرجع رابط `uploadUrl` موقّعًا و`headers` المطلوبة و`storagePath`. أرسل محتوى الملف بطلب PUT إلى `uploadUrl` مع تلك الترويسات خلال ساعتين، ثم أكمل الرفع. الفيديو: MP4 أو MOV حتى 1 غيغابايت. الصور: JPEG أو PNG أو WebP حتى 20 ميغابايت.
أداة MCP: create_upload_url
محتوى الطلب
fileNamestringمطلوبWith its extension, e.g. launch.mp4. (1–200 characters)
contentType"video/mp4" | "video/quicktime" | "image/jpeg" | "image/png" | "image/webp"مطلوبsizeBytesintegerمطلوبThe file's exact size in bytes. (at least 1)
profileIdstring | null (uuid)اختياريFile it under this profile (only its posts can use it). Leave out to share it across your profiles.
مثال على الطلب
curl -X POST https://post.lnr.ae/api/post/v1/media/uploads \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fileName": "cold-brew-launch.mp4",
"contentType": "video/mp4",
"sizeBytes": 48211904,
"profileId": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}'مثال على الاستجابة
HTTP 201{
"data": {
"storagePath": "1b4e28ba-2fa1-41d2-883f-0016d3cca427/post/7c9e6679-7425-40de-944b-e07fc1f90ae7/0f7e5c1a-3b2d-4e6f-8a9b-1c2d3e4f5a6b-cold-brew-launch.mp4",
"uploadUrl": "https://storage.example.com/object/upload/sign/media/…?token=…",
"method": "PUT",
"headers": {
"Content-Type": "video/mp4"
},
"expiresAt": "2026-11-14T12:02:00.000Z",
"kind": "video"
},
"error": null
}/api/post/v1/media/uploads/completeإكمال الرفع
كتابةالخطوة الثانية بعد طلب PUT: يتحقق من الحجم والنوع الفعليين للملف المخزَّن (ويحذفه إن لم يطابقا ما صرّحت به)، ثم يحفظه وسائط ويبدأ فحص محتواه. تبقى `contentCheck` بالقيمة `pending` حتى ينتهي الفحص، وعادةً في أقل من دقيقة.
أداة MCP: complete_upload
محتوى الطلب
storagePathstringمطلوب(at most 400 characters)
sizeBytesintegerمطلوب(at least 1)
titlestringاختياريA name for the media; also the YouTube title when the post has none. (at most 200 characters)
مثال على الطلب
curl -X POST https://post.lnr.ae/api/post/v1/media/uploads/complete \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"storagePath": "1b4e28ba-2fa1-41d2-883f-0016d3cca427/post/7c9e6679-7425-40de-944b-e07fc1f90ae7/0f7e5c1a-3b2d-4e6f-8a9b-1c2d3e4f5a6b-cold-brew-launch.mp4",
"sizeBytes": 48211904,
"title": "Cold brew launch"
}'مثال على الاستجابة
HTTP 201{
"data": {
"id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"profileId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"kind": "video",
"source": "upload",
"name": "cold-brew-launch.mp4",
"title": "Cold brew launch",
"createdAt": "2026-11-14T10:02:00.000Z",
"contentCheck": "pending"
},
"error": null
}/api/post/v1/media/importالاستيراد من رابط
كتابةيجلب فيديو أو صورة من رابط https عام، ويقرأ نوعه الفعلي من الملف نفسه، ويحدّ حجمه أثناء التنزيل، ثم يحفظه وسائط ويبدأ فحص محتواه. تُرفض الروابط إلى عناوين خاصة أو محلية.
أداة MCP: import_media_from_url
محتوى الطلب
urlstringمطلوبPublic https link to the file itself. (at most 2000 characters)
profileIdstring | null (uuid)اختياريFile it under this profile (only its posts can use it). Leave out to share it across your profiles.
titlestringاختياريA name for the media; also the YouTube title when the post has none. (at most 200 characters)
fileNamestringاختياريName to store it under. Taken from the link when left out. (at most 200 characters)
مثال على الطلب
curl -X POST https://post.lnr.ae/api/post/v1/media/import \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://cdn.example.com/renders/cold-brew-launch.mp4",
"profileId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"title": "Cold brew launch"
}'مثال على الاستجابة
HTTP 201{
"data": {
"id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"profileId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"kind": "video",
"source": "link",
"name": "cold-brew-launch.mp4",
"title": "Cold brew launch",
"createdAt": "2026-11-14T10:02:00.000Z",
"contentCheck": "pending"
},
"error": null
}/api/post/v1/mediaعرض الوسائط
قراءةوسائط Lunar Post في مساحة العمل، من الأحدث إلى الأقدم، مع `contentCheck` لكل عنصر: `pending` أو `passed` (قابل للنشر) أو `held` (بانتظار مراجعة المحتوى ولا يمكن نشره). تُقسَّم النتائج إلى صفحات عبر `nextCursor`.
أداة MCP: list_media
المعاملات
profileIdstringالاستعلاماختياريA profile id, or `shared` for media shared across profiles.
kind"video" | "image"الاستعلاماختياريOnly videos or only images.
limitintegerالاستعلاماختياريHow many to return. Default 20. (1–100)
cursorstringالاستعلاماختياريThe nextCursor from the previous page.
مثال على الطلب
curl https://post.lnr.ae/api/post/v1/media \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
HTTP 200{
"data": {
"media": [
{
"id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"profileId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"kind": "video",
"source": "upload",
"name": "cold-brew-launch.mp4",
"title": "Cold brew launch",
"createdAt": "2026-11-14T10:02:00.000Z",
"contentCheck": "passed"
}
],
"nextCursor": null
},
"error": null
}/api/post/v1/media/{id}عرض عنصر وسائط
قراءةعنصر وسائط واحد مع نتيجة فحص محتواه. استعلم عنه بعد الرفع حتى تصبح `contentCheck` بالقيمة `passed`.
المعاملات
idstring (uuid)المسارمطلوبThe media item's id, from Complete an upload, Import from a link or List media.
مثال على الطلب
curl https://post.lnr.ae/api/post/v1/media/ID \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
HTTP 200{
"data": {
"id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"profileId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"kind": "video",
"source": "upload",
"name": "cold-brew-launch.mp4",
"title": "Cold brew launch",
"createdAt": "2026-11-14T10:02:00.000Z",
"contentCheck": "passed"
},
"error": null
}/api/post/v1/media/{id}حذف عنصر وسائط
كتابةيحذف الملف. يُرفض ما دامت هناك منشورات تستخدمه وتنتظر النشر، فألغِها أولًا. تحتفظ المنشورات التي نُشرت بسجلها.
المعاملات
idstring (uuid)المسارمطلوبThe media item's id, from Complete an upload, Import from a link or List media.
مثال على الطلب
curl -X DELETE https://post.lnr.ae/api/post/v1/media/ID \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
HTTP 200{
"data": {
"id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"deleted": true
},
"error": null
}المنشورات
جدول عنصر وسائط واحدًا على حسابات ملف ما مع تعليق لكل شبكة، ثم تابع المنشورات وعدّلها.
/api/post/v1/postsجدولة منشور
كتابةينشر عنصر وسائط واحدًا على حساب أو أكثر من حسابات ملف ما: قيمة `when` وقت محدد أو `"now"` أو `"next_free_slot"`. كل حساب يستهلك منشورًا واحدًا من منشورات هذا الشهر، يُحجز قبل كتابة أي شيء ويُرفض بالرمز `plan_limit` عند بلوغ الحد. تعمل المفاتيح بصلاحية محرّر: في مساحة عمل تراجع المنشورات، تنتظر المنشورات موافقة المالك (`awaitingApproval`).
أداة MCP: schedule_post
المعاملات
preview"1"الاستعلاماختياري`1` runs every check and returns `{ preview }` (what would happen) without changing anything.
محتوى الطلب
mediaIdstring (uuid)مطلوبMedia whose content check passed.
accountIdsarray of string (uuid)مطلوبAll from the same profile. Each account counts as one post. (1–25 items)
whenstringمطلوب"now", "next_free_slot" (each account's next posting time) or an ISO 8601 time with offset at least 2 minutes ahead.
profileIdstring | null (uuid)اختياريThe profile whose accounts you post to. Null or absent: the workspace's own accounts.
captionsobjectاختياريOne caption per network.
captionobjectاختياريThe caption for every network without an entry in captions.
titlestringاختياريYouTube and Pinterest title. (at most 100 characters)
sendForReviewbooleanاختياريHold the posts for the workspace owner's approval.
aiGeneratedbooleanاختياريLabel the post as AI-generated where the network supports it (YouTube, TikTok).
tiktokobjectاختياريyoutubeobjectاختياري
مثال على الطلب
curl -X POST https://post.lnr.ae/api/post/v1/posts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mediaId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"profileId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"accountIds": [
"c4a1e2f3-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"d7e8f9a0-1b2c-4d3e-8f4a-5b6c7d8e9f0a"
],
"captions": {
"instagram": {
"caption": "Cold brew is back. Twelve hours steeped, zero bitterness.",
"hashtags": [
"coldbrew",
"acmecoffee"
]
},
"tiktok": {
"caption": "POV: your coffee took 12 hours so you don'\''t have to wait",
"hashtags": [
"coldbrew"
]
}
},
"when": "2026-11-20T09:00:00+04:00",
"aiGenerated": true
}'مثال على الاستجابة
HTTP 201{
"data": {
"postIds": [
"3f8f6c1e-2b4a-4c3d-9e5f-1a2b3c4d5e6f",
"8b2d4f6a-1c3e-4a5b-9d7f-0e2a4c6b8d1f"
],
"awaitingApproval": false,
"usage": {
"used": 14,
"limit": 50
}
},
"error": null
}/api/post/v1/postsعرض المنشورات
قراءةمنشورات Lunar Post، من الأحدث موعدًا، مع الحالة ورابط المنشور وسبب الفشل. صفِّها حسب الملف والحساب والشبكة والحالة ونافذة زمنية على موعد النشر.
أداة MCP: list_posts
المعاملات
profileIdstringالاستعلاماختياريA profile id, or `unprofiled` for the workspace's own accounts.
accountIdstring (uuid)الاستعلاماختياريOnly this account's posts.
platform"instagram" | "tiktok" | "linkedin" | "facebook" | "threads" | "youtube" | "pinterest"الاستعلاماختياريOnly this network.
status"draft" | "ready" | "approved" | "scheduled" | "publishing" | "awaiting_creator" | "published" | "failed" | "cancelled"الاستعلاماختياريOnly posts in this status.
fromstring (date-time)الاستعلاماختياريScheduled at or after (ISO 8601 with offset).
tostring (date-time)الاستعلاماختياريScheduled before (ISO 8601 with offset).
limitintegerالاستعلاماختياريHow many to return. Default 20. (1–100)
مثال على الطلب
curl https://post.lnr.ae/api/post/v1/posts \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
HTTP 200{
"data": {
"posts": [
{
"id": "3f8f6c1e-2b4a-4c3d-9e5f-1a2b3c4d5e6f",
"platform": "instagram",
"accountId": "c4a1e2f3-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"status": "scheduled",
"caption": "Cold brew is back. Twelve hours steeped, zero bitterness.",
"hashtags": [
"coldbrew",
"acmecoffee"
],
"scheduledFor": "2026-11-20T05:00:00.000Z",
"publishedAt": null,
"externalUrl": null,
"failureReason": null,
"videoId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"mediaId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"profileId": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
]
},
"error": null
}/api/post/v1/posts/{id}عرض منشور
قراءةمنشور واحد: حالته، وموعد نشره، ورابطه المباشر بعد النشر (`externalUrl`)، و`failureReason` إن فشل.
أداة MCP: get_post
المعاملات
idstring (uuid)المسارمطلوبThe post's id, from Schedule a post (postIds) or List posts.
مثال على الطلب
curl https://post.lnr.ae/api/post/v1/posts/ID \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
HTTP 200{
"data": {
"id": "3f8f6c1e-2b4a-4c3d-9e5f-1a2b3c4d5e6f",
"platform": "instagram",
"accountId": "c4a1e2f3-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"status": "published",
"caption": "Cold brew is back. Twelve hours steeped, zero bitterness.",
"hashtags": [
"coldbrew",
"acmecoffee"
],
"scheduledFor": "2026-11-20T05:00:00.000Z",
"publishedAt": "2026-11-20T05:00:41.000Z",
"externalUrl": "https://www.instagram.com/reel/C9xYz12AbCd/",
"failureReason": null,
"videoId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"mediaId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"profileId": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
},
"error": null
}/api/post/v1/posts/{id}تعديل منشور
كتابةينقل منشورًا لم يُنشر بعد إلى موعد آخر و/أو يغيّر تعليقه ووسومه. في مساحة عمل تراجع المنشورات، يعود المنشور الموافَق عليه إلى انتظار الموافقة عند تعديله.
أداة MCP: update_post
المعاملات
idstring (uuid)المسارمطلوبThe post's id, from Schedule a post (postIds) or List posts.
preview"1"الاستعلاماختياري`1` runs every check and returns `{ preview }` (what would happen) without changing anything.
محتوى الطلب
whenstringاختياريISO 8601 with offset, at least 2 minutes ahead.
captionstringاختياري(at most 5000 characters)
hashtagsarray of stringاختياري(at most 30 items)
مثال على الطلب
curl -X PATCH https://post.lnr.ae/api/post/v1/posts/ID \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"when": "2026-11-21T09:00:00+04:00"
}'مثال على الاستجابة
HTTP 200{
"data": {
"id": "3f8f6c1e-2b4a-4c3d-9e5f-1a2b3c4d5e6f",
"platform": "instagram",
"accountId": "c4a1e2f3-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"status": "scheduled",
"caption": "Cold brew is back. Twelve hours steeped, zero bitterness.",
"hashtags": [
"coldbrew",
"acmecoffee"
],
"scheduledFor": "2026-11-21T05:00:00.000Z",
"publishedAt": null,
"externalUrl": null,
"failureReason": null,
"videoId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"mediaId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"profileId": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
},
"error": null
}/api/post/v1/posts/{id}إلغاء منشور
كتابةيلغي منشورًا لم يُنشر بعد. لن يُنشر، ويعود المنشور الذي استهلكه إلى رصيد شهره.
أداة MCP: cancel_post
المعاملات
idstring (uuid)المسارمطلوبThe post's id, from Schedule a post (postIds) or List posts.
preview"1"الاستعلاماختياري`1` runs every check and returns `{ preview }` (what would happen) without changing anything.
مثال على الطلب
curl -X DELETE https://post.lnr.ae/api/post/v1/posts/ID \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
HTTP 200{
"data": {
"id": "3f8f6c1e-2b4a-4c3d-9e5f-1a2b3c4d5e6f",
"platform": "instagram",
"accountId": "c4a1e2f3-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"status": "cancelled",
"caption": "Cold brew is back. Twelve hours steeped, zero bitterness.",
"hashtags": [
"coldbrew",
"acmecoffee"
],
"scheduledFor": "2026-11-20T05:00:00.000Z",
"publishedAt": null,
"externalUrl": null,
"failureReason": null,
"videoId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"mediaId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"profileId": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
},
"error": null
}/api/post/v1/posts/{id}/retryإعادة محاولة منشور
كتابةيرسل منشورًا فاشلًا من جديد بعد نحو 3 دقائق. إن كان سبب الفشل أن الحساب يحتاج إلى إعادة الربط، فأرسل إلى العميل رابط ربط جديدًا أولًا.
أداة MCP: retry_post
المعاملات
idstring (uuid)المسارمطلوبThe post's id, from Schedule a post (postIds) or List posts.
preview"1"الاستعلاماختياري`1` runs every check and returns `{ preview }` (what would happen) without changing anything.
مثال على الطلب
curl -X POST https://post.lnr.ae/api/post/v1/posts/ID/retry \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
HTTP 200{
"data": {
"id": "3f8f6c1e-2b4a-4c3d-9e5f-1a2b3c4d5e6f",
"platform": "instagram",
"accountId": "c4a1e2f3-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"status": "scheduled",
"caption": "Cold brew is back. Twelve hours steeped, zero bitterness.",
"hashtags": [
"coldbrew",
"acmecoffee"
],
"scheduledFor": "2026-11-20T05:08:00.000Z",
"publishedAt": null,
"externalUrl": null,
"failureReason": null,
"videoId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"mediaId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"profileId": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
},
"error": null
}/api/post/v1/posts/{id}/approveالموافقة على منشور
موافقةيوافق على منشور ينتظر المراجعة (الحالة `ready`) فيُجدوَل. يتطلب مفتاحًا بصلاحية الموافقة، ولا ينشئه إلا مالك مساحة العمل.
أداة MCP: approve_post
المعاملات
idstring (uuid)المسارمطلوبThe post's id, from Schedule a post (postIds) or List posts.
preview"1"الاستعلاماختياري`1` runs every check and returns `{ preview }` (what would happen) without changing anything.
مثال على الطلب
curl -X POST https://post.lnr.ae/api/post/v1/posts/ID/approve \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
HTTP 200{
"data": {
"id": "3f8f6c1e-2b4a-4c3d-9e5f-1a2b3c4d5e6f",
"status": "scheduled",
"scheduledFor": "2026-11-20T05:00:00.000Z"
},
"error": null
}الاستهلاك
موقف مساحة العمل من خطة Lunar Post هذا الشهر.
/api/post/v1/usageعرض الاستهلاك
قراءةالخطة، ومنشورات هذا الشهر المستخدمة مقابل حدها (منشور واحد لكل حساب يُنشر عليه، ويُحتسب حسب الشهر الميلادي بتوقيت UTC)، والملفات النشطة مقابل ملفات الخطة. الحدود صارمة: بعد بلوغها تُرفض عمليات الكتابة بالرمز `plan_limit`. قيمة `plan` هي `trial` أو `starter` أو `growth` أو `scale` أو `none` (انتهت التجربة دون خطة مدفوعة: يبقى كل شيء متاحًا للقراءة، لكن النشر والرفع وإنشاء ملفات جديدة مرفوض حتى تُختار خطة). `trialEndsAt` موعد انتهاء التجربة المجانية (14 يومًا)، و`renewsAt` موعد تجديد الخطة المدفوعة، ويُضبط `endsAt` بدلًا منه عند إلغائها.
أداة MCP: get_usage
مثال على الطلب
curl https://post.lnr.ae/api/post/v1/usage \
-H "Authorization: Bearer YOUR_API_KEY"مثال على الاستجابة
HTTP 200{
"data": {
"plan": "trial",
"period": "2026-11-01",
"posts": {
"used": 12,
"limit": 50
},
"profiles": {
"used": 2,
"limit": 3
},
"trialEndsAt": "2026-11-28T10:00:00.000Z",
"renewsAt": null,
"endsAt": null
},
"error": null
}