المصادقة: مفتاح API من صفحة المفاتيح بالشكل emm_aun_<id8>_<secret32> — ترسله في Authorization: Bearer … أو X-API-Key. يُحفظ تجزئته SHA-256 فقط ويُعرض مرة واحدة عند الإنشاء.
الصلاحيات: read لكل ما هو GET · write لإرسال الرسائل وإنشاء طلبات الشحن. المفتاح مقيد بمستخدم واحد: لا يرى بيانات غير مستخدمه، ولا يصل إلى بيانات واتساب أو مفاتيح الدفع أو رموز nod إطلاقاً.
الحدود: 60 طلباً/دقيقة لكل مفتاح → 429 مع Retry-After و X-RateLimit-*. الترحيل ?limit=&offset= (افتراضي 50، أقصى 200) → data.items / data.total.
المغلّف: النجاح {"ok":true,"data":…} · الخطأ {"ok":false,"error":{"code","message"}}. المبالغ نص بالريال بمنزلتين (49.00)، التواريخ ISO-8601 بتوقيت الرياض (+03:00).
الدفع: الشحن عبر emm-pay (StreamPay: مدى · Apple Pay · Visa) داخل التطبيق. أضف "dry_run":true أو ?dry_run=1 لحساب السعر دون إنشاء طلب. يُفعَّل الطلب عبر ويبهوك موقّع (X-EMM-Pay-Signature) بعد تحقق جانبي الخادم.
المواصفة: OpenAPI 3.1 · خادم MCP على POST /mcp · صفحة الوكلاء
الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429
curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/me
الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429
curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/credit
الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429
curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/plans
الصلاحية: write · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429
curl -s -X POST -H "Authorization: Bearer $AUN_KEY" -H "Content-Type: application/json" -d '{"plan": true, "dry_run": false}' https://aun.emm.sa/api/v1/credit/checkoutالصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429 · المعاملات: limit offset
curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/orders
الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429 · المعاملات: limit
curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/conversation
الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429 · المعاملات: limit offset
curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/messages
الصلاحية: write · النجاح: 201 · الأخطاء: 400 / 401 / 403 / 429
curl -s -X POST -H "Authorization: Bearer $AUN_KEY" -H "Content-Type: application/json" -d '{"text": true}' https://aun.emm.sa/api/v1/messagesالصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429 · المعاملات: limit offset
curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/reminders
الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429 · المعاملات: limit offset
curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/notes
نفس المفتاح. التسلسل: initialize ← notifications/initialized (202) ← tools/list ← tools/call. الأدوات: aun_send_message (write)، aun_conversation، aun_credit_status، aun_pricing، aun_capabilities (read). أداة غير معروفة → -32602 · طريقة غير معروفة → -32601 · بلا مفتاح → 401 · GET /mcp → 405 · مهلة الأداة 25 ثانية.
curl -s -X POST -H "Authorization: Bearer $AUN_KEY" -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"agent","version":"1"}}}' https://aun.emm.sa/mcp
curl -s -X POST -H "Authorization: Bearer $AUN_KEY" -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"aun_credit_status","arguments":{}}}' https://aun.emm.sa/mcp