# مرجع واجهة المراقبات البرمجية

Source: https://instatus.com/help/ar/api/monitors

- [Monitors](https://instatus.com/help/ar/api/monitors#get-monitors): Check the uptime of your websites, APIs, and services
- [Cron Monitors](https://instatus.com/help/ar/api/monitors#cron-monitors): Monitor your scheduled jobs via HTTP pings

## القيم الممكنة للحقول

**موقع المراقبة**

| القيمة | الوصف |
| --- | --- |
| `US_EAST_1` | شمال فرجينيا |
| `CA_CENTRAL_1` | كندا (مونتريال) |
| `EU_CENTRAL_1` | فرانكفورت |
| `AP_NORTHEAST_1` | طوكيو |

**أنواع تنبيهات المراقبة**

| القيمة | الوصف |
| --- | --- |
| `INCIDENT` | تنبيه حادثة |
| `EMAIL` | تنبيه بالبريد الإلكتروني |
| `SMS` | تنبيه بالرسائل القصيرة |
| `SLACK` | تنبيه Slack |
| `DISCORD` | تنبيه Discord |
| `MICROSOFT_TEAMS` | تنبيه Microsoft Teams |
| `PHONE_CALL` | تنبيه بمكالمة هاتفية |
| `WEBHOOK` | تنبيه ويب هوك |
| `GOOGLE_CHAT` | تنبيه Google Chat |
| `WHATSAPP` | تنبيه WhatsApp |

**حالة المراقبة**

| القيمة | الوصف |
| --- | --- |
| `UP` | المراقبة تعمل بشكل طبيعي |
| `DOWN` | فشلت المراقبة |
| `DEGRADED` | المراقبة تواجه مشكلات |
| `UNKNOWN` | تعذّر تحديد حالة المراقبة |

## احصل على المراقبات

يمكنك استخدام نقطة النهاية هذه للعثور على قائمة بجميع المراقبات الموجودة والتنقّل فيها.

**نقطة النهاية:**

```bash
GET /:page_id/monitors
```

**معاملات الاستعلام**

| المعامل | النوع | القيمة الافتراضية | الوصف |
| --- | --- | --- | --- |
| `page` | `number` | `1` | رقم الصفحة المراد جلبها. |
| `limit` | `number` | `100` | عدد المراقبات في الصفحة. |
| `search` | `string` | `null` | مصطلح البحث لتصفية النتائج. |
| `status` | `enum` | `null` | تصفية حسب الحالة _('UP', 'DOWN', 'UNKNOWN', 'DEGRADED')_. |

**مثال على الطلب**

```bash
GET /1/monitors?limit=3&page=2&status=DOWN
```

**مثال على الاستجابة**

```json
{
  "monitors": [{ "...": "monitor objects" }],
  "total": 10,
  "page": 3,
  "totalPages": 5,
  "limit": 2
}
```

## أنشئ مراقبة

**نقطة النهاية:**

```bash
POST /monitors
```

**مثال على الطلب**

```json
{
  "pageId": "page123",
  "url": "https://example.com",
  "httpMethod": "GET",
  "body": null,
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer token"
  },
  "queryParams": {
    "search": "test",
    "limit": "10"
  },
  "basicAuth": {
    "username": "user",
    "password": "password"
  },
  "type": "HTTP",
  "assertions": [
    {
      "type": "STATUSCODE",
      "comparison": "EQUALS",
      "selector": null,
      "target": "200"
    }
  ],
  "alerts": ["alert-id-1", "alert-id-2"],
  "name": "Example Monitor",
  "locations": "US_EAST_1",
  "checksInterval": 300,
  "createComponent": true,
  "createMetric": true,
  "onFail": {
    "createIncident": true,
    "createOutageDuration": true,
    "publishIncident": true,
    "notifySubscribers": true
  },
  "onRecover": {
    "resolveIncident": true,
    "resolveOutageDuration": true,
    "publishIncident": true,
    "notifySubscribers": true
  }
}
```

**مثال على الاستجابة**

```json
{
  "monitor": {
    "pageId": "page123",
    "url": "https://example.com",
    "httpMethod": "GET",
    "body": null,
    "headers": {
      "Content-Type": "application/json",
      "Authorization": "Bearer token"
    },
    "queryParams": {
      "search": "test",
      "limit": "10"
    },
    "basicAuth": {
      "username": "user",
      "password": "password"
    },
    "type": "HTTP",
    "assertions": [
      {
        "id": "assertion1",
        "type": "STATUSCODE",
        "comparison": "EQUALS",
        "selector": null,
        "target": "200"
      }
    ],
    "alerts": ["alert1", "alert2"],
    "name": "Example Monitor",
    "locations": "US_EAST_1",
    "checksInterval": 300,
    "createComponent": true,
    "createMetric": true,
    "onFail": {
      "createIncident": true,
      "createOutageDuration": true,
      "publishIncident": true,
      "notifySubscribers": true
    },
    "onRecover": {
      "resolveIncident": true,
      "resolveOutageDuration": true,
      "publishIncident": true,
      "notifySubscribers": true
    },
    "createdAt": "2023-08-08T12:00:00Z",
    "updatedAt": "2023-08-08T12:00:00Z"
  },
  "message": "Monitor created successfully"
}
```

## حدّث مراقبة

**نقطة النهاية:**

```bash
PUT /monitors/:id
```

**مثال على الطلب**

```json
{
  "url": "https://updated.com",
  "name": "Updated Monitor Name"
}
```

**مثال على الاستجابة**

```json
{
  "monitor": {
    "pageId": "page123",
    "url": "https://updated.com",
    "httpMethod": "GET",
    "body": null,
    "headers": {
      "Content-Type": "application/json",
      "Authorization": "Bearer token"
    },
    "queryParams": {
      "search": "test",
      "limit": "10"
    },
    "basicAuth": {
      "username": "user",
      "password": "password"
    },
    "type": "HTTP",
    "assertions": [
      {
        "id": "assertion1",
        "type": "STATUSCODE",
        "comparison": "EQUALS",
        "selector": null,
        "value": "200"
      }
    ],
    "alerts": ["alert1", "alert2"],
    "name": "Updated Monitor Name",
    "locations": "US_EAST_1",
    "checksInterval": 300,
    "createComponent": true,
    "createMetric": true,
    "onFail": {
      "createIncident": true,
      "createOutageDuration": true,
      "publishIncident": true,
      "notifySubscribers": true
    },
    "onRecover": {
      "resolveIncident": true,
      "resolveOutageDuration": true,
      "publishIncident": true,
      "notifySubscribers": true
    },
    "createdAt": "2023-08-08T12:00:00Z",
    "updatedAt": "2023-08-08T12:00:00Z"
  },
  "message": "Monitor updated successfully"
}
```

## احذف مراقبة

**نقطة النهاية:**

```bash
DELETE /monitors/:id
```

**مثال على الطلب**

```bash
DELETE /monitors/monitor-id-1
```

**مثال على الاستجابة**

```json
{
  "message": "Monitor deleted successfully."
}
```

## احصل على سجلات المراقبة

**نقطة النهاية:**

```bash
GET /monitors/:id/logs
```

# معاملات الاستعلام

| المعامل | النوع | القيمة الافتراضية | الوصف |
| --- | --- | --- | --- |
| `limit` | `number` | 100 | عدد العناصر في الصفحة. لا يمكن أن يتجاوز ١٠٠٠. |
| `page` | `number` | 1 | رقم الصفحة المراد جلبها. |
| `monitorId` | `string` | - | معرّف المراقبة. |
| `location` | `string` | `null` | موقع المراقبة. |
| `createdAt` | `string` \| `object` \| `number` | `null` | تاريخ الإنشاء. يمكن أن يكون نصًا أو رقمًا أو كائنًا يضم الحقلين `gte` و`lte`. |
| `isSuccessful` | `boolean` | `null` | ما إذا كان الفحص ناجحًا. |
| `isSSLCheck` | `boolean` | `null` | ما إذا كان الفحص فحص SSL. |
| `httpStatusCode` | `string` | `null` | رمز حالة HTTP في الاستجابة. |
| `status` | `('UP', 'DOWN', 'UNKNOWN', 'DEGRADED')` | `null` | حالة المراقبة. |
| `dnsTime` | `string` \| `number` \| `object` | `null` | الوقت المستغرق في تحليل DNS. |
| `tcpTime` | `string` \| `number` \| `object` | `null` | الوقت المستغرق في اتصال TCP. |
| `tlsTime` | `string` \| `number` \| `object` | `null` | الوقت المستغرق في مصافحة TLS. |
| `firstByteTime` | `string` \| `number` \| `object` | `null` | الوقت المستغرق حتى استقبال أول بايت. |
| `downloadTime` | `string` \| `number` \| `object` | `null` | الوقت المستغرق في التنزيل. |
| `responseTime` | `string` \| `number` \| `object` | `null` | إجمالي زمن الاستجابة. |
| `performanceTime` | `string` \| `number` \| `object` | `null` | زمن الأداء. |
| `accessabilityScore` | `string` \| `number` \| `object` | `null` | درجة إمكانية الوصول. |
| `seoScore` | `string` \| `number` \| `object` | `null` | درجة تحسين محركات البحث. |
| `bestPracticesScore` | `string` \| `number` \| `object` | `null` | درجة أفضل الممارسات. |
| `successfulAssertions` | `string` \| `number` \| `object` | `null` | عدد التأكيدات الناجحة. |
| `sort` | `string` | ترتيب زمني | الحقل المستخدم في الترتيب. |

**مثال على الطلب**

```bash
GET /monitors/monitor-id-1/logs?limit=100&page=1
```

**مثال على الاستجابة**

```json
{
  "monitorLogs": [
    // {monitor log object},
    // {monitor log object 2}
  ],
  "total": 478,
  "page": 1,
  "totalPages": 5,
  "limit": 100
}
```

## شغّل فحص مراقبة عبر المعرّف

**نقطة النهاية:**

```bash
GET /monitors/:id/run
```

**معاملات الاستعلام**

| المعامل | النوع | القيمة الافتراضية | الوصف |
| --- | --- | --- | --- |
| `location` | `'US_EAST_1', 'EU_CENTRAL_1', 'AP_NORTHEAST_1', 'AP_SOUTHEAST_2', 'CA_CENTRAL_1'` | - | موقع المراقبة. يجب أن يكون إحدى القيم المحددة. |
| `retry` | `boolean` | `false` | يحدد ما إذا كان ينبغي إعادة محاولة العملية. اختياري. |
| `monitorLogId` | `string` | `null` | المعرّف الفريد لسجل المراقبة. اختياري. |

**مثال على الطلب**

```bash
GET /monitors/monitor-id-1/run?monitorId=abc123&location=US_EAST_1&retry=true&monitorLogId=log456
```

**مثال على الاستجابة**

```json
{
  "status": "success",
  "message": "Monitor check run successfully."
}
```

## أنشئ تنبيه مراقبة

**نقطة النهاية:**

```bash
POST /monitor-alerts
```

**مثال على الطلب**

```json
{
  "type": "EMAIL",
  "pageId": "page123",
  "recipient": "user@example.com",
  "recipientWorkspace": "workspace123",
  "whenFails": true,
  "whenRecovers": true,
  "whenDegrades": false,
  "whenSslExpires": true,
  "sslExpiresInDays": 30,
  "monitors": ["monitor1", "monitor2"],
  "metadata": "Additional information about the alert"
}
```

**مثال على الاستجابة**

```json
{
  "monitor": {
    "id": "alert123",
    "siteId": "site123",
    "type": "EMAIL",
    "recipient": "user@example.com",
    "whenFails": true,
    "whenRecovers": true,
    "whenDegrades": false,
    "whenSslExpires": true,
    "sslExpiresInDays": 30,
    "monitors": [{ "id": "monitor1" }, { "id": "monitor2" }],
    "createdAt": "2023-08-08T12:00:00Z",
    "updatedAt": "2023-08-08T12:00:00Z",
    "metadata": "Additional information about the alert"
  },
  "message": "Monitor Alert created successfully"
}
```

## حدّث تنبيه مراقبة

**نقطة النهاية:**

```bash
PUT /monitor-alerts/:id
```

**مثال على الطلب**

```json
{
  "type": "EMAIL",
  "monitors": ["monitor-1-id", "monitor-2-id", "monitor-3-id"]
}
```

**مثال على الاستجابة**

```json
{
  "monitor": {
    "type": "EMAIL",
    "pageId": "page123",
    "recipient": "user@example.com",
    "recipientWorkspace": "workspace123",
    "whenFails": true,
    "whenRecovers": true,
    "whenDegrades": false,
    "whenSslExpires": true,
    "sslExpiresInDays": 30,
    "monitors": ["monitor-1-id", "monitor-2-id"],
    "metadata": "Additional information about the alert"
  },
  "message": "Monitor alert updated successfully."
}
```

## احصل على تنبيهات المراقبة

**نقطة النهاية:**

```bash
GET /:page_id/monitor-alerts
```

**معاملات الاستعلام**

| المعامل | النوع | القيمة الافتراضية | الوصف |
| --- | --- | --- | --- |
| `limit` | `number` | 100 | عدد العناصر في الصفحة. |
| `page` | `number` | 1 | رقم الصفحة المراد جلبها. |

**مثال على الطلب**

```bash
GET /1/monitor-alerts?limit=2&page=3
```

**مثال على الاستجابة**

```json
{
  "monitorAlerts": [
    {...monitor alert objects}
  ],
  "total": 27,
  "page": 3,
  "totalPages": 14,
  "limit": 2
}
```

## احذف تنبيه مراقبة

**نقطة النهاية:**

```bash
DELETE /monitor-alerts/:id
```

**مثال على الطلب**

```bash
DELETE /monitor-alerts/alert-id-1
```

**مثال على الاستجابة**

```json
{
  "message": "Monitor alert deleted successfully."
}
```

## أنشئ مجموعة مراقبات

**نقطة النهاية:**

```bash
POST /monitors-groups
```

**مثال على الطلب**

```json
{
  "pageId": "page123",
  "name": "Example Name",
  "childId": "child456"
}
```

**مثال على الاستجابة**

```json
{
  "monitor": {
    "id": "group123",
    "name": "Example Name",
    "siteId": "site123",
    "collapsed": false,
    "monitors": [{ "id": "monitor1" }, { "id": "monitor2" }],
    "groupId": "parentGroup123",
    "children": [
      { "id": "childGroup1", "name": "Child Group 1" },
      { "id": "childGroup2", "name": "Child Group 2" }
    ],
    "order": 1,
    "createdAt": "2023-08-08T12:00:00Z",
    "updatedAt": "2023-08-08T12:00:00Z",
    "parents": ["parent1", "parent2"],
    "componentId": "component123"
  },
  "message": "Monitor group created successfully."
}
```

## حدّث مجموعة مراقبات

**نقطة النهاية:**

```bash
PUT /monitors-groups/:id
```

**مثال على الطلب**

```json
{
  "name": "Updated Monitor Group Name"
}
```

**مثال على الاستجابة**

```json
{
  "monitor": {
    "id": "group123",
    "name": "Updated Monitor Group Name",
    "siteId": "site123",
    "collapsed": true,
    "monitors": [{ "id": "monitor1" }, { "id": "monitor2" }],
    "groupId": "parentGroup123",
    "children": [
      { "id": "childGroup1", "name": "Child Group 1" },
      { "id": "childGroup2", "name": "Child Group 2" }
    ],
    "order": 1,
    "createdAt": "2023-08-08T12:00:00Z",
    "updatedAt": "2023-08-08T12:00:00Z",
    "parents": ["parent1", "parent2"],
    "componentId": "component123"
  },
  "message": "Monitor group updated successfully."
}
```

## احذف مجموعة مراقبات

**نقطة النهاية:**

```bash
DELETE /monitors-groups/:id
```

**مثال على الطلب**

```bash
DELETE /monitors-groups/group-id-1
```

**مثال على الاستجابة**

```json
{
  "message": "Monitor group deleted successfully."
}
```

## أضف مراقبات إلى مجموعة

**نقطة النهاية:**

```bash
POST /monitors-groups/:id/monitors
```

**مثال على الطلب**

```json
{
  "monitors": ["monitor1", "monitor2", "monitor3"]
}
```

**مثال على الاستجابة**

```json
{
  "message": "Monitors added to the group successfully."
}
```

## شغّل فحص مجموعة مراقبات

**نقطة النهاية:**

```bash
GET /monitors-groups/:id/run
```

**معاملات الاستعلام**

| المعامل | النوع | القيمة الافتراضية | الوصف |
| --- | --- | --- | --- |
| `location` | `'US_EAST_1', 'EU_CENTRAL_1', 'AP_NORTHEAST_1', 'AP_SOUTHEAST_2', 'CA_CENTRAL_1'` | - | موقع المراقبة. يجب أن يكون إحدى القيم المحددة. |
| `retry` | `boolean` | `false` | يحدد ما إذا كان ينبغي إعادة محاولة العملية. اختياري. |
| `monitorLogId` | `string` | `null` | المعرّف الفريد لسجل المراقبة. اختياري. |

**مثال على الطلب**

```bash
GET /monitors-groups/group-id-1/run
```

**مثال على الاستجابة**

```json
{
  "result": "OK",
  "monitorLogId": "monitor-log-id-1"
}
```

## مراقبات Cron

تتتبّع مراقبات Cron المهام المجدولة عبر نداءات HTTP. لمعرفة إعداد المنتج واستخدامه في لوحة التحكم، راجع [مراقبة Cron](https://instatus.com/help/ar/monitoring/cron).

### القيم الممكنة للحقول

**حالة مراقبة Cron**

| القيمة | الوصف |
| --- | --- |
| `UP` | المراقبة تعمل بشكل طبيعي |
| `DOWN` | فشلت المراقبة |
| `DEGRADED` | المراقبة تواجه مشكلات |
| `UNKNOWN` | تعذّر تحديد حالة المراقبة |

**وضع مراقبة Cron**

| القيمة | الوصف |
| --- | --- |
| `ACTIVE` | تُفحص المراقبة بشكل نشط |
| `PAUSED` | فحوصات المراقبة موقوفة مؤقتًا |
| `MUTED` | المراقبة مكتومة (بلا إشعارات) |

**حالة سجل مراقبة Cron**

| القيمة | الوصف |
| --- | --- |
| `SUCCESS` | اكتملت المهمة بنجاح |
| `FAILURE` | أبلغت المهمة صراحةً عن فشل |
| `MISSED` | لم ترسل المهمة نداءً ضمن النافذة المتوقعة |
| `LATE` | أرسلت المهمة نداءها بعد انتهاء الفترة لكن ضمن مهلة السماح |
| `STARTED` | أبلغت المهمة عن بدء تنفيذها (توقيت التنفيذ) |

**الفترة ومهلة السماح**

يُحدَّد كل من `period` و`grace` بـ**الثواني**. يمثّل `period` عدد المرات التي ينبغي أن تُشغَّل فيها المهمة؛ و`grace` هو الوقت الإضافي المسموح به قبل اعتبار المراقبة متوقفة.

### احصل على مراقبات Cron

**نقطة النهاية:**

```bash
GET /:page_id/monitors/cron
```

**معاملات الاستعلام**

| المعامل | النوع | القيمة الافتراضية | الوصف |
| --- | --- | --- | --- |
| `limit` | `number` | `100` | عدد مراقبات cron في الصفحة. الحد الأقصى ١٠٠. |
| `page` | `number` | `1` | رقم الصفحة. |
| `search` | `string` | `null` | مصطلح البحث لتصفية النتائج حسب الاسم. |
| `status` | `enum` | `null` | تصفية حسب الحالة _('UP', 'DOWN', 'UNKNOWN', 'DEGRADED')_. |

**مثال على الطلب**

```bash
GET /page123/monitors/cron?limit=10&page=1&status=DOWN
```

**مثال على الاستجابة**

```json
{
  "cronMonitors": [
    {
      "id": "cron-abc123",
      "name": "Daily backup",
      "slug": "my-page-x7k2m9n4p1q8w3e5",
      "period": 86400,
      "grace": 3600,
      "status": "UP",
      "state": "ACTIVE",
      "siteId": "page123",
      "order": 1,
      "groupId": null,
      "componentId": "component-id-1",
      "onFailCreateIncident": true,
      "onFailCreateOutageDuration": false,
      "onFailPublishIncident": true,
      "onFailNotifySubscribers": true,
      "onRecoverResolveIncident": true,
      "onRecoverResolveOutageDuration": false,
      "onRecoverPublishIncident": true,
      "onRecoverNotifySubscribers": true,
      "createTemplateId": null,
      "resolveTemplateId": null,
      "createdAt": "2024-01-15T08:00:00.000Z",
      "updatedAt": "2024-01-15T08:00:00.000Z"
    }
  ],
  "total": 1,
  "page": 1,
  "totalPages": 1,
  "limit": 10
}
```

### أنشئ مراقبة Cron

**نقطة النهاية:**

```bash
POST /monitors/cron
```

**مثال على الطلب**

```json
{
  "pageId": "page123",
  "name": "Daily backup",
  "period": 86400,
  "grace": 3600,
  "alerts": ["alert-id-1", "alert-id-2"],
  "createComponent": true,
  "onFail": {
    "createIncident": true,
    "createOutageDuration": false,
    "publishIncident": true,
    "notifySubscribers": true
  },
  "onRecover": {
    "resolveIncident": true,
    "resolveOutageDuration": false,
    "publishIncident": true,
    "notifySubscribers": true
  }
}
```

**مثال على الاستجابة**

```json
{
  "cronMonitor": {
    "id": "cron-abc123",
    "name": "Daily backup",
    "slug": "my-page-x7k2m9n4p1q8w3e5",
    "period": 86400,
    "grace": 3600,
    "status": "UP",
    "state": "ACTIVE",
    "siteId": "page123",
    "order": 1,
    "groupId": null,
    "componentId": "component-id-1",
    "onFailCreateIncident": true,
    "onFailCreateOutageDuration": false,
    "onFailPublishIncident": true,
    "onFailNotifySubscribers": true,
    "onRecoverResolveIncident": true,
    "onRecoverResolveOutageDuration": false,
    "onRecoverPublishIncident": true,
    "onRecoverNotifySubscribers": true,
    "createTemplateId": null,
    "resolveTemplateId": null,
    "createdAt": "2024-01-15T08:00:00.000Z",
    "updatedAt": "2024-01-15T08:00:00.000Z"
  },
  "message": "Cron monitor created successfully."
}
```

تتضمن الاستجابة الحقل `slug`. استخدمه لبناء روابط النداء الخاصة بمهمتك. أول نداء ناجح يجدول مهمة الفحص في الخلفية.

### حدّث مراقبة Cron

**نقطة النهاية:**

```bash
PUT /monitors/cron/:id
```

**مثال على الطلب**

```json
{
  "name": "Daily backup (updated)",
  "period": 43200,
  "grace": 1800,
  "state": "PAUSED",
  "alerts": ["alert-id-1"],
  "onFail": {
    "notifySubscribers": false
  }
}
```

**مثال على الاستجابة**

```json
{
  "cronMonitor": {
    "id": "cron-abc123",
    "name": "Daily backup (updated)",
    "slug": "my-page-x7k2m9n4p1q8w3e5",
    "period": 43200,
    "grace": 1800,
    "status": "UP",
    "state": "PAUSED",
    "siteId": "page123",
    "order": 1,
    "groupId": null,
    "componentId": "component-id-1",
    "onFailCreateIncident": true,
    "onFailCreateOutageDuration": false,
    "onFailPublishIncident": true,
    "onFailNotifySubscribers": false,
    "onRecoverResolveIncident": true,
    "onRecoverResolveOutageDuration": false,
    "onRecoverPublishIncident": true,
    "onRecoverNotifySubscribers": true,
    "createTemplateId": null,
    "resolveTemplateId": null,
    "alerts": [
      {
        "id": "alert-id-1",
        "type": "EMAIL",
        "recipient": "ops@example.com"
      }
    ],
    "createdAt": "2024-01-15T08:00:00.000Z",
    "updatedAt": "2024-01-16T10:30:00.000Z"
  },
  "message": "Cron monitor updated successfully."
}
```

### احذف مراقبة Cron

**نقطة النهاية:**

```bash
DELETE /monitors/cron/:id
```

**مثال على الطلب**

```bash
DELETE /monitors/cron/cron-abc123
```

**مثال على الاستجابة**

```json
{
  "cronMonitor": {
    "id": "cron-abc123",
    "name": "Daily backup",
    "slug": "my-page-x7k2m9n4p1q8w3e5",
    "period": 86400,
    "grace": 3600,
    "status": "UP",
    "state": "ACTIVE",
    "siteId": "page123",
    "order": 1,
    "groupId": null,
    "componentId": "component-id-1",
    "onFailCreateIncident": true,
    "onFailCreateOutageDuration": false,
    "onFailPublishIncident": true,
    "onFailNotifySubscribers": true,
    "onRecoverResolveIncident": true,
    "onRecoverResolveOutageDuration": false,
    "onRecoverPublishIncident": true,
    "onRecoverNotifySubscribers": true,
    "createTemplateId": null,
    "resolveTemplateId": null,
    "createdAt": "2024-01-15T08:00:00.000Z",
    "updatedAt": "2024-01-15T08:00:00.000Z"
  },
  "message": "Cron monitor deleted successfully."
}
```

### احصل على سجلات مراقبة Cron

**نقطة النهاية:**

```bash
GET /monitors/cron/:id/logs
```

**معاملات الاستعلام**

| المعامل | النوع | القيمة الافتراضية | الوصف |
| --- | --- | --- | --- |
| `limit` | `number` | `100` | عدد السجلات في الصفحة. الحد الأقصى ١٢٧. |
| `page` | `number` | `1` | رقم الصفحة. الحد الأقصى ١٠٠٠. |
| `startDate` | `string` | قبل سنة | تاريخ بداية نطاق السجلات بصيغة ISO 8601. |
| `endDate` | `string` | الآن | تاريخ نهاية نطاق السجلات بصيغة ISO 8601. |
| `importance` | `enum` | `null` | تصفية السجلات حسب الأهمية _('all', 'important')_. |

**مثال على الطلب**

```bash
GET /monitors/cron/cron-abc123/logs?limit=50&page=1&importance=important
```

**مثال على الاستجابة**

```json
{
  "logs": [
    {
      "id": "log-xyz789",
      "monitorId": "cron-abc123",
      "status": "SUCCESS",
      "requestType": "GET",
      "agent": "curl/8.4.0",
      "ipAddress": "203.0.113.10",
      "createdAt": "2024-01-16T06:00:00.000Z",
      "startedAt": "2024-01-16T05:59:58.000Z"
    }
  ],
  "page": 1
}
```

### احصل على ملخّص مراقبة Cron

**نقطة النهاية:**

```bash
GET /monitors/cron/:id/summary
```

**مثال على الطلب**

```bash
GET /monitors/cron/cron-abc123/summary
```

**مثال على الاستجابة**

```json
{
  "summary": {
    "totalLogs": 120,
    "totalFailedLogs": 3,
    "availability": 97.5,
    "oneDayAvailability": 100,
    "previousDayAvailability": 100,
    "sevenDayAvailability": 98.2,
    "previousSevenDayAvailability": 96.1,
    "thirtyDayAvailability": 97.5,
    "previousThirtyDayAvailability": 95.8,
    "lastSuccess": "2024-01-16T06:00:00.000Z",
    "lastFailure": "2024-01-10T06:00:00.000Z",
    "lastStarted": null,
    "upSince": "2024-01-10T07:00:00.000Z",
    "downSince": null
  }
}
```

### نقاط نهاية النداء

لا تتطلب نقاط النهاية هذه مصادقة. يعمل الحقل `slug` الخاص بالمراقبة بمثابة المفتاح السري.

يمكنك إرسال النداء عبر الرابط الأساسي للواجهة البرمجية أو عبر مضيف cron المخصص:

- **نجاح:** `https://cron.instatus.com/{slug}` أو `GET` / `POST` / `HEAD` `/monitors/cron/{slug}`
- **فشل:** `https://cron.instatus.com/{slug}/fail` أو `GET` / `POST` / `HEAD` `/monitors/cron/{slug}/fail`
- **بدء:** `https://cron.instatus.com/{slug}/start` أو `GET` / `POST` / `HEAD` `/monitors/cron/{slug}/start`

أرسل نداء نجاح في كل مرة تنتهي فيها مهمتك في موعدها. وأرسل نداء بدء قبل تشغيل المهمة ثم نداء نجاح أو فشل عند انتهائها لتسجيل زمن التنفيذ.

**مثال على نداء ناجح**

```bash
curl https://cron.instatus.com/my-page-x7k2m9n4p1q8w3e5
```

**مثال على الاستجابة**

```json
{
  "id": "log-xyz789",
  "monitorId": "cron-abc123",
  "status": "SUCCESS",
  "requestType": "GET",
  "agent": "curl/8.4.0",
  "ipAddress": "203.0.113.10",
  "createdAt": "2024-01-16T06:00:00.000Z"
}
```

إذا كان الـ slug غير صالح، تكون الاستجابة:

```json
{
  "message": "Monitor not found"
}
```
