تخطَّ إلى المحتوى
LunarPost

للمطوّرين

توثيق الواجهة البرمجية و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

ما يمكنك فعله

البدء السريع

  1. احصل على مفتاح

    افتح لوحة التحكم، ثم انتقل إلى مفاتيح API وأنشئ مفتاحًا. انسخه فورًا، فهو لا يظهر إلا مرة واحدة.

  2. تحقّق من خطتك

    اطلب استهلاك هذا الشهر. إذا كان المفتاح يعمل، تصلك خطتك وعدد المنشورات المتبقية.

    curl https://post.lnr.ae/api/post/v1/usage \
      -H "Authorization: Bearer YOUR_API_KEY"
  3. أضف عميلًا وانشر

    أنشئ ملفًا، وأرسل رابط الربط الخاص به، وارفع الوسائط ثم جدولها. تجد كل نقطة نهاية في مرجع الواجهة البرمجية أدناه، مع مثال جاهز للنسخ.

إثبات الهوية

أرسل المفتاح في ترويسة 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

أدوات 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.

الخطةالمنشورات شهريًاالملفات
التجربة501
Starter5005
Growth2,50025
Scale10,000100

يستطيع كل مفتاح إرسال 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_input400حقل مفقود أو خارج النطاق المسموح. توضح الرسالة أي حقل.
plan_limit403استُهلكت منشورات الشهر أو ملفات الخطة أو مساحة تخزين الوسائط، أو انتهت التجربة.
rate_limited429طلبات كثيرة من هذا المفتاح. انتظر عدد الثواني المذكور في Retry-After.
unauthorized401المفتاح مفقود أو تالف أو ملغى أو منتهي الصلاحية.
forbidden403لا يستطيع المفتاح فعل ذلك: مفتاح للقراءة فقط حاول الكتابة، أو ينقصه صلاحية الموافقة.
not_found404لا يوجد شيء بهذا المعرّف في مساحة العمل.
invalid_json400نص الطلب ليس JSON صالحًا.
internal500حدث خطأ من جهتنا. حاول مرة أخرى، وإذا تكرر فأخبرنا.

OpenAPI

الواجهة البرمجية كلها موصوفة في ملف OpenAPI 3.1 واحد. استورده إلى Postman أو Insomnia، أو أعطه لـ Cursor أو أداة ذكاء اصطناعي أخرى كسياق، أو أنشئ منه عميلًا بلغتك البرمجية.

curl -o lunar-post-openapi.json https://post.lnr.ae/api/post/v1/openapi.json

نزّل ملف OpenAPI

مرجع الواجهة البرمجية

الملفات والحسابات

الملف هو أحد عملائك. لكل ملف حساباته المتصلة الخاصة به، ولا تنتقل المنشورات بين الملفات أبدًا.

GET/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
}
POST/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
}
GET/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
}
PATCH/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
}
POST/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
}
GET/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
}

الوسائط

ارفع فيديو أو صورة، أو أرسل رابطًا إليهما. يُفحص كل ملف قبل أن يصبح قابلًا للنشر.

POST/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
}
POST/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
}
POST/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
}
GET/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
}
GET/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
}
DELETE/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
}

المنشورات

جدول عنصر وسائط واحدًا على حسابات ملف ما مع تعليق لكل شبكة، ثم تابع المنشورات وعدّلها.

POST/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
}
GET/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
}
GET/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
}
PATCH/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
}
DELETE/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
}
POST/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
}
POST/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 هذا الشهر.

GET/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
}