منصة المطورين — بصمتك عيادات

واجهة الشركاء v1: قراءة المرضى والمواعيد والفواتير، وحجز المواعيد وإلغاؤها، واستقبال إشعارات موقّعة.

English

العنوان الأساسي https://demo.clinics.basmtak.com/partner/v1 · OpenAPI 3.0.3 · تنزيل ملف OpenAPI

Read a clinic's patients, appointments and invoices, book and cancel appointments, and receive signed webhooks (appointment.*, invoice.*, claim.*, patient.erased). Money is always integer halalas (1 SAR = 100); ids of clinical rows are ULIDs; times are ISO-8601 in the branch's zone. Errors are JSON {error, message, details}; the message follows Accept-Language (ar or en). Lists answer {data, meta} and page with ?page and ?per_page (at most 100). No diagnoses, clinical notes or photos ever travel through this API.

التنزيلات

الثلاثة مولَّدة من ملف OpenAPI نفسه الذي تُبنى منه هذه الصفحة، فهي تطابق الواجهة الحية دائماً. لا يلزم تسجيل دخول.

OpenAPI 3 (YAML) · OpenAPI 3 (JSON) · مجموعة Postman (v2.1)

استوردها في Postman، وضع رمز عميلك في المتغيّر {{token}} ثم نفّذ أي طلب. «الاشتراك» يحفظ {{webhook_id}} و{{webhook_secret}}؛ ومجلد «توقيع الإشعار» يوقّع إشعاراً تجريبياً ويرسله إلى {{receiver_url}} لتختبر مستقبِلك قبل أي حدث حقيقي.

المصادقة

ينشئ مالك الحساب عميل واجهة من المكتب ← المطوّرون ويختار صلاحياته. يُعرض الرمز مرة واحدة. أرسله مع كل طلب:

curl -H "Authorization: Bearer bmc_…" -H "Accept-Language: ar" https://demo.clinics.basmtak.com/partner/v1/ping

يمكن إرسال الرمز أيضاً في الترويسة X-Api-Key. يجيب GET /ping بالعميل وصلاحياته والعيادة؛ استخدمه كطلب «اختبار الاتصال».

الصلاحيات

تحتاج كل نقطة إلى صلاحية واحدة؛ الطلب بدونها يجيب 403 insufficient_ability مع details.required_ability. صلاحية webhooks تدير الاشتراكات فقط: لاستقبال حدث أو استعراض عناصره الأخيرة يحتاج العميل أيضاً إلى الصلاحية التي تقرأ تلك البيانات.

الصلاحيةالنقاط
anyGET /ping · GET /meta
patients:readGET /patients · GET /patients/{id}
appointments:readGET /appointments · GET /appointments/{id}
appointments:writePOST /appointments · POST /appointments/{id}/cancel
invoices:readGET /invoices · GET /invoices/{id}
webhooksGET /webhooks · POST /webhooks · GET /webhooks/events · GET /webhooks/events/{event}/recent · GET /webhooks/{id} · PUT /webhooks/{id} · DELETE /webhooks/{id} · POST /webhooks/{id}/rotate · POST /webhooks/{id}/test

حدّ الطلبات

120 طلباً في الدقيقة لكل عميل واجهة. يحمل الجواب 429 الترويسة Retry-After، ويحمل كل جواب X-RateLimit-Limit وX-RateLimit-Remaining.

الطلبات التي لا يطابق رمزها عميلاً نشطاً تتقاسم حدّاً واحداً لكل عنوان: 30 في الدقيقة. الخطة التي لا تشمل واجهة الشركاء تجيب 403 not_entitled.

الأخطاء

كل خطأ JSON بالشكل {error, message, details}؛ الرسالة بحسب Accept-Language (ar أو en). المبالغ دائماً هللات صحيحة (1 ريال = 100).

{"error": "insufficient_ability", "message": "…", "details": {"required_ability": "appointments:write"}}
الرمزHTTPالمعنى
unauthenticated401رمز الواجهة مفقود. أرسله في الترويسة "Authorization: Bearer bmc_…".
token_invalid401رمز الواجهة غير صالح أو أُلغي.
tenant_inactive403حساب هذه العيادة موقوف أو مغلق.
not_entitled403خطة هذا الحساب لا تشمل واجهة الشركاء.
insufficient_ability403عميل الواجهة لا يملك الصلاحية التي يحتاجها هذا الطلب.
forbidden403إدارة عملاء الواجهة والإشعارات لمالك الحساب فقط.
not_found404غير موجود.
client_revoked409أُلغي عميل الواجهة هذا.
webhook_disabled409هذا الاشتراك متوقف.
delivery_sent409وصل هذا الإشعار بنجاح من قبل.
payload_redacted409حُذف محتوى هذا الإرسال (مدة الاحتفاظ أو محو بيانات مريض)، ولا يمكن إرساله مجدداً.
validation_failed422بعض الحقول غير صحيحة.
event_unknown422حدث غير معروف.
url_not_allowed422هذا الرابط لا يقبل الإشعارات (HTTPS على عنوان عام فقط).
webhook_limit422عدد الاشتراكات كبير.
rate_limited429طلبات كثيرة. حاول بعد قليل.
not_implemented501هذه النقطة موثّقة ولم تُتَح بعد؛ ستجيب عند صدور حزمتها.

قريباً

النقاط الموسومة «قريباً» موثّقة بالكامل هنا وتُفرض صلاحياتها، لكنها تجيب 501 not_implemented حتى تصدر حزمتها (المرضى، المواعيد، الفواتير). ابنِ تكاملك على هذا الملف؛ الأشكال ثابتة.

التصفّح

تجيب القوائم بالشكل {data, meta: {total, page, per_page}}. استخدم ?page= و?per_page= (الافتراضي 50، والحدّ الأقصى 100).

{"data": [ … ], "meta": {"total": 312, "page": 2, "per_page": 50}}

إعادة المحاولة والتكرار

حجز الموعد POST /appointments متكرر-آمن عبر external_ref لكل عميل واجهة: إرسال الحجز نفسه ثانيةً يجيب 200 بالموعد نفسه، لا حجزاً ثانياً. إلغاء موعد مرتين لا يغيّر شيئاً. عند انتهاء المهلة اقرأ قبل أن تعيد المحاولة. قد يصل الإشعار الواحد أكثر من مرة: تجاهل المكرر عبر X-Basmtak-Event-Id (الحقل id في الجسم).

الإشعارات (REST hooks)

اشترك عبر POST /webhooks {target_url, event} وألغِ الاشتراك عبر DELETE /webhooks/{id} — نمط REST hook في Zapier وMake. كل إرسال هو POST بالجسم {id, event, tenant_id, occurred_at, api_version, data}، يُعاد بتراجع أُسّي؛ 20 إخفاقاً متتالياً (أو جواب 410) يوقف الاشتراك. لا تحمل الإشعارات تشخيصاً ولا ملاحظات سريرية ولا صوراً أبداً.

شكل الإرسال

طلب POST بالترويسة Content-Type: application/json والجسم {id, event, tenant_id, occurred_at, api_version, data}؛ لـ data الشكل نفسه الذي تعيده الواجهة لذلك الكائن. الترويسات: X-Basmtak-Event وX-Basmtak-Event-Id وX-Basmtak-Delivery وX-Basmtak-Timestamp وX-Basmtak-Signature.

التحقق من الإرسال

X-Basmtak-Signature = "sha256=" + hex HMAC-SHA256(secret, X-Basmtak-Timestamp + "\n" + "POST" + "\n" + path + "\n" + hex SHA-256(raw body)). ارفض الطوابع الزمنية الأقدم من خمس دقائق. X-Basmtak-Event-Id فريد لكل حدث؛ استخدمه لإسقاط المكرر.

مثال محلول

بهذه المدخلات يجب أن ينتج كودك هذا التوقيع بالضبط (محسوب حيّاً بالكود نفسه الذي يوقّع الإرسالات الحقيقية). استخدم السر كما استلمته بما فيه whsec_، وبايتات الجسم الخام قبل أي تحليل JSON.

السرwhsec_example0000000000000000000000000000000000
X-Basmtak-Timestamp1798761600
مسار رابطك (بدون سلسلة الاستعلام)/hooks/standard/123/abc
الجسم الخام{"id":"7d3f0c52-1a4b-4c8e-9f21-6b0d2e5a9c11","event":"ping","tenant_id":1,"occurred_at":"2027-01-01T03:00:00+03:00","api_version":"v1","data":{}}
SHA-256 للجسم (hex)d950161f336317f2a060361c620449e231a81b783e5ad56dd34940641a0219b6
السلسلة القانونية (الأسطر مفصولة بـ \n)
1798761600
POST
/hooks/standard/123/abc
d950161f336317f2a060361c620449e231a81b783e5ad56dd34940641a0219b6
X-Basmtak-Signaturesha256=ced5fbb70b35667445f95e9f3e74b1db659649cbbc99eec039b69d010ccead26
// Node.js (Express: app.use(express.raw({type: 'application/json'})))
const crypto = require('crypto');
function verify(req, secret) {
  const ts = req.get('X-Basmtak-Timestamp');
  if (!/^\d+$/.test(ts) || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
  const path = req.originalUrl.split('?')[0];
  const canonical = ts + "\nPOST\n" + path + "\n" + crypto.createHash('sha256').update(req.body).digest('hex');
  const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(canonical).digest('hex');
  const given = req.get('X-Basmtak-Signature') || '';
  return given.length === expected.length && crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected));
}
<?php // PHP
$body = file_get_contents('php://input');
$ts = $_SERVER['HTTP_X_BASMTAK_TIMESTAMP'] ?? '';
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$canonical = $ts . "\nPOST\n" . $path . "\n" . hash('sha256', $body);
$ok = ctype_digit($ts) && abs(time() - (int) $ts) <= 300
   && hash_equals('sha256=' . hash_hmac('sha256', $canonical, $secret), $_SERVER['HTTP_X_BASMTAK_SIGNATURE'] ?? '');
# Python
import hashlib, hmac, time
def verify(secret: str, ts: str, path: str, body: bytes, signature: str) -> bool:
    if not ts.isdigit() or abs(time.time() - int(ts)) > 300:
        return False
    canonical = f"{ts}\nPOST\n{path}\n{hashlib.sha256(body).hexdigest()}"
    expected = "sha256=" + hmac.new(secret.encode(), canonical.encode(), hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, signature)

إعادة المحاولة والإيقاف

أي جواب 2xx خلال 10 ثانية نجاح. غير ذلك (حالة أخرى، مهلة، عنوان مرفوض) يُعاد بعد 60 ثانية مضاعفةً كل مرة حتى 6 ساعات؛ بعد 10 محاولة يُترك الإرسال. 20 محاولة فاشلة متتالية توقف الاشتراك، وجواب 410 Gone يوقفه فوراً (طريقة REST hook لإلغاء الاشتراك). يُحفظ رمز الحالة فقط، ولا يُحفظ جسم جوابك أبداً.

الأحداث

appointment.created صلاحية الاستقبال: appointments:read

بيانات نموذجية

{
    "id": "01J9ZK3Q7R8S9T0V1W2X3Y4Z5A",
    "patient_id": "01J9ZJ0000000000000000000P",
    "branch_id": 1,
    "practitioner_id": "01J9ZJ0000000000000000000D",
    "appointment_type_id": 3,
    "status": "booked",
    "starts_at": "2027-04-02T18:00:00+03:00",
    "ends_at": "2027-04-02T18:30:00+03:00",
    "room_id": 2,
    "source": "partner",
    "external_ref": "crm-1001",
    "note": null,
    "created_at": "2027-04-01T09:12:07+03:00",
    "updated_at": "2027-04-01T09:12:07+03:00"
}
appointment.updated صلاحية الاستقبال: appointments:read

بيانات نموذجية

{
    "changes": {
        "starts_at": [
            "2027-04-02T18:00:00+03:00",
            "2027-04-02T18:30:00+03:00"
        ]
    },
    "id": "01J9ZK3Q7R8S9T0V1W2X3Y4Z5A",
    "patient_id": "01J9ZJ0000000000000000000P",
    "branch_id": 1,
    "practitioner_id": "01J9ZJ0000000000000000000D",
    "appointment_type_id": 3,
    "status": "booked",
    "starts_at": "2027-04-02T18:00:00+03:00",
    "ends_at": "2027-04-02T18:30:00+03:00",
    "room_id": 2,
    "source": "partner",
    "external_ref": "crm-1001",
    "note": null,
    "created_at": "2027-04-01T09:12:07+03:00",
    "updated_at": "2027-04-01T09:12:07+03:00"
}
appointment.cancelled صلاحية الاستقبال: appointments:read

بيانات نموذجية

{
    "status": "cancelled",
    "cancel_reason": "patient_request",
    "cancelled_at": "2027-04-02T10:00:00+03:00",
    "id": "01J9ZK3Q7R8S9T0V1W2X3Y4Z5A",
    "patient_id": "01J9ZJ0000000000000000000P",
    "branch_id": 1,
    "practitioner_id": "01J9ZJ0000000000000000000D",
    "appointment_type_id": 3,
    "starts_at": "2027-04-02T18:00:00+03:00",
    "ends_at": "2027-04-02T18:30:00+03:00",
    "room_id": 2,
    "source": "partner",
    "external_ref": "crm-1001",
    "note": null,
    "created_at": "2027-04-01T09:12:07+03:00",
    "updated_at": "2027-04-01T09:12:07+03:00"
}
invoice.issued صلاحية الاستقبال: invoices:read

بيانات نموذجية

{
    "id": "01J9ZM0000000000000000000I",
    "number": "INV-2027-000418",
    "kind": "simplified",
    "status": "issued",
    "patient_id": "01J9ZJ0000000000000000000P",
    "branch_id": 1,
    "buyer_kind": "citizen",
    "currency": "SAR",
    "issued_at": "2027-04-02T18:41:07+03:00",
    "subtotal_halalas": 30000,
    "discount_halalas": 0,
    "vat_halalas": 4500,
    "total_halalas": 34500,
    "paid_halalas": 0,
    "due_halalas": 34500,
    "tax_breakdown": [
        {
            "tax_category": "state_borne",
            "net_halalas": 30000,
            "vat_halalas": 4500
        }
    ],
    "lines": [
        {
            "line_no": 1,
            "code": "97012",
            "description": "حشوة مركبة — سطح واحد",
            "tooth": "36",
            "surfaces": [
                "O"
            ],
            "qty": 1,
            "unit_halalas": 30000,
            "net_halalas": 30000,
            "tax_category": "state_borne",
            "vat_halalas": 4500,
            "total_halalas": 34500
        }
    ]
}
invoice.paid صلاحية الاستقبال: invoices:read

بيانات نموذجية

{
    "status": "paid",
    "paid_halalas": 34500,
    "due_halalas": 0,
    "paid_at": "2027-04-02T18:45:00+03:00",
    "payments": [
        {
            "method": "card",
            "amount_halalas": 34500,
            "scheme": "mada",
            "last4": "4242"
        }
    ],
    "id": "01J9ZM0000000000000000000I",
    "number": "INV-2027-000418",
    "kind": "simplified",
    "patient_id": "01J9ZJ0000000000000000000P",
    "branch_id": 1,
    "buyer_kind": "citizen",
    "currency": "SAR",
    "issued_at": "2027-04-02T18:41:07+03:00",
    "subtotal_halalas": 30000,
    "discount_halalas": 0,
    "vat_halalas": 4500,
    "total_halalas": 34500,
    "tax_breakdown": [
        {
            "tax_category": "state_borne",
            "net_halalas": 30000,
            "vat_halalas": 4500
        }
    ],
    "lines": [
        {
            "line_no": 1,
            "code": "97012",
            "description": "حشوة مركبة — سطح واحد",
            "tooth": "36",
            "surfaces": [
                "O"
            ],
            "qty": 1,
            "unit_halalas": 30000,
            "net_halalas": 30000,
            "tax_category": "state_borne",
            "vat_halalas": 4500,
            "total_halalas": 34500
        }
    ]
}
claim.updated صلاحية الاستقبال: invoices:read

بيانات نموذجية

{
    "id": "01J9ZN0000000000000000000C",
    "invoice_id": "01J9ZM0000000000000000000I",
    "patient_id": "01J9ZJ0000000000000000000P",
    "payer_id": 4,
    "status": "adjudicated",
    "previous_status": "submitted",
    "outcome": "partial",
    "claimed_halalas": 34500,
    "approved_halalas": 30000,
    "patient_share_halalas": 4500,
    "nphies_ref": "CLM-7F3A2",
    "updated_at": "2027-04-05T11:20:00+03:00"
}
patient.erased صلاحية الاستقبال: patients:read

بيانات نموذجية

{
    "id": "01J9ZJ0000000000000000000P",
    "erased_at": "2027-06-01T08:00:00+03:00"
}

REST hooks لـ Zapier وMake

تقدّم الواجهة كل ما يحتاجه مشغّل REST Hook في Zapier والمشغّل الفوري (webhook) في Make. المصادقة مفتاح واجهة يُرسل كرمز bearer.

الخطوةالطلبالجواب
اختبار الاتصالGET /ping200 بالعميل وصلاحياته والعيادة
الاشتراكPOST /webhooks {"target_url": "…", "event": "appointment.created"}201 {id, secret, data}؛ احتفظ بـ id لإلغاء الاشتراك (يُعرض السر هنا فقط)
إلغاء الاشتراكDELETE /webhooks/{id}204؛ جواب 410 Gone من رابطك يفعل الشيء نفسه
قائمة الأداء (بيانات نموذجية)GET /webhooks/events/{event}/recent?limit=3أحدث الكائنات الحقيقية لذلك الحدث في غلاف الإرسال؛ meta.sample نموذج ثابت لحساب فارغ
قائمة الأحداثGET /webhooks/eventsكل حدث مع نموذج
curl -X POST https://demo.clinics.basmtak.com/partner/v1/webhooks -H "Authorization: Bearer bmc_…" -H "Content-Type: application/json" \
     -d '{"target_url": "https://hooks.zapier.com/hooks/standard/123/abc", "event": "appointment.created"}'
{"id": 41, "secret": "whsec_…", "data": {"id": 41, "event": "appointment.created", "target_url": "https://hooks.zapier.com/hooks/standard/123/abc", …}}

curl https://demo.clinics.basmtak.com/partner/v1/webhooks/events/appointment.created/recent?limit=1 -H "Authorization: Bearer bmc_…"
{"data": [{"id": "appointment.created:01J9ZK…", "event": "appointment.created", "tenant_id": 7, "occurred_at": "…", "api_version": "v1", "data": {…}}], "meta": {"event": "appointment.created", "count": 1, "sample": {…}}}

curl -X DELETE https://demo.clinics.basmtak.com/partner/v1/webhooks/41 -H "Authorization: Bearer bmc_…"   # 204

يجب أن يكون رابط الإشعار HTTPS على عنوان عام (hooks.zapier.com وhook.*.make.com كذلك). السيناريو الذي يحتاج إجراءات فقط (حجز موعد، إلغاؤه) أو بحثاً (مريض بالرقم أو الهاتف، فاتورة) يستدعي النقاط أدناه مباشرة.

النقاط

meta Connectivity and what this server offers
GET /ping Check the token and see the client's abilities الصلاحية: any

الأجوبة

200The client, its abilities and the clinic
401{error, message, details}Error
GET /meta Abilities, the event catalogue, rate limits and the spec version الصلاحية: any

الأجوبة

200{data: {api_version, spec_version, abilities, client_abilities, events, rate_limits, per_page, webhooks, docs_url, openapi_url}}
patients The patient read subset (demographics and identifiers, never clinical content)
GET /patients List patients الصلاحية: patients:read

Demographics and identifiers only. Search by file_no, national id or phone through the filters below.

المعاملات

pagequeryinteger
per_pagequeryinteger
file_noquerystring
phonequerystringE.164
updated_sincequerystringISO-8601; only patients changed since then

الأجوبة

200A page of patientsPatientPage
GET /patients/{id} One patient الصلاحية: patients:read

المعاملات

idpathstring · requiredULID (26 characters)

الأجوبة

200The patientobject
404{error, message, details}Error
appointments Appointments, booking and cancellation
GET /appointments List appointments الصلاحية: appointments:read

المعاملات

pagequeryinteger
per_pagequeryinteger
branch_idqueryinteger
patient_idquerystring
practitioner_idquerystring
fromquerystringISO-8601 date or date-time (inclusive)
toquerystringISO-8601 date or date-time (exclusive)
statusquerystring

الأجوبة

200A page of appointmentsAppointmentPage
POST /appointments Book an appointment الصلاحية: appointments:write

Books a free slot (GET the clinic's slots through the portal rules the SCHEDULING package publishes). external_ref makes the call idempotent per API client: the same external_ref answers 200 with the same appointment, never a second booking. The patient is named by id or by phone (a new patient file is opened when the phone is unknown).

جسم الطلب AppointmentWrite

{
    "branch_id": 1,
    "practitioner_id": "01J9ZJ0000000000000000000D",
    "appointment_type_id": 3,
    "starts_at": "2027-04-02T18:00:00+03:00",
    "patient_id": "01J9ZJ0000000000000000000P",
    "external_ref": "crm-1001",
    "note": "يفضل الفترة المسائية"
}

الأجوبة

201The appointmentobject
200The same external_ref again — the existing appointment, with duplicate true
409{error, message, details}Error
422{error, message, details}Error
GET /appointments/{id} One appointment الصلاحية: appointments:read

المعاملات

idpathstring · requiredULID (26 characters)

الأجوبة

200The appointmentobject
404{error, message, details}Error
POST /appointments/{id}/cancel Cancel an appointment الصلاحية: appointments:write

Cancelling twice is a no-op (200). A completed or in-progress appointment answers 409 appointment_locked.

المعاملات

idpathstring · requiredULID (26 characters)

جسم الطلب object

{
    "reason": "patient_request"
}

الأجوبة

200The cancelled appointment
404{error, message, details}Error
409{error, message, details}Error
invoices Issued invoices and their payment state
GET /invoices List issued invoices الصلاحية: invoices:read

المعاملات

pagequeryinteger
per_pagequeryinteger
patient_idquerystring
branch_idqueryinteger
statusquerystring
issued_fromquerystringISO-8601 date (inclusive)
issued_toquerystringISO-8601 date (exclusive)

الأجوبة

200A page of invoicesInvoicePage
GET /invoices/{id} One invoice with its lines and payments الصلاحية: invoices:read

المعاملات

idpathstring · requiredULID (26 characters)

الأجوبة

200The invoiceobject
404{error, message, details}Error
webhooks REST hooks (Zapier and Make)
GET /webhooks Your subscriptions الصلاحية: webhooks

المعاملات

pagequeryinteger
per_pagequeryinteger

الأجوبة

200A page of subscriptions
POST /webhooks Subscribe (REST hook) الصلاحية: webhooks

The answer carries the subscription id and its signing secret. The secret is shown only here. The client must hold the ability that reads each event's data (appointments:read, invoices:read, patients:read).

جسم الطلب WebhookWrite

{
    "target_url": "https://hooks.zapier.com/hooks/standard/123/abc",
    "event": "appointment.created"
}

الأجوبة

201{id, secret, data}
403{error, message, details}Error
422{error, message, details}Error
GET /webhooks/events The events, each with the ability it needs and sample data الصلاحية: webhooks

الأجوبة

200{data: [{event, ability, sample}]}
GET /webhooks/events/{event}/recent Recent real objects of one event (REST hook perform list) الصلاحية: webhooks

The newest real objects of one event, each wrapped in the envelope a delivery carries {id, event, tenant_id, occurred_at, api_version, data}, newest first. Zapier calls this as the REST Hook trigger's perform list when a user tests a Zap; Make uses it to fetch sample data. id is event:object-id (stable, for de-duplication), not the uuid of a live delivery. Besides webhooks the client needs the ability that receives the event. meta.sample is the static sample, for a clinic with no data yet; data is empty until the event's package publishes its recent objects.

المعاملات

eventpathstring · required
limitqueryinteger1 to 25, default 3

الأجوبة

200{data: [{id, event, tenant_id, occurred_at, api_version, data}], meta: {event, count, sample}}
403{error, message, details}Error
422{error, message, details}Error
GET /webhooks/{id} One subscription الصلاحية: webhooks

المعاملات

idpathinteger · required

الأجوبة

200The subscription
404{error, message, details}Error
PUT /webhooks/{id} Change the URL, the events, the description or switch it on or off الصلاحية: webhooks

المعاملات

idpathinteger · required

جسم الطلب WebhookWrite

{
    "events": [
        "appointment.created",
        "appointment.cancelled"
    ],
    "status": "active"
}

الأجوبة

200The subscription
403{error, message, details}Error
404{error, message, details}Error
409{error, message, details}Error
422{error, message, details}Error
DELETE /webhooks/{id} Unsubscribe (REST hook) الصلاحية: webhooks

المعاملات

idpathinteger · required

الأجوبة

204Removed
404{error, message, details}Error
POST /webhooks/{id}/rotate Mint a new signing secret (the old one stops at once) الصلاحية: webhooks

المعاملات

idpathinteger · required

الأجوبة

200{id, secret, data} — the new secret, shown only here
404{error, message, details}Error
POST /webhooks/{id}/test Send a signed ping to this subscription now الصلاحية: webhooks

Delivers a `ping` event (data {subscription_id, message}) and answers the delivery row with its status and the receiver's HTTP status.

المعاملات

idpathinteger · required

الأجوبة

200{data: Delivery}
404{error, message, details}Error
409{error, message, details}Error