تسجيل الدخول
الميزات فيديو AI الأسعار مقارنة المدونة ابدأ الآن
توثيق المطور

مرجع API

مرجع كامل لواجهة برمجة تطبيقات InMedia REST. جميع النقاط النهائية تتطلب المصادقة عبر مفتاح API.

URL الأساسية: https://useinmedia.com

Autenticação

يجب أن يتضمن كل طلب API key كرمز Bearer ومعرف Workspace ID. يمكنك إنشاء مفاتيح API من Dashboard → Settings → API Keys (Growth plan required).

رؤوس مطلوبة

Authorization: Bearer sk_aBcDeFgHiJkLmNoPqRsTuVwXyZ1234567890abcd
Content-Type: application/json

يتم تحديد مساحة العمل تلقائياً من مفتاح API. لا حاجة لرأس X-Workspace-Id. يُظهر مفتاح API مرة واحدة فقط عند الإنشاء؛ احفظه بأمان.

مثال سريع. إنشاء منشور

curl https://useinmedia.com/api/v1/posts \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{"title":"My post","prompt":"Bold product post for Instagram"}'
import requests

response = requests.post(
    "https://useinmedia.com/api/v1/posts",
    headers={"Authorization": "Bearer sk_..."},
    json={
        "title": "My post",
        "prompt": "Bold product post for Instagram",
    }
)
post = response.json()
const response = await fetch("https://useinmedia.com/api/v1/posts", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_...",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    title: "My post",
    prompt: "Bold product post for Instagram",
  }),
});
const post = await response.json();
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer sk_...");

var payload = new {
    title = "My post",
    prompt = "Bold product post for Instagram"
};
var response = await client.PostAsJsonAsync(
    "https://useinmedia.com/api/v1/posts", payload);
var post = await response.Content.ReadFromJsonAsync<JsonDocument>();
<?php
$ch = curl_init("https://useinmedia.com/api/v1/posts");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => [
        "Authorization: Bearer sk_...",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS     => json_encode([
        "title"  => "My post",
        "prompt" => "Bold product post for Instagram",
    ]),
]);
$post = json_decode(curl_exec($ch), true);

رموز الخطأ

Codeالمعنى
400طلب غير صالح. معلمات غير صحيحة
401غير مصرح به. مفتاح API مفقود أو غير صالح
403ممنوع. المورد غير متاح في خطتك
404غير موجود. المورد غير موجود
429تم تجاوز حد المعدل. قلل التردد

أحداث Webhook

مرر قائمة مفصولة بفواصل من أسماء الأحداث إلى حقل الأحداث عند إنشاء Webhook.

post.generated
يتم تشغيله عندما ينتهي AI من توليد منشور
post.published
يتم تشغيله عندما يُنشر منشور بنجاح
post.scheduled
يتم تشغيله عندما يُجدول منشور للنشر في المستقبل
post.failed
يتم تشغيله عندما يفشل توليد أو نشر منشور
video.completed
يتم تشغيله عندما يكتمل عمل تصيير فيديو
video.failed
يتم تشغيله عندما يفشل عمل تصيير فيديو

تنسيق الحمولة

كل تسليم Webhook هو طلب POST مع الجسم JSON التالي:

{
  "event": "post.published",
  "workspaceId": "a1b2c3d4-...",
  "timestamp": "2026-04-14T15:30:00Z",
  "data": {
    "id": "3f7a1b2c-...",
    "title": "Air Jordan launch",
    "status": "published",
    "imageUrl": "https://...",
    "publishedAt": "2026-04-14T15:30:00Z"
  }
}

أمان Webhook

إذا قمت بتوفير سر عند إنشاء Webhook، سيوقع InMedia كل تسليم باستخدام HMAC-SHA256. تحقق من التوقيع للتأكد من أن الطلب جاء من InMedia.

رأس التوقيع

X-InMedia-Signature: sha256=abc123...

القيمة هي هاش HMAC-SHA256 بالصيغة الست عشرية للجسم الخام للطلب باستخدام سر Webhook الخاص بك كمفتاح.

التحقق من التوقيع

const crypto = require('crypto');

function verifySignature(payload, signature, secret) {
  const expected = 'sha256=' +
    crypto.createHmac('sha256', secret)
          .update(payload, 'utf8')
          .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}
import hmac, hashlib

def verify_signature(payload: bytes, signature: str, secret: str) -> bool:
    expected = 'sha256=' + hmac.new(
        secret.encode(), payload, hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(signature, expected)
using System.Security.Cryptography;
using System.Text;

bool VerifySignature(byte[] payload, string signature, string secret)
{
    using var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret));
    var hash     = hmac.ComputeHash(payload);
    var expected = "sha256=" + Convert.ToHexString(hash).ToLower();
    return CryptographicOperations.FixedTimeEquals(
        Encoding.UTF8.GetBytes(signature),
        Encoding.UTF8.GetBytes(expected)
    );
}
<?php
function verify_signature(
    string $payload,
    string $signature,
    string $secret
): bool {
    $expected = 'sha256=' . hash_hmac('sha256', $payload, $secret);
    return hash_equals($expected, $signature);
}

Posts

إنشاء وإدارة المنشورات. استدعاء POST /{id}/generate بعد إنشاء منشور لإنتاج محتوى AI.

GET /api/v1/posts قائمة بجميع المنشورات
معلمات الاستعلام
الاسمالنوعObrigatórioDescrição
status string optional تصفية حسب الحالة: مسودة | مجدولة | منشورة | فاشلة
page integer optional رقم الصفحة (الافتراضي: 1)
pageSize integer optional العناصر لكل صفحة، الحد الأقصى 100 (الافتراضي: 20)
cURL
curl https://useinmedia.com/api/v1/posts \
  -H "Authorization: Bearer sk_..."
الاستجابة
[
  {
    "id": "3f7a1b2c-...",
    "workspaceId": "a1b2c3d4-...",
    "projectId": "e5f6g7h8-...",
    "title": "Air Jordan launch",
    "prompt": "Bold Instagram post for sneaker drop",
    "status": "published",
    "imageUrl": "https://...",
    "hasVideo": false,
    "format": "instagram_square",
    "createdAt": "2026-04-14T12:00:00Z"
  }
]
POST /api/v1/posts إنشاء منشور
معلمات الجسم
الاسمالنوعObrigatórioDescrição
title string required عنوان المنشور (الحد الأقصى 200 حرف)
prompt string required موجه التوليد (الحد الأقصى 5000 حرف)
projectId guid required المشروع المرتبط بالمنشور
brandKitId guid optional مجموعة العلامة التجارية لتطبيقها في التوليد
جسم الطلب
{
  "title": "Air Jordan launch",
  "prompt": "Bold Instagram post for a sneaker drop. Black and gold palette.",
  "projectId": "e5f6g7h8-...",
  "brandKitId": "k1l2m3n4-..."
}
cURL
curl https://useinmedia.com/api/v1/posts \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "title": "Air Jordan launch", "prompt": "Bold Instagram post for a sneaker drop. Black and gold palette.", "projectId": "e5f6g7h8-...", "brandKitId": "k1l2m3n4-..." }'
الاستجابة
{
  "id": "3f7a1b2c-...",
  "title": "Air Jordan launch",
  "status": "draft",
  "imageUrl": "https://...",
  "hasVideo": false,
  "createdAt": "2026-04-14T12:00:00Z"
}
GET /api/v1/posts/ {id} استرجاع المنشور حسب المعرف
cURL
curl https://useinmedia.com/api/v1/posts/<id> \
  -H "Authorization: Bearer sk_..."
الاستجابة
{
  "id": "3f7a1b2c-...",
  "workspaceId": "a1b2c3d4-...",
  "projectId": "e5f6g7h8-...",
  "title": "Air Jordan launch",
  "prompt": "Bold Instagram post for sneaker drop",
  "status": "published",
  "imageUrl": "https://...",
  "hasVideo": false,
  "format": "instagram_square",
  "brandKitId": null,
  "scheduledAt": null,
  "publishedAt": "2026-04-14T15:30:00Z",
  "createdAt": "2026-04-14T12:00:00Z",
  "updatedAt": "2026-04-14T15:30:00Z"
}
GET /api/v1/posts/project/ {projectId} قائمة المنشورات من مشروع
cURL
curl https://useinmedia.com/api/v1/posts/project/<projectId> \
  -H "Authorization: Bearer sk_..."
الاستجابة
[ { "id": "...", "title": "..." } ]
PUT /api/v1/posts/ {id} تحديث منشور
معلمات الجسم
الاسمالنوعObrigatórioDescrição
title string optional عنوان جديد (الحد الأقصى 200 حرف)
prompt string optional موجه جديد (الحد الأقصى 5000 حرف)
status string optional draft | scheduled | published | failed
scheduledAt datetime optional الوقت/التاريخ المجدول ISO 8601
brandKitId guid optional Brand Kit لتطبيقه
جسم الطلب
{ "title": "Updated title", "status": "draft" }
cURL
curl https://useinmedia.com/api/v1/posts/<id> \
  -X PUT \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "title": "Updated title", "status": "draft" }'
الاستجابة
{
  "id": "3f7a1b2c-...",
  "title": "Updated title",
  "status": "draft",
  "updatedAt": "2026-04-14T13:00:00Z"
}
DELETE /api/v1/posts/ {id} حذف منشور
cURL
curl https://useinmedia.com/api/v1/posts/<id> \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
الاستجابة
204 No Content
POST /api/v1/posts/ {id} /generate إنشاء (أو إعادة إنشاء) محتوى AI لمنشور
معلمات الجسم
الاسمالنوعObrigatórioDescrição
prompt string optional طلب جديد؛ تجاهل لإعادة إنشاء مع الطلب الحالي
format string optional نسبة العرض إلى الارتفاع: 1:1 | 9:16 | 16:9 (الافتراضي: 1:1)
جسم الطلب
{ "prompt": "Make it more energetic", "format": "1:1" }
cURL
curl https://useinmedia.com/api/v1/posts/<id>/generate \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "Make it more energetic", "format": "1:1" }'
الاستجابة
{
  "post": {
    "id": "3f7a1b2c-...",
    "status": "draft",
    "imageUrl": "https://...",
    "hasVideo": false,
    "updatedAt": "2026-04-14T13:00:00Z"
  },
  "respond": "Updated the design with more vibrant colors."
}
POST /api/v1/posts/ {id} /render عرض النسخة الحالية من المنشور كصورة (PNG/JPEG)
cURL
curl https://useinmedia.com/api/v1/posts/<id>/render \
  -X POST \
  -H "Authorization: Bearer sk_..."
الاستجابة
{ "id": "...", "imageUrl": "https://...", "status": "draft" }
POST /api/v1/posts/ {id} /publish تحديد منشور كمُنشور
cURL
curl https://useinmedia.com/api/v1/posts/<id>/publish \
  -X POST \
  -H "Authorization: Bearer sk_..."
الاستجابة
{ "id": "...", "status": "published", "publishedAt": "2026-04-14T15:30:00Z" }
POST /api/v1/posts/ {id} /schedule جدولة منشور للنشر المستقبلي
معلمات الجسم
الاسمالنوعObrigatórioDescrição
scheduledAt datetime required تاريخ/وقت النشر ISO 8601 (UTC)
جسم الطلب
{ "scheduledAt": "2026-04-15T09:00:00Z" }
cURL
curl https://useinmedia.com/api/v1/posts/<id>/schedule \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "scheduledAt": "2026-04-15T09:00:00Z" }'
الاستجابة
{ "id": "...", "status": "scheduled", "scheduledAt": "2026-04-15T09:00:00Z" }
POST /api/v1/posts/ {id} /publish-social نشر (أو جدولة) منشور على الشبكات الاجتماعية المتصلة
معلمات الجسم
الاسمالنوعObrigatórioDescrição
connectionIds guid[] required قائمة معرفات الاتصال الاجتماعي للنشر
scheduledAt datetime optional إذا تم التحديد، يُجدول بدلاً من النشر الفوري
جسم الطلب
{
  "connectionIds": ["conn-uuid-1", "conn-uuid-2"],
  "scheduledAt": null
}
cURL
curl https://useinmedia.com/api/v1/posts/<id>/publish-social \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "connectionIds": ["conn-uuid-1", "conn-uuid-2"], "scheduledAt": null }'
الاستجابة
[
  {
    "connectionId": "conn-uuid-1",
    "platform": "Instagram",
    "status": "Published",
    "externalPostId": "ext-123",
    "errorMessage": null
  }
]
GET /api/v1/posts/ {id} /publish-targets استعلام وجهات النشر الاجتماعي وحالة المنشور
cURL
curl https://useinmedia.com/api/v1/posts/<id>/publish-targets \
  -H "Authorization: Bearer sk_..."
الاستجابة
[
  {
    "connectionId": "conn-uuid-1",
    "platform": "Instagram",
    "status": "Published",
    "externalPostId": "ext-123",
    "errorMessage": null
  }
]
GET /api/v1/posts/ {id} /download تحميل صورة المنشور كملف
معلمات الاستعلام
الاسمالنوعObrigatórioDescrição
format string optional png (الافتراضي) أو jpg
cURL
curl https://useinmedia.com/api/v1/posts/<id>/download \
  -H "Authorization: Bearer sk_..."
الاستجابة
ملف ثنائي (image/png أو image/jpeg)
GET /api/v1/posts/ {id} /versions قائمة الإصدارات المحفوظة للمنشور
cURL
curl https://useinmedia.com/api/v1/posts/<id>/versions \
  -H "Authorization: Bearer sk_..."
الاستجابة
[
  {
    "id": "ver-uuid-...",
    "versionNumber": 3,
    "label": "Dark theme variant",
    "createdAt": "2026-04-14T12:00:00Z"
  }
]
POST /api/v1/posts/ {id} /versions/ {versionId} /restore استعادة منشور إلى إصدار سابق
cURL
curl https://useinmedia.com/api/v1/posts/<id>/versions/<versionId>/restore \
  -X POST \
  -H "Authorization: Bearer sk_..."
الاستجابة
{ "id": "...", "status": "draft", "imageUrl": "https://...", "updatedAt": "2026-04-14T13:00:00Z" }

Projects

تنظيم المنشورات تحت المشاريع. خطة Starter محدودة بـ 3 مشاريع نشطة.

GET /api/v1/projects قائمة المشاريع
معلمات الاستعلام
الاسمالنوعObrigatórioDescrição
status string optional تصفية: نشط | مؤرشف
cURL
curl https://useinmedia.com/api/v1/projects \
  -H "Authorization: Bearer sk_..."
الاستجابة
[
  {
    "id": "e5f6g7h8-...",
    "name": "Nike Campaign",
    "description": "Q2 2026 drop",
    "icon": "👟",
    "color": "#00f2ff",
    "status": "active",
    "createdAt": "2026-01-10T09:00:00Z"
  }
]
POST /api/v1/projects إنشاء مشروع
معلمات الجسم
الاسمالنوعObrigatórioDescrição
name string required اسم المشروع
description string optional وصف اختياري
icon string optional رمز Emoji
color string optional لون هكس مثلاً: #00f2ff
جسم الطلب
{
  "name": "Nike Campaign",
  "description": "Q2 2026 drop",
  "icon": "👟",
  "color": "#00f2ff"
}
cURL
curl https://useinmedia.com/api/v1/projects \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "Nike Campaign", "description": "Q2 2026 drop", "icon": "👟", "color": "#00f2ff" }'
الاستجابة
{
  "id": "e5f6g7h8-...",
  "name": "Nike Campaign",
  "status": "active",
  "createdAt": "2026-04-14T12:00:00Z"
}
PUT /api/v1/projects/ {id} تحديث مشروع
معلمات الجسم
الاسمالنوعObrigatórioDescrição
name string optional اسم جديد
description string optional وصف جديد
status string optional نشط | مؤرشف
جسم الطلب
{ "name": "Nike Campaign v2", "status": "archived" }
cURL
curl https://useinmedia.com/api/v1/projects/<id> \
  -X PUT \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "Nike Campaign v2", "status": "archived" }'
الاستجابة
{ "id": "...", "name": "Nike Campaign v2", "status": "archived" }
GET /api/v1/projects/ {id} ابحث عن مشروع بواسطة المعرف
cURL
curl https://useinmedia.com/api/v1/projects/<id> \
  -H "Authorization: Bearer sk_..."
الاستجابة
{
  "id": "e5f6g7h8-...",
  "name": "Nike Campaign",
  "description": "Q2 2026 drop",
  "icon": "👟",
  "color": "#00f2ff",
  "status": "active",
  "coverUrl": "https://...",
  "createdAt": "2026-01-10T09:00:00Z"
}
POST /api/v1/projects/ {id} /cover رفع صورة الغلاف إلى مشروع (multipart/form-data)
معلمات الجسم
الاسمالنوعObrigatórioDescrição
file file required JPEG, PNG أو WebP. أقصى 10 ميغابايت
cURL
curl https://useinmedia.com/api/v1/projects/<id>/cover \
  -X POST \
  -H "Authorization: Bearer sk_..."
الاستجابة
{ "id": "...", "coverUrl": "https://...", "name": "Nike Campaign" }
DELETE /api/v1/projects/ {id} /cover إزالة صورة الغلاف من المشروع
cURL
curl https://useinmedia.com/api/v1/projects/<id>/cover \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
الاستجابة
204 No Content
DELETE /api/v1/projects/ {id} حذف مشروع
cURL
curl https://useinmedia.com/api/v1/projects/<id> \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
الاستجابة
204 No Content

Brand Kits

تخزين ألوان العلامة التجارية، الخطوط والشعارات. خطة Starter محدودة بـ 1 Brand Kit.

GET /api/v1/brandkits قائمة Brand Kits
cURL
curl https://useinmedia.com/api/v1/brandkits \
  -H "Authorization: Bearer sk_..."
الاستجابة
[
  {
    "id": "k1l2m3n4-...",
    "name": "Main Brand",
    "colorsJson": "{\"primary\":\"#00f2ff\",\"secondary\":\"#020408\"}",
    "fontsJson": "{\"heading\":\"Plus Jakarta Sans\",\"body\":\"Inter\"}",
    "logoUrl": "https://..."
  }
]
POST /api/v1/brandkits إنشاء Brand Kit
معلمات الجسم
الاسمالنوعObrigatórioDescrição
name string required اسم Brand Kit
colors.primary string optional اللون الأساسي hex
colors.secondary string optional اللون الثانوي hex
colors.accent string optional اللون المميز hex
colors.neutral string optional اللون المحايد hex
fonts.heading string optional خط العنوان
fonts.body string optional خط النص
logoUrl string optional URL الصورة العامة للشعار
جسم الطلب
{
  "name": "Main Brand",
  "colors": {
    "primary": "#00f2ff",
    "secondary": "#020408",
    "accent": "#ffffff",
    "neutral": "#888888"
  },
  "fonts": {
    "heading": "Plus Jakarta Sans",
    "body": "Inter"
  },
  "logoUrl": "https://example.com/logo.png"
}
cURL
curl https://useinmedia.com/api/v1/brandkits \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "Main Brand", "colors": { "primary": "#00f2ff", "secondary": "#020408", "accent": "#ffffff", "neutral": "#888888" }, "fonts": { "heading": "Plus Jakarta Sans", "body": "Inter" }, "logoUrl": "https://example.com/logo.png" }'
الاستجابة
{ "id": "k1l2m3n4-...", "name": "Main Brand", ... }
PUT /api/v1/brandkits/ {id} تحديث Brand Kit
معلمات الجسم
الاسمالنوعObrigatórioDescrição
name string optional اسم جديد
colors object optional الألوان للتحديث (نفس تنسيق الإنشاء)
fonts object optional الخطوط للتحديث
جسم الطلب
{ "colors": { "primary": "#ff5733" } }
cURL
curl https://useinmedia.com/api/v1/brandkits/<id> \
  -X PUT \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "colors": { "primary": "#ff5733" } }'
الاستجابة
{ "id": "...", "name": "Main Brand", ... }
GET /api/v1/brandkits/ {id} ابحث عن Brand Kit بواسطة المعرف
cURL
curl https://useinmedia.com/api/v1/brandkits/<id> \
  -H "Authorization: Bearer sk_..."
الاستجابة
{
  "id": "k1l2m3n4-...",
  "name": "Main Brand",
  "colorsJson": "{\"primary\":\"#00f2ff\",\"secondary\":\"#020408\"}",
  "fontsJson": "{\"heading\":\"Plus Jakarta Sans\",\"body\":\"Inter\"}",
  "logoUrl": "https://..."
}
DELETE /api/v1/brandkits/ {id} حذف Brand Kit
cURL
curl https://useinmedia.com/api/v1/brandkits/<id> \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
الاستجابة
204 No Content

الجدولة

أتمتة إنشاء المحتوى المتكرر باستخدام جداول cron. يتطلب خطة Growth.

يتطلب خطة Growth+
GET /api/v1/schedules قائمة الجدولة
cURL
curl https://useinmedia.com/api/v1/schedules \
  -H "Authorization: Bearer sk_..."
الاستجابة
[
  {
    "id": "s1s2s3s4-...",
    "name": "Daily Instagram Post",
    "cronExpression": "0 9 * * *",
    "isActive": true,
    "promptTemplate": "Generate a motivational post for today.",
    "nextRunAt": "2026-04-15T09:00:00Z"
  }
]
POST /api/v1/schedules إنشاء جدول زمني Growth+
معلمات الجسم
الاسمالنوعObrigatórioDescrição
name string required اسم الجدول الزمني
cronExpression string required عبارة كرون مكونة من 5 حقول على سبيل المثال: "0 9 * * 1"
promptTemplate string optional الطلب المستخدم في كل تشغيل (أقصى 5000 حرف)
projectId guid optional مشروع المنشورات المولدة
brandKitId guid optional Brand Kit لتطبيقه
جسم الطلب
{
  "name": "Daily Instagram Post",
  "cronExpression": "0 9 * * *",
  "promptTemplate": "Generate a motivational post for today.",
  "projectId": "e5f6g7h8-...",
  "brandKitId": "k1l2m3n4-..."
}
cURL
curl https://useinmedia.com/api/v1/schedules \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "Daily Instagram Post", "cronExpression": "0 9 * * *", "promptTemplate": "Generate a motivational post for today.", "projectId": "e5f6g7h8-...", "brandKitId": "k1l2m3n4-..." }'
الاستجابة
{
  "id": "s1s2s3s4-...",
  "name": "Daily Instagram Post",
  "cronExpression": "0 9 * * *",
  "isActive": true,
  "nextRunAt": "2026-04-15T09:00:00Z"
}
PUT /api/v1/schedules/ {id} تحديث جدول زمني
معلمات الجسم
الاسمالنوعObrigatórioDescrição
name string optional اسم جديد
cronExpression string optional عبارة كرون جديدة
isActive boolean optional تمكين أو تعطيل الجدول الزمني
promptTemplate string optional قالب طلب جديد
جسم الطلب
{ "isActive": false }
cURL
curl https://useinmedia.com/api/v1/schedules/<id> \
  -X PUT \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "isActive": false }'
الاستجابة
{ "id": "...", "isActive": false, ... }
GET /api/v1/schedules/ {id} البحث عن جدول زمني حسب المعرف
cURL
curl https://useinmedia.com/api/v1/schedules/<id> \
  -H "Authorization: Bearer sk_..."
الاستجابة
{
  "id": "s1s2s3s4-...",
  "name": "Daily Instagram Post",
  "cronExpression": "0 9 * * *",
  "isActive": true,
  "promptTemplate": "Generate a motivational post for today.",
  "lastRunAt": "2026-04-13T09:00:00Z",
  "nextRunAt": "2026-04-15T09:00:00Z"
}
DELETE /api/v1/schedules/ {id} حذف جدول زمني
cURL
curl https://useinmedia.com/api/v1/schedules/<id> \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
الاستجابة
204 No Content

Webhooks

استقبال إشعارات HTTP في الوقت الفعلي عندما تحدث أحداث في مساحة عملك. يتطلب خطة Growth.

يتطلب خطة Growth+
GET /api/v1/webhooks قائمة webhooks
cURL
curl https://useinmedia.com/api/v1/webhooks \
  -H "Authorization: Bearer sk_..."
الاستجابة
[
  {
    "id": "w1w2w3w4-...",
    "url": "https://yourapp.com/hooks/inmedia",
    "events": "post.published,post.failed",
    "isActive": true,
    "lastTriggeredAt": "2026-04-14T10:00:00Z"
  }
]
POST /api/v1/webhooks تسجيل webhook Growth+
معلمات الجسم
الاسمالنوعObrigatórioDescrição
url string required نقطة النهاية HTTPS لاستقبال الأحداث
events string required أسماء الأحداث مفصولة بفواصل (انظر قسم الأحداث)
secret string optional سر اختياري للتحقق من توقيع HMAC-SHA256
جسم الطلب
{
  "url": "https://yourapp.com/hooks/inmedia",
  "events": "post.published,post.failed",
  "secret": "my-webhook-secret"
}
cURL
curl https://useinmedia.com/api/v1/webhooks \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://yourapp.com/hooks/inmedia", "events": "post.published,post.failed", "secret": "my-webhook-secret" }'
الاستجابة
{
  "id": "w1w2w3w4-...",
  "url": "https://yourapp.com/hooks/inmedia",
  "events": "post.published,post.failed",
  "isActive": true,
  "createdAt": "2026-04-14T12:00:00Z"
}
PUT /api/v1/webhooks/ {id} تحديث webhook
معلمات الجسم
الاسمالنوعObrigatórioDescrição
url string optional URL جديدة للنقطة النهاية
events string optional قائمة جديدة من الأحداث
isActive boolean optional تمكين أو تعطيل
جسم الطلب
{ "isActive": false }
cURL
curl https://useinmedia.com/api/v1/webhooks/<id> \
  -X PUT \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "isActive": false }'
الاستجابة
{ "id": "...", "isActive": false, ... }
DELETE /api/v1/webhooks/ {id} حذف webhook
cURL
curl https://useinmedia.com/api/v1/webhooks/<id> \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
الاستجابة
204 No Content

Video

استطلاع مهام توليد الفيديو واسترجاع الروابط الموقعة مسبقًا. يتم بدء توليد الفيديو من محرر لوحة المعلومات.

يتطلب خطة Growth+
GET /api/v1/video/jobs/ {jobId} التحقق من حالة مهمة توليد الفيديو Growth+
cURL
curl https://useinmedia.com/api/v1/video/jobs/<jobId> \
  -H "Authorization: Bearer sk_..."
الاستجابة
{
  "status": "done",
  "postId": "e5f6g7h8-...",
  "videoUrl": "https://presigned-s3-url...",
  "message": "Video generated successfully!",
  "error": null
}
GET /api/v1/video/presign/ {postId} الحصول على URL موقّع محدث لفيديو المنشور Growth+
cURL
curl https://useinmedia.com/api/v1/video/presign/<postId> \
  -H "Authorization: Bearer sk_..."
الاستجابة
{ "url": "https://presigned-s3-url..." }

استخدام

تحقق من حصة خطتك ونشاط التوليد.

GET /api/v1/usage/activity استعلام عن أنشطة التوليد
معلمات الاستعلام
الاسمالنوعObrigatórioDescrição
page integer optional رقم الصفحة (الافتراضي: 1)
pageSize integer optional العناصر لكل صفحة (الافتراضي: 50)
cURL
curl https://useinmedia.com/api/v1/usage/activity \
  -H "Authorization: Bearer sk_..."
الاستجابة
{
  "activity": [
    {
      "id": "t1t2t3t4-...",
      "type": "PostGeneration",
      "typeLabel": "Content generation",
      "description": "Air Jordan launch",
      "createdAt": "2026-04-14T12:00:00Z"
    }
  ]
}

API Keys

أنشئ وأدر مفاتيح API برمجية. يتطلب خطة Growth.

يتطلب خطة Growth+
GET /api/v1/api-keys قائمة مفاتيح API
cURL
curl https://useinmedia.com/api/v1/api-keys \
  -H "Authorization: Bearer sk_..."
الاستجابة
[
  {
    "id": "key-uuid-...",
    "name": "Production key",
    "keyPrefix": "sk_abcd",
    "isActive": true,
    "lastUsedAt": "2026-04-13T08:00:00Z",
    "expiresAt": null,
    "createdAt": "2026-01-01T00:00:00Z"
  }
]
POST /api/v1/api-keys إنشاء مفتاح API Growth+
معلمات الجسم
الاسمالنوعObrigatórioDescrição
name string required اسم وصفي للمفتاح
expiresAt datetime optional انتهاء صلاحية اختياري (ISO 8601)
جسم الطلب
{ "name": "Production key" }
cURL
curl https://useinmedia.com/api/v1/api-keys \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "Production key" }'
الاستجابة
{
  "id": "key-uuid-...",
  "key": "sk_aBcDeFgHiJkLmNoPqRsTuVwXyZ1234567890abcd",
  "prefix": "sk_aBcDe",
  "name": "Production key"
}
DELETE /api/v1/api-keys/ {id} إلغاء مفتاح API
cURL
curl https://useinmedia.com/api/v1/api-keys/<id> \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
الاستجابة
204 No Content
POST /api/v1/api-keys/ {id} /regenerate إعادة توليد مفتاح API
cURL
curl https://useinmedia.com/api/v1/api-keys/<id>/regenerate \
  -X POST \
  -H "Authorization: Bearer sk_..."
الاستجابة
{ "id": "...", "key": "sk_NEW...", "prefix": "sk_NEW" }