واجهة REST

أدِر موارد حسابك عبر HTTP بمفتاح API من نوع bearer.

توجد REST API تحت https://api.gheima.ma/v1، وتغطي ما تفعله في لوحة التحكّم. صادِق بمفتاح API تمرّره كرمز bearer. حدّ الطلبات يُطبَّق على كل مفتاح ويتوقّف على خطتك: من 60 طلبًا في الدقيقة في خطة Free إلى 1200 في خطة Agency. تُظهر ترويسات الاستجابة X-RateLimit-* ما تبقّى لك. المواصفة الكاملة القابلة للقراءة آليًا على /api/v1/openapi.json.

Shell
# List services (cursor-paginated: ?limit=&cursor=&type=WEB|WORKER|STATIC)
curl "https://api.gheima.ma/v1/services?limit=20" \
  -H "Authorization: Bearer gh_xxxxx"

# Create a service
curl -X POST https://api.gheima.ma/v1/services \
  -H "Authorization: Bearer gh_xxxxx" -H "content-type: application/json" \
  -d '{"projectId":"prj_1","name":"web","repoUrl":"https://github.com/me/app"}'

# Trigger a deployment -> 202 { deploymentId }
curl -X POST https://api.gheima.ma/v1/services/<id>/deploy \
  -H "Authorization: Bearer gh_xxxxx"

نقاط نهاية القوائم مقسّمة إلى صفحات بالمؤشّر. مرّر ?limit= (من 1 إلى 100، والافتراضي 20) و?cursor=، ثم اقرأ المؤشّر التالي من pagination.nextCursor في الاستجابة.

✦ أي لغة تستطيع إرسال طلب HTTP يمكنها التحكّم في غيمة.