{"info":{"contact":{"email":"omar@emm.sa","name":"مؤسسة المصدر المفتوح التجارية","url":"https://pdf.emm.sa/contact"},"description":"أدوات PDF عبر REST: تشغيل الأدوات برفع ملفات، المهمات والتحميل، التوقيع الإلكتروني. المصادقة بمفاتيح API (Bearer أو X-API-Key) من /app/api. حدود 60 طلباً/دقيقة لكل مفتاح. الأسعار نهائية بالريال السعودي ولا تخضع لضريبة القيمة المضافة.","license":{"name":"Proprietary"},"title":"بي دي إف — أدوات PDF بالعربي — REST API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/api/v1/esign/{id}/apply":{"post":{"summary":"","description":"يضع التوقيع على الصفحة ويعيد المهمة مكتملة مع download_url وverify_url لسجل إثبات التوقيع.","operationId":"post__api_v1_esign_id_apply","tags":["esign"],"security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"description":"رقم المهمة","in":"path","name":"id","required":true,"schema":{"description":"","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"description":"","type":"string"},"page":{"description":"","example":"1","type":"integer"},"signature":{"description":"","example":"data:image/png;base64,iVBORw0KGgo=","type":"string"},"w":{"description":"","example":"120","type":"number"},"x":{"description":"","example":"400","type":"number"},"y":{"description":"","example":"700","type":"number"}},"required":["page","signature","x","y","w"],"type":"object"}},"multipart/form-data":{"schema":{"properties":{"name":{"description":"","type":"string"},"page":{"description":"","type":"integer"},"signature":{"description":"","type":"string"},"w":{"description":"","type":"number"},"x":{"description":"","type":"number"},"y":{"description":"","type":"number"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"apply_url":{"description":"","type":"string"},"created_at":{"description":"","format":"date-time","type":"string"},"download_url":{"description":"","example":"https://pdf.emm.sa/api/v1/jobs/k3Jd8QzLmPq2Rv/download","type":"string"},"error":{"description":"","type":"string"},"expires_at":{"description":"","format":"date-time","type":"string"},"id":{"description":"","example":"k3Jd8QzLmPq2Rv","type":"string"},"output_name":{"description":"","example":"merged.pdf","type":"string"},"pages_in":{"description":"","type":"integer"},"pages_out":{"description":"","type":"integer"},"preview_url_pattern":{"description":"","type":"string"},"previews":{"description":"","type":"integer"},"size_bytes":{"description":"","type":"integer"},"status":{"description":"","enum":["draft","done","expired"],"example":"done","type":"string"},"tool":{"description":"","example":"merge","type":"string"},"verify_url":{"description":"","type":"string"}},"type":"object"},"ok":{"description":"","type":"boolean"}},"required":["ok","data"],"type":"object"}}},"description":"OK"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"validation","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"unauthorized","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"forbidden","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"not_found","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"409":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"not_ready","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"429":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"rate_limited","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"internal_error","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"}}}},"/api/v1/esign/{id}/preview/{page}":{"get":{"summary":"معاينة صفحة للتوقيع","description":"صورة PNG لصفحة المسودة (1-based) لتحديد موضع التوقيع.","operationId":"get__api_v1_esign_id_preview_page","tags":["esign"],"security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"description":"رقم المهمة","in":"path","name":"id","required":true,"schema":{"description":"","type":"string"}},{"description":"رقم الصفحة 1-based","in":"path","name":"page","required":true,"schema":{"description":"","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"format":"binary","type":"string"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"validation","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"unauthorized","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"forbidden","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"not_found","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"429":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"rate_limited","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"internal_error","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"}}}},"/api/v1/jobs":{"get":{"summary":"مهامي","description":"قائمة مهام الحساب (?limit=50\u0026offset=0) مع الحالة ورابط التحميل ووقت الانتهاء.","operationId":"get__api_v1_jobs","tags":["jobs"],"security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"description":"عدد النتائج 1-200 (افتراضي 200)","in":"query","name":"limit","required":false,"schema":{"description":"","example":"50","type":"integer"}},{"description":"إزاحة الترحيل","in":"query","name":"offset","required":false,"schema":{"description":"","example":"0","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"items":{"items":{"properties":{"apply_url":{"description":"","type":"string"},"created_at":{"description":"","format":"date-time","type":"string"},"download_url":{"description":"","example":"https://pdf.emm.sa/api/v1/jobs/k3Jd8QzLmPq2Rv/download","type":"string"},"error":{"description":"","type":"string"},"expires_at":{"description":"","format":"date-time","type":"string"},"id":{"description":"","example":"k3Jd8QzLmPq2Rv","type":"string"},"output_name":{"description":"","example":"merged.pdf","type":"string"},"pages_in":{"description":"","type":"integer"},"pages_out":{"description":"","type":"integer"},"preview_url_pattern":{"description":"","type":"string"},"previews":{"description":"","type":"integer"},"size_bytes":{"description":"","type":"integer"},"status":{"description":"","enum":["draft","done","expired"],"example":"done","type":"string"},"tool":{"description":"","example":"merge","type":"string"},"verify_url":{"description":"","type":"string"}},"type":"object"},"type":"array"},"limit":{"description":"","example":"50","type":"integer"},"offset":{"description":"","example":"0","type":"integer"},"total":{"description":"","type":"integer"}},"required":["items","total"],"type":"object"},"ok":{"description":"","type":"boolean"}},"required":["ok","data"],"type":"object"}}},"description":"OK"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"validation","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"unauthorized","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"forbidden","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"429":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"rate_limited","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"internal_error","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"}}}},"/api/v1/jobs/{id}":{"get":{"summary":"مهمة واحدة","description":"حالة المهمة (draft | done | expired) ورابط التحميل.","operationId":"get__api_v1_jobs_id","tags":["jobs"],"security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"description":"رقم المهمة","in":"path","name":"id","required":true,"schema":{"description":"","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"apply_url":{"description":"","type":"string"},"created_at":{"description":"","format":"date-time","type":"string"},"download_url":{"description":"","example":"https://pdf.emm.sa/api/v1/jobs/k3Jd8QzLmPq2Rv/download","type":"string"},"error":{"description":"","type":"string"},"expires_at":{"description":"","format":"date-time","type":"string"},"id":{"description":"","example":"k3Jd8QzLmPq2Rv","type":"string"},"output_name":{"description":"","example":"merged.pdf","type":"string"},"pages_in":{"description":"","type":"integer"},"pages_out":{"description":"","type":"integer"},"preview_url_pattern":{"description":"","type":"string"},"previews":{"description":"","type":"integer"},"size_bytes":{"description":"","type":"integer"},"status":{"description":"","enum":["draft","done","expired"],"example":"done","type":"string"},"tool":{"description":"","example":"merge","type":"string"},"verify_url":{"description":"","type":"string"}},"type":"object"},"ok":{"description":"","type":"boolean"}},"required":["ok","data"],"type":"object"}}},"description":"OK"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"validation","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"unauthorized","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"forbidden","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"not_found","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"429":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"rate_limited","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"internal_error","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"}}}},"/api/v1/jobs/{id}/download":{"get":{"summary":"تحميل النتيجة","description":"الملف الثنائي (application/octet-stream). التحميل يبدأ ساعة الاحتفاظ: يُحذف بعد 60 دقيقة (24 ساعة كحد أقصى إن لم يُحمّل).","operationId":"get__api_v1_jobs_id_download","tags":["jobs"],"security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"description":"رقم المهمة","in":"path","name":"id","required":true,"schema":{"description":"","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"format":"binary","type":"string"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"validation","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"unauthorized","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"forbidden","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"not_found","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"409":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"not_ready","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"410":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"expired","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"429":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"rate_limited","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"internal_error","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"}}}},"/api/v1/me":{"get":{"summary":"الحساب والخطة والحدود","description":"يعيد المستخدم والخطة الحالية والحدود (الأسعار نص بالريال، رقمين عشريين) والاستخدام اليومي. استخدمه لاختبار مفتاحك.","operationId":"get__api_v1_me","tags":["account"],"security":[{"bearer":[]},{"apiKey":[]}],"responses":{"200":{"content":{"application/json":{"schema":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"ocr_available":{"description":"","type":"boolean"},"plan":{"properties":{"currency":{"description":"","example":"SAR","type":"string"},"features":{"items":{"description":"","type":"string"},"type":"array"},"id":{"description":"","enum":["free","pro","team"],"type":"string"},"interval":{"description":"","example":"month","type":"string"},"limits":{"type":"object"},"name":{"description":"","type":"string"},"price":{"description":"","example":"19.00","type":"string"}},"type":"object"},"quotas":{"properties":{"daily_tasks":{"description":"","type":"integer"},"max_files_per_task":{"description":"","type":"integer"},"max_pages_per_pdf":{"description":"","type":"integer"},"max_upload_bytes":{"description":"","type":"integer"},"retention_minutes":{"description":"","example":"60","type":"integer"},"tasks_used_today":{"description":"","type":"integer"}},"type":"object"},"user":{"properties":{"email":{"description":"","example":"user@example.sa","format":"email","type":"string"},"id":{"description":"","example":"1","type":"integer"}},"type":"object"}},"type":"object"},"ok":{"description":"","type":"boolean"}},"required":["ok","data"],"type":"object"}}},"description":"OK"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"validation","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"unauthorized","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"forbidden","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"429":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"rate_limited","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"internal_error","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"}}}},"/api/v1/plan":{"get":{"summary":"الخطط والأسعار","description":"الخطة الحالية وكل الخطط (SAR/شهر، نهائية بلا ضريبة) ورابط الدفع.","operationId":"get__api_v1_plan","tags":["account"],"security":[{"bearer":[]},{"apiKey":[]}],"responses":{"200":{"content":{"application/json":{"schema":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"currency":{"description":"","example":"SAR","type":"string"},"current":{"properties":{"currency":{"description":"","example":"SAR","type":"string"},"features":{"items":{"description":"","type":"string"},"type":"array"},"id":{"description":"","enum":["free","pro","team"],"type":"string"},"interval":{"description":"","example":"month","type":"string"},"limits":{"type":"object"},"name":{"description":"","type":"string"},"price":{"description":"","example":"19.00","type":"string"}},"type":"object"},"pay_at":{"description":"","type":"string"},"plans":{"items":{"properties":{"currency":{"description":"","example":"SAR","type":"string"},"features":{"items":{"description":"","type":"string"},"type":"array"},"id":{"description":"","enum":["free","pro","team"],"type":"string"},"interval":{"description":"","example":"month","type":"string"},"limits":{"type":"object"},"name":{"description":"","type":"string"},"price":{"description":"","example":"19.00","type":"string"}},"type":"object"},"type":"array"},"vat":{"description":"","type":"string"}},"type":"object"},"ok":{"description":"","type":"boolean"}},"required":["ok","data"],"type":"object"}}},"description":"OK"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"validation","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"unauthorized","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"forbidden","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"429":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"rate_limited","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"internal_error","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"}}}},"/api/v1/tools":{"get":{"summary":"كتالوج الأدوات","description":"12 أداة مع حقول كل أداة وحدود خطتك (الحجم، الصفحات، عدد الملفات).","operationId":"get__api_v1_tools","tags":["tools"],"security":[{"bearer":[]},{"apiKey":[]}],"responses":{"200":{"content":{"application/json":{"schema":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"items":{"items":{"properties":{"accept":{"description":"","example":"application/pdf","type":"string"},"available":{"description":"","type":"boolean"},"description":{"description":"","type":"string"},"endpoint":{"description":"","type":"string"},"fields":{"items":{"properties":{"label":{"description":"","type":"string"},"name":{"description":"","type":"string"},"required":{"description":"","type":"boolean"},"type":{"description":"","type":"string"}},"type":"object"},"type":"array"},"id":{"description":"","example":"merge","type":"string"},"multiple_files":{"description":"","type":"boolean"},"name":{"description":"","type":"string"},"output":{"description":"","example":"pdf","type":"string"}},"type":"object"},"type":"array"},"limits":{"type":"object"},"total":{"description":"","example":"12","type":"integer"}},"type":"object"},"ok":{"description":"","type":"boolean"}},"required":["ok","data"],"type":"object"}}},"description":"OK"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"validation","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"unauthorized","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"forbidden","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"429":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"rate_limited","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"internal_error","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"}}}},"/api/v1/tools/{tool}":{"get":{"summary":"أداة واحدة","description":"تعريف الأداة وحقولها.","operationId":"get__api_v1_tools_tool","tags":["tools"],"security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"description":"معرّف الأداة: merge | split | compress | toimages | fromimages | rotate | numbers | watermark | protect | unlock | ocr | esign","in":"path","name":"tool","required":true,"schema":{"description":"","enum":["merge","split","compress","toimages","fromimages","rotate","numbers","watermark","protect","unlock","ocr","esign"],"example":"merge","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"accept":{"description":"","example":"application/pdf","type":"string"},"available":{"description":"","type":"boolean"},"description":{"description":"","type":"string"},"endpoint":{"description":"","type":"string"},"fields":{"items":{"properties":{"label":{"description":"","type":"string"},"name":{"description":"","type":"string"},"required":{"description":"","type":"boolean"},"type":{"description":"","type":"string"}},"type":"object"},"type":"array"},"id":{"description":"","example":"merge","type":"string"},"multiple_files":{"description":"","type":"boolean"},"name":{"description":"","type":"string"},"output":{"description":"","example":"pdf","type":"string"}},"type":"object"},"ok":{"description":"","type":"boolean"}},"required":["ok","data"],"type":"object"}}},"description":"OK"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"validation","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"unauthorized","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"forbidden","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"not_found","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"429":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"rate_limited","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"internal_error","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"}}},"post":{"summary":"تشغيل أداة","description":"يعالج الملفات ويعيد 202 مع المهمة (status=done وdownload_url، أو draft للأداة esign مع preview_url_pattern وapply_url). يخصم من حد المهام اليومي.","operationId":"post__api_v1_tools_tool","tags":["tools"],"security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"description":"معرّف الأداة: merge | split | compress | toimages | fromimages | rotate | numbers | watermark | protect | unlock | ocr | esign","in":"path","name":"tool","required":true,"schema":{"description":"","enum":["merge","split","compress","toimages","fromimages","rotate","numbers","watermark","protect","unlock","ocr","esign"],"example":"merge","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"file":{"description":"","format":"byte","type":"string"},"files":{"items":{"properties":{"content_base64":{"description":"","format":"byte","type":"string"},"name":{"description":"","example":"a.pdf","type":"string"}},"type":"object"},"type":"array"}},"type":"object"}},"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"},"files":{"items":{"format":"binary","type":"string"},"type":"array"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"apply_url":{"description":"","type":"string"},"created_at":{"description":"","format":"date-time","type":"string"},"download_url":{"description":"","example":"https://pdf.emm.sa/api/v1/jobs/k3Jd8QzLmPq2Rv/download","type":"string"},"error":{"description":"","type":"string"},"expires_at":{"description":"","format":"date-time","type":"string"},"id":{"description":"","example":"k3Jd8QzLmPq2Rv","type":"string"},"output_name":{"description":"","example":"merged.pdf","type":"string"},"pages_in":{"description":"","type":"integer"},"pages_out":{"description":"","type":"integer"},"preview_url_pattern":{"description":"","type":"string"},"previews":{"description":"","type":"integer"},"size_bytes":{"description":"","type":"integer"},"status":{"description":"","enum":["draft","done","expired"],"example":"done","type":"string"},"tool":{"description":"","example":"merge","type":"string"},"verify_url":{"description":"","type":"string"}},"type":"object"},"ok":{"description":"","type":"boolean"}},"required":["ok","data"],"type":"object"}}},"description":"OK"}}},"description":"OK"},"202":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"apply_url":{"description":"","type":"string"},"created_at":{"description":"","format":"date-time","type":"string"},"download_url":{"description":"","example":"https://pdf.emm.sa/api/v1/jobs/k3Jd8QzLmPq2Rv/download","type":"string"},"error":{"description":"","type":"string"},"expires_at":{"description":"","format":"date-time","type":"string"},"id":{"description":"","example":"k3Jd8QzLmPq2Rv","type":"string"},"output_name":{"description":"","example":"merged.pdf","type":"string"},"pages_in":{"description":"","type":"integer"},"pages_out":{"description":"","type":"integer"},"preview_url_pattern":{"description":"","type":"string"},"previews":{"description":"","type":"integer"},"size_bytes":{"description":"","type":"integer"},"status":{"description":"","enum":["draft","done","expired"],"example":"done","type":"string"},"tool":{"description":"","example":"merge","type":"string"},"verify_url":{"description":"","type":"string"}},"type":"object"},"ok":{"description":"","type":"boolean"}},"required":["ok","data"],"type":"object"}}},"description":"Accepted — المهمة"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"validation","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"unauthorized","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"forbidden","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"not_found","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"409":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"quota","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"410":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"expired","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"413":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"upload","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"429":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"rate_limited","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"internal_error","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"},"503":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"description":"","example":"ocr_unavailable","type":"string"},"message":{"description":"","example":"نص عربي","type":"string"}},"type":"object"},"ok":{"description":"","example":"false","type":"boolean"}},"required":["ok","error"],"type":"object"}}},"description":"خطأ"}}}}},"security":[{"bearer":[]}],"securitySchemes":{"apiKey":{"in":"header","name":"X-API-Key","type":"apiKey"},"bearer":{"description":"مفتاح API (emm_pdf_…)","scheme":"bearer","type":"http"}},"servers":[{"url":"https://pdf.emm.sa"}],"tags":[{"name":"account"},{"name":"tools"},{"name":"jobs"},{"name":"esign"}]}
