كل الموارد

التنبيهات

قواعد التنبيه من القوالب أو بتعريف مخصص، والتنبيهات وتأكيدها وإغلاقها.

عنوان الأساسhttps://api.ping.nml.sa/v111 عملية

الانتقال إلى عملية

الأخطاء المشتركة

تُرجع عمليات هذه الصفحة هذه الأخطاء بصيغة واحدة، وتذكر كل عملية الأخطاء التي تُرجعها.

  • 400The request is invalid (code: invalid_request), with field errors.
  • 401The API key is missing, unknown, expired or revoked (code: unauthorized).
  • 403The API key lacks the scope this operation needs (code: forbidden).
  • 404No such resource in this account, or outside the key's data scope (code: not_found).
  • 409The resource is not in a state that allows this (code: conflict), or the idempotency key is in use.
  • 429The key's rate limit is reached (code: rate_limited). Retry after the Retry-After header's seconds.

قائمة التنبيهات.

GET/v1/alarms

Alarms opened by the account's rules, newest first. A department-scoped key sees only alarms on its own vehicles.

النطاقrules:read

المعاملات

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

  • statusstring الاستعلام

    Only alarms in this status.

    مثال:acked

  • severitystring الاستعلام

    Only alarms of this severity.

    مثال:warning

  • vehicle_idstring الاستعلام

    Only alarms on this vehicle.

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • rule_idstring الاستعلام

    Only alarms opened by this rule.

    مثال:019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a

  • kindstring الاستعلام

    Only alarms of this kind (a template id, or custom).

    مثال:overspeed

  • fromstring (date-time) الاستعلام

    Only alarms seen at or after this time (their last occurrence).

    مثال:2026-11-10T00:00:00Z

  • tostring (date-time) الاستعلام

    Only alarms opened before this time.

    مثال:2026-11-17T00:00:00Z

الاستجابة 200

  • dataobject[]
    حقول data
    • idstring

      مثال:019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b

    • rule_idstring | null

      The rule that opened the alarm; null once the rule is deleted.

      مثال:019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a

    • vehicle_idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • kindstring

      The template id of the rule that opened the alarm, or custom.

      مثال:overspeed

    • severitystring

      أحد:infowarningcritical

    • statusstring

      open, then acked (optional), then closed.

      أحد:openackedclosed

    • opened_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

    • last_seen_atstring (date-time)

      The latest occurrence: a repeat within the rule's minimum gap joins the open alarm.

      مثال:2026-11-17T08:41:00Z

    • occurrencesinteger

      مثال:2

    • assigneestring | null

      The account user the alarm is given to.

      مثال:019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b

    • acked_bystring | null

      Who acknowledged it: user:<id> or user:apikey/<key id>.

      مثال:user:apikey/k7Qm2Lp9Xa4R

    • acked_atstring | null (date-time)

      مثال:2026-11-17T08:34:10Z

    • closed_bystring | null

      Who closed it (system: when the platform closed it as the condition cleared).

      مثال:null

    • closed_atstring | null (date-time)

      مثال:null

    • resolutionstring | null

      How a person closed it; null until then, and when the platform closed it.

    • notestring | null

      The latest note given when acknowledging or closing.

      مثال:Driver called; speed back to limit.

    • positionobject | null

      Where the vehicle was when it opened.

    • limitnumber | null

      The limit a condition compared with.

      مثال:120

    • factsobject[]

      The facts that held when it opened.

      حقول facts
      • factstring

        A namespaced fact: position.* (the latest record; position.priority the highest record priority, 2 = panic), state.* (device state), signal.<key> (one measurement whichever model reports it: a device IO element is read as the signal it maps to in infra/devices/io/signals.toml), geofence.*, vehicle.*, alarm.*, rider.* (rider.onboard, rider.unknown_card) or cargo.* (cargo.warmest_c, cargo.coldest_c: the compartment's probes).

        مثال:position.speed_kmh

      • numbernumber

        مثال:134

      • textstring

        مثال:open

      • booleanboolean

        مثال:true

  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403429

مثال الطلب
curl "https://api.ping.nml.sa/v1/alarms" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "id": "019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b",
      "rule_id": "019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a",
      "vehicle_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "kind": "overspeed",
      "severity": "warning",
      "status": "acked",
      "opened_at": "2026-11-17T08:30:00Z",
      "last_seen_at": "2026-11-17T08:41:00Z",
      "occurrences": 2,
      "assignee": "019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b",
      "acked_by": "user:apikey/k7Qm2Lp9Xa4R",
      "acked_at": "2026-11-17T08:34:10Z",
      "closed_by": null,
      "closed_at": null,
      "resolution": "actioned",
      "note": "Driver called; speed back to limit.",
      "position": {
        "lat": 24.7136,
        "lon": 46.6753
      },
      "limit": 120,
      "facts": [
        {
          "fact": "position.speed_kmh",
          "number": 134,
          "text": "open",
          "boolean": true
        }
      ]
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

بيانات تنبيه.

GET/v1/alarms/{alarmId}

One alarm with its lifecycle and its activity, oldest first: opened, repeated, acknowledged, assigned, commented, closed and reopened, with who and when.

النطاقrules:read

المعاملات

  • alarmIdstring المسار مطلوب

    مثال:019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b

الاستجابة 200

  • idstring

    مثال:019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b

  • rule_idstring | null

    The rule that opened the alarm; null once the rule is deleted.

    مثال:019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a

  • vehicle_idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • kindstring

    The template id of the rule that opened the alarm, or custom.

    مثال:overspeed

  • severitystring

    أحد:infowarningcritical

  • statusstring

    open, then acked (optional), then closed.

    أحد:openackedclosed

  • opened_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • last_seen_atstring (date-time)

    The latest occurrence: a repeat within the rule's minimum gap joins the open alarm.

    مثال:2026-11-17T08:41:00Z

  • occurrencesinteger

    مثال:2

  • assigneestring | null

    The account user the alarm is given to.

    مثال:019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b

  • acked_bystring | null

    Who acknowledged it: user:<id> or user:apikey/<key id>.

    مثال:user:apikey/k7Qm2Lp9Xa4R

  • acked_atstring | null (date-time)

    مثال:2026-11-17T08:34:10Z

  • closed_bystring | null

    Who closed it (system: when the platform closed it as the condition cleared).

    مثال:null

  • closed_atstring | null (date-time)

    مثال:null

  • resolutionstring | null

    How a person closed it; null until then, and when the platform closed it.

  • notestring | null

    The latest note given when acknowledging or closing.

    مثال:Driver called; speed back to limit.

  • positionobject | null

    Where the vehicle was when it opened.

  • limitnumber | null

    The limit a condition compared with.

    مثال:120

  • factsobject[]

    The facts that held when it opened.

    حقول facts
    • factstring

      A namespaced fact: position.* (the latest record; position.priority the highest record priority, 2 = panic), state.* (device state), signal.<key> (one measurement whichever model reports it: a device IO element is read as the signal it maps to in infra/devices/io/signals.toml), geofence.*, vehicle.*, alarm.*, rider.* (rider.onboard, rider.unknown_card) or cargo.* (cargo.warmest_c, cargo.coldest_c: the compartment's probes).

      مثال:position.speed_kmh

    • numbernumber

      مثال:134

    • textstring

      مثال:open

    • booleanboolean

      مثال:true

  • activityobject[]

    Oldest first.

    حقول activity
    • idstring

      مثال:019ac0c7-3d4e-7f5a-9b6c-7d8e9f0a1b2c

    • atstring (date-time)

      مثال:2026-11-17T08:34:10Z

    • kindstring

      أحد:openedrepeatedackedassignedcommentedclosedreopened

    • actorstring | null

      Who did it (user:<id>); null when the platform did.

      مثال:user:019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b

    • assigneestring | null

      مثال:019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b

    • resolutionstring | null
    • notestring | null

      مثال:null

    • occurrenceinteger | null

      مثال:null

الأخطاء

400401403404429

مثال الطلب
curl "https://api.ping.nml.sa/v1/alarms/019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "id": "019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b",
  "rule_id": "019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a",
  "vehicle_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "kind": "overspeed",
  "severity": "warning",
  "status": "acked",
  "opened_at": "2026-11-17T08:30:00Z",
  "last_seen_at": "2026-11-17T08:41:00Z",
  "occurrences": 2,
  "assignee": "019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b",
  "acked_by": "user:apikey/k7Qm2Lp9Xa4R",
  "acked_at": "2026-11-17T08:34:10Z",
  "closed_by": null,
  "closed_at": null,
  "resolution": "actioned",
  "note": "Driver called; speed back to limit.",
  "position": {
    "lat": 24.7136,
    "lon": 46.6753
  },
  "limit": 120,
  "facts": [
    {
      "fact": "position.speed_kmh",
      "number": 134,
      "text": "open",
      "boolean": true
    }
  ],
  "activity": [
    {
      "id": "019ac0c7-3d4e-7f5a-9b6c-7d8e9f0a1b2c",
      "at": "2026-11-17T08:34:10Z",
      "kind": "assigned",
      "actor": "user:019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b",
      "assignee": "019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b",
      "resolution": "actioned",
      "note": null,
      "occurrence": null
    }
  ]
}

تأكيد استلام تنبيه.

POST/v1/alarms/{alarmId}/ack

Moves an open alarm to acked and records who acknowledged it and when, with an optional note. Any other status answers 409.

النطاقrules:write

المعاملات

  • alarmIdstring المسار مطلوب

    مثال:019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b

محتوى الطلب

  • notestring

    مثال:Driver called.

الاستجابة 200

  • idstring

    مثال:019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b

  • rule_idstring | null

    The rule that opened the alarm; null once the rule is deleted.

    مثال:019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a

  • vehicle_idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • kindstring

    The template id of the rule that opened the alarm, or custom.

    مثال:overspeed

  • severitystring

    أحد:infowarningcritical

  • statusstring

    open, then acked (optional), then closed.

    أحد:openackedclosed

  • opened_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • last_seen_atstring (date-time)

    The latest occurrence: a repeat within the rule's minimum gap joins the open alarm.

    مثال:2026-11-17T08:41:00Z

  • occurrencesinteger

    مثال:2

  • assigneestring | null

    The account user the alarm is given to.

    مثال:019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b

  • acked_bystring | null

    Who acknowledged it: user:<id> or user:apikey/<key id>.

    مثال:user:apikey/k7Qm2Lp9Xa4R

  • acked_atstring | null (date-time)

    مثال:2026-11-17T08:34:10Z

  • closed_bystring | null

    Who closed it (system: when the platform closed it as the condition cleared).

    مثال:null

  • closed_atstring | null (date-time)

    مثال:null

  • resolutionstring | null

    How a person closed it; null until then, and when the platform closed it.

  • notestring | null

    The latest note given when acknowledging or closing.

    مثال:Driver called; speed back to limit.

  • positionobject | null

    Where the vehicle was when it opened.

  • limitnumber | null

    The limit a condition compared with.

    مثال:120

  • factsobject[]

    The facts that held when it opened.

    حقول facts
    • factstring

      A namespaced fact: position.* (the latest record; position.priority the highest record priority, 2 = panic), state.* (device state), signal.<key> (one measurement whichever model reports it: a device IO element is read as the signal it maps to in infra/devices/io/signals.toml), geofence.*, vehicle.*, alarm.*, rider.* (rider.onboard, rider.unknown_card) or cargo.* (cargo.warmest_c, cargo.coldest_c: the compartment's probes).

      مثال:position.speed_kmh

    • numbernumber

      مثال:134

    • textstring

      مثال:open

    • booleanboolean

      مثال:true

الأخطاء

400401403404409429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/alarms/019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b/ack" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"note": "Driver called."}'
مثال الاستجابة · 200
{
  "id": "019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b",
  "rule_id": "019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a",
  "vehicle_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "kind": "overspeed",
  "severity": "warning",
  "status": "acked",
  "opened_at": "2026-11-17T08:30:00Z",
  "last_seen_at": "2026-11-17T08:41:00Z",
  "occurrences": 2,
  "assignee": "019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b",
  "acked_by": "user:apikey/k7Qm2Lp9Xa4R",
  "acked_at": "2026-11-17T08:34:10Z",
  "closed_by": null,
  "closed_at": null,
  "resolution": "actioned",
  "note": "Driver called; speed back to limit.",
  "position": {
    "lat": 24.7136,
    "lon": 46.6753
  },
  "limit": 120,
  "facts": [
    {
      "fact": "position.speed_kmh",
      "number": 134,
      "text": "open",
      "boolean": true
    }
  ]
}

إسناد تنبيه إلى مستخدم.

POST/v1/alarms/{alarmId}/assign

Gives an open or acked alarm to one of the account's users. An open alarm is acknowledged by the caller as it is assigned. A closed alarm answers 409.

النطاقrules:write

المعاملات

  • alarmIdstring المسار مطلوب

    مثال:019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b

محتوى الطلب

  • assigneestring مطلوب

    An account user id.

    مثال:019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b

الاستجابة 200

  • idstring

    مثال:019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b

  • rule_idstring | null

    The rule that opened the alarm; null once the rule is deleted.

    مثال:019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a

  • vehicle_idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • kindstring

    The template id of the rule that opened the alarm, or custom.

    مثال:overspeed

  • severitystring

    أحد:infowarningcritical

  • statusstring

    open, then acked (optional), then closed.

    أحد:openackedclosed

  • opened_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • last_seen_atstring (date-time)

    The latest occurrence: a repeat within the rule's minimum gap joins the open alarm.

    مثال:2026-11-17T08:41:00Z

  • occurrencesinteger

    مثال:2

  • assigneestring | null

    The account user the alarm is given to.

    مثال:019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b

  • acked_bystring | null

    Who acknowledged it: user:<id> or user:apikey/<key id>.

    مثال:user:apikey/k7Qm2Lp9Xa4R

  • acked_atstring | null (date-time)

    مثال:2026-11-17T08:34:10Z

  • closed_bystring | null

    Who closed it (system: when the platform closed it as the condition cleared).

    مثال:null

  • closed_atstring | null (date-time)

    مثال:null

  • resolutionstring | null

    How a person closed it; null until then, and when the platform closed it.

  • notestring | null

    The latest note given when acknowledging or closing.

    مثال:Driver called; speed back to limit.

  • positionobject | null

    Where the vehicle was when it opened.

  • limitnumber | null

    The limit a condition compared with.

    مثال:120

  • factsobject[]

    The facts that held when it opened.

    حقول facts
    • factstring

      A namespaced fact: position.* (the latest record; position.priority the highest record priority, 2 = panic), state.* (device state), signal.<key> (one measurement whichever model reports it: a device IO element is read as the signal it maps to in infra/devices/io/signals.toml), geofence.*, vehicle.*, alarm.*, rider.* (rider.onboard, rider.unknown_card) or cargo.* (cargo.warmest_c, cargo.coldest_c: the compartment's probes).

      مثال:position.speed_kmh

    • numbernumber

      مثال:134

    • textstring

      مثال:open

    • booleanboolean

      مثال:true

الأخطاء

400401403404409429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/alarms/019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b/assign" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"assignee": "019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b"}'
مثال الاستجابة · 200
{
  "id": "019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b",
  "rule_id": "019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a",
  "vehicle_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "kind": "overspeed",
  "severity": "warning",
  "status": "acked",
  "opened_at": "2026-11-17T08:30:00Z",
  "last_seen_at": "2026-11-17T08:41:00Z",
  "occurrences": 2,
  "assignee": "019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b",
  "acked_by": "user:apikey/k7Qm2Lp9Xa4R",
  "acked_at": "2026-11-17T08:34:10Z",
  "closed_by": null,
  "closed_at": null,
  "resolution": "actioned",
  "note": "Driver called; speed back to limit.",
  "position": {
    "lat": 24.7136,
    "lon": 46.6753
  },
  "limit": 120,
  "facts": [
    {
      "fact": "position.speed_kmh",
      "number": 134,
      "text": "open",
      "boolean": true
    }
  ]
}

إغلاق تنبيه مع ملاحظة.

POST/v1/alarms/{alarmId}/close

Closes an open or acked alarm and records who closed it, when, the resolution (actioned or false positive) and the note. A closed alarm answers 409.

النطاقrules:write

المعاملات

  • alarmIdstring المسار مطلوب

    مثال:019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b

محتوى الطلب

  • resolutionstring مطلوب

    أحد:actionedfalse_positive

  • notestring مطلوب

    مثال:Driver called; speed back to limit.

الاستجابة 200

  • idstring

    مثال:019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b

  • rule_idstring | null

    The rule that opened the alarm; null once the rule is deleted.

    مثال:019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a

  • vehicle_idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • kindstring

    The template id of the rule that opened the alarm, or custom.

    مثال:overspeed

  • severitystring

    أحد:infowarningcritical

  • statusstring

    open, then acked (optional), then closed.

    أحد:openackedclosed

  • opened_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • last_seen_atstring (date-time)

    The latest occurrence: a repeat within the rule's minimum gap joins the open alarm.

    مثال:2026-11-17T08:41:00Z

  • occurrencesinteger

    مثال:2

  • assigneestring | null

    The account user the alarm is given to.

    مثال:019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b

  • acked_bystring | null

    Who acknowledged it: user:<id> or user:apikey/<key id>.

    مثال:user:apikey/k7Qm2Lp9Xa4R

  • acked_atstring | null (date-time)

    مثال:2026-11-17T08:34:10Z

  • closed_bystring | null

    Who closed it (system: when the platform closed it as the condition cleared).

    مثال:null

  • closed_atstring | null (date-time)

    مثال:null

  • resolutionstring | null

    How a person closed it; null until then, and when the platform closed it.

  • notestring | null

    The latest note given when acknowledging or closing.

    مثال:Driver called; speed back to limit.

  • positionobject | null

    Where the vehicle was when it opened.

  • limitnumber | null

    The limit a condition compared with.

    مثال:120

  • factsobject[]

    The facts that held when it opened.

    حقول facts
    • factstring

      A namespaced fact: position.* (the latest record; position.priority the highest record priority, 2 = panic), state.* (device state), signal.<key> (one measurement whichever model reports it: a device IO element is read as the signal it maps to in infra/devices/io/signals.toml), geofence.*, vehicle.*, alarm.*, rider.* (rider.onboard, rider.unknown_card) or cargo.* (cargo.warmest_c, cargo.coldest_c: the compartment's probes).

      مثال:position.speed_kmh

    • numbernumber

      مثال:134

    • textstring

      مثال:open

    • booleanboolean

      مثال:true

الأخطاء

400401403404409429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/alarms/019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b/close" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"resolution": "actioned", "note": "Driver called; speed back to limit."}'
مثال الاستجابة · 200
{
  "id": "019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b",
  "rule_id": "019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a",
  "vehicle_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "kind": "overspeed",
  "severity": "warning",
  "status": "acked",
  "opened_at": "2026-11-17T08:30:00Z",
  "last_seen_at": "2026-11-17T08:41:00Z",
  "occurrences": 2,
  "assignee": "019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b",
  "acked_by": "user:apikey/k7Qm2Lp9Xa4R",
  "acked_at": "2026-11-17T08:34:10Z",
  "closed_by": null,
  "closed_at": null,
  "resolution": "actioned",
  "note": "Driver called; speed back to limit.",
  "position": {
    "lat": 24.7136,
    "lon": 46.6753
  },
  "limit": 120,
  "facts": [
    {
      "fact": "position.speed_kmh",
      "number": 134,
      "text": "open",
      "boolean": true
    }
  ]
}

إضافة ملاحظة إلى تنبيه.

POST/v1/alarms/{alarmId}/comments

Adds a note to the alarm's activity, whatever its status.

النطاقrules:write يقبل Idempotency-Key

المعاملات

  • alarmIdstring المسار مطلوب

    مثال:019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b

  • Idempotency-Keystring الترويسة

    A unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.

محتوى الطلب

  • textstring مطلوب

    مثال:Called the driver; he is pulling over.

الاستجابة 201

  • idstring

    مثال:019ac0c7-3d4e-7f5a-9b6c-7d8e9f0a1b2c

  • atstring (date-time)

    مثال:2026-11-17T08:34:10Z

  • kindstring

    أحد:openedrepeatedackedassignedcommentedclosedreopened

  • actorstring | null

    Who did it (user:<id>); null when the platform did.

    مثال:user:019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b

  • assigneestring | null

    مثال:019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b

  • resolutionstring | null
  • notestring | null

    مثال:null

  • occurrenceinteger | null

    مثال:null

الأخطاء

400401403404429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/alarms/019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b/comments" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Called the driver; he is pulling over."}'
مثال الاستجابة · 201
{
  "id": "019ac0c7-3d4e-7f5a-9b6c-7d8e9f0a1b2c",
  "at": "2026-11-17T08:34:10Z",
  "kind": "assigned",
  "actor": "user:019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b",
  "assignee": "019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b",
  "resolution": "actioned",
  "note": null,
  "occurrence": null
}

إعادة فتح تنبيه مغلق.

POST/v1/alarms/{alarmId}/reopen

Puts a closed alarm back to open, unassigned and unacknowledged; its activity keeps what happened before. Any other status answers 409.

النطاقrules:write

المعاملات

  • alarmIdstring المسار مطلوب

    مثال:019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b

الاستجابة 200

  • idstring

    مثال:019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b

  • rule_idstring | null

    The rule that opened the alarm; null once the rule is deleted.

    مثال:019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a

  • vehicle_idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • kindstring

    The template id of the rule that opened the alarm, or custom.

    مثال:overspeed

  • severitystring

    أحد:infowarningcritical

  • statusstring

    open, then acked (optional), then closed.

    أحد:openackedclosed

  • opened_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • last_seen_atstring (date-time)

    The latest occurrence: a repeat within the rule's minimum gap joins the open alarm.

    مثال:2026-11-17T08:41:00Z

  • occurrencesinteger

    مثال:2

  • assigneestring | null

    The account user the alarm is given to.

    مثال:019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b

  • acked_bystring | null

    Who acknowledged it: user:<id> or user:apikey/<key id>.

    مثال:user:apikey/k7Qm2Lp9Xa4R

  • acked_atstring | null (date-time)

    مثال:2026-11-17T08:34:10Z

  • closed_bystring | null

    Who closed it (system: when the platform closed it as the condition cleared).

    مثال:null

  • closed_atstring | null (date-time)

    مثال:null

  • resolutionstring | null

    How a person closed it; null until then, and when the platform closed it.

  • notestring | null

    The latest note given when acknowledging or closing.

    مثال:Driver called; speed back to limit.

  • positionobject | null

    Where the vehicle was when it opened.

  • limitnumber | null

    The limit a condition compared with.

    مثال:120

  • factsobject[]

    The facts that held when it opened.

    حقول facts
    • factstring

      A namespaced fact: position.* (the latest record; position.priority the highest record priority, 2 = panic), state.* (device state), signal.<key> (one measurement whichever model reports it: a device IO element is read as the signal it maps to in infra/devices/io/signals.toml), geofence.*, vehicle.*, alarm.*, rider.* (rider.onboard, rider.unknown_card) or cargo.* (cargo.warmest_c, cargo.coldest_c: the compartment's probes).

      مثال:position.speed_kmh

    • numbernumber

      مثال:134

    • textstring

      مثال:open

    • booleanboolean

      مثال:true

الأخطاء

400401403404409429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/alarms/019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b/reopen" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "id": "019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b",
  "rule_id": "019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a",
  "vehicle_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "kind": "overspeed",
  "severity": "warning",
  "status": "acked",
  "opened_at": "2026-11-17T08:30:00Z",
  "last_seen_at": "2026-11-17T08:41:00Z",
  "occurrences": 2,
  "assignee": "019ac0c2-4d9c-7e1f-9a0b-2c3d4e5f6a7b",
  "acked_by": "user:apikey/k7Qm2Lp9Xa4R",
  "acked_at": "2026-11-17T08:34:10Z",
  "closed_by": null,
  "closed_at": null,
  "resolution": "actioned",
  "note": "Driver called; speed back to limit.",
  "position": {
    "lat": 24.7136,
    "lon": 46.6753
  },
  "limit": 120,
  "facts": [
    {
      "fact": "position.speed_kmh",
      "number": 134,
      "text": "open",
      "boolean": true
    }
  ]
}

قائمة قواعد التنبيه.

GET/v1/rules

The account's alert rules, oldest first. A department-scoped key sees only the rules on its own vehicles.

النطاقrules:read

المعاملات

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

  • templatestring الاستعلام

    Only rules made from this template; custom for custom rules.

    مثال:overspeed

  • enabledboolean الاستعلام

    Only enabled (true) or disabled (false) rules.

  • geofence_idstring الاستعلام

    Only the rules scoped to this geofence.

    مثال:019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

الاستجابة 200

  • dataobject[]
    حقول data
    • idstring

      مثال:019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a

    • namestring | null

      مثال:Highway overspeed

    • templatestring | null

      The built-in template the rule is made from; null for a custom rule.

      مثال:overspeed

    • overridesobject | null

      A template rule's overrides; null for a custom rule.

    • definitionobject | null

      A custom rule's definition; null for a template rule.

    • scope_kindstring

      What the rule applies to: the whole account, a group (an accounts department and the departments under it, by the vehicle's department in fleet), one vehicle, or every vehicle in one geofence (its geofence.* facts are that geofence's).

      أحد:customergroupvehiclegeofence

    • scope_idstring | null

      The department (group), vehicle or geofence id; null for the whole account.

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • enabledboolean

      مثال:true

    • created_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

    • updated_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403429

مثال الطلب
curl "https://api.ping.nml.sa/v1/rules" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "id": "019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a",
      "name": "Highway overspeed",
      "template": "overspeed",
      "overrides": {
        "params": [
          {}
        ],
        "hold_s": 60,
        "min_gap_s": 900,
        "severity": "warning",
        "actions": [
          "alarm"
        ],
        "duty": "safety"
      },
      "definition": {
        "when": [
          {}
        ],
        "limit": [
          {}
        ],
        "schedule": {
          "mode": "outside",
          "hours": {}
        },
        "hold_s": 30,
        "min_gap_s": 600,
        "severity": "warning",
        "actions": [
          "alarm",
          "notify"
        ],
        "duty": "safety",
        "late": "notify"
      },
      "scope_kind": "vehicle",
      "scope_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "enabled": true,
      "created_at": "2026-11-17T08:30:00Z",
      "updated_at": "2026-11-17T08:30:00Z"
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

إنشاء قاعدة تنبيه.

POST/v1/rules

A rule from a built-in template with optional overrides (its parameters typed by the template's catalog), or a custom declarative definition, applied to the whole account, a department (group), one vehicle or one geofence. Give template or definition, not both. A department-scoped key creates rules only on its own vehicles.

النطاقrules:write يقبل Idempotency-Key

المعاملات

  • Idempotency-Keystring الترويسة

    A unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.

محتوى الطلب

  • namestring

    مثال:Highway overspeed

  • templatestring

    A built-in template id. Give template or definition.

    مثال:overspeed

  • overridesobject

    Changes to a template's defaults. Omitted fields keep the template's values.

    حقول overrides
    • paramsobject[]

      Values for the template's parameters, one per name.

      حقول params
      • namestring مطلوب

        مثال:limit_kmh

      • numbernumber

        مثال:100

      • hoursobject

        Days and hours in a time zone: from from_day to to_day (across the week's end when to_day comes first), from start to end each day (end 24:00 is midnight).

        حقول hours
        • from_daystring مطلوب

          أحد:sunmontuewedthufrisat

        • to_daystring مطلوب

          أحد:sunmontuewedthufrisat

        • startstring مطلوب

          مثال:07:00

        • endstring مطلوب

          مثال:18:00

        • time_zonestring مطلوب

          An IANA time zone.

          مثال:Asia/Riyadh

    • hold_sinteger

      Seconds the conditions must hold before the rule fires.

      مثال:60

    • min_gap_sinteger

      Minimum seconds between two firings on the same vehicle.

      مثال:900

    • severitystring

      أحد:infowarningcritical

    • actionsstring[]

      مثال:["alarm"]

    • dutystring

      notify goes to the account's users holding this duty (accounts users' duties); a template rule takes its template's unless overridden.

      أحد:dispatchworkshopfuelcold_chaincompliancesafety

  • definitionobject

    A custom rule: declarative, no scripting. It fires on the rising edge per vehicle once the conditions hold for hold_s, at most once per min_gap_s per vehicle.

    حقول definition
    • whenobject[] مطلوب
      حقول when
      • factstring مطلوب

        A namespaced fact: position.* (the latest record; position.priority the highest record priority, 2 = panic), state.* (device state), signal.<key> (one measurement whichever model reports it: a device IO element is read as the signal it maps to in infra/devices/io/signals.toml), geofence.*, vehicle.*, alarm.*, rider.* (rider.onboard, rider.unknown_card) or cargo.* (cargo.warmest_c, cargo.coldest_c: the compartment's probes).

        مثال:position.speed_kmh

      • opstring مطلوب

        changed: the value differs from the previous record. drop: the value fell by at least number within window_s.

        أحد:=!=>>=<<=changeddrop

      • numbernumber

        Compare with this number.

        مثال:100

      • textstring

        Compare with this text (= and != only).

        مثال:open

      • booleanboolean

        Compare with this boolean (= and != only).

        مثال:true

      • limitboolean

        Compare with the rule's limit.

        أحد:true

      • window_sinteger

        Seconds over which drop is measured; only for drop.

        مثال:900

    • limitobject[]

      The threshold a condition with limit true compares with: the first term that has a value. Required when a condition uses it.

      حقول limit
      • factstring

        مثال:vehicle.speed_limit_kmh

      • numbernumber

        مثال:100

      • paramstring

        مثال:limit_kmh

    • scheduleobject

      When a custom rule applies: inside or outside the hours, or (hours null) the account's operating calendar: its operating week and hours (accounts), Ramadan's hours and the Kingdom's holidays (closed).

      حقول schedule
      • modestring مطلوب

        أحد:insideoutside

      • hoursobject | null مطلوب
    • hold_sinteger مطلوب

      Seconds the conditions must hold before the rule fires.

      مثال:30

    • min_gap_sinteger مطلوب

      Minimum seconds between two firings on the same vehicle.

      مثال:600

    • severitystring مطلوب

      أحد:infowarningcritical

    • actionsstring[] مطلوب

      مثال:["alarm","notify"]

    • dutystring

      notify goes to the account's users holding this duty (accounts users' duties); a template rule takes its template's unless overridden.

      أحد:dispatchworkshopfuelcold_chaincompliancesafety

    • latestring

      Critical rules only: still notify on records that arrive late (buffered while out of coverage), marked delayed.

      أحد:notify

  • scope_kindstring مطلوب

    What the rule applies to: the whole account, a group (an accounts department and the departments under it, by the vehicle's department in fleet), one vehicle, or every vehicle in one geofence (its geofence.* facts are that geofence's).

    أحد:customergroupvehiclegeofence

  • scope_idstring

    The department (group), vehicle or geofence id; required for group, vehicle and geofence, omitted for customer.

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • enabledboolean

    مثال:true

الاستجابة 201

  • idstring

    مثال:019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a

  • namestring | null

    مثال:Highway overspeed

  • templatestring | null

    The built-in template the rule is made from; null for a custom rule.

    مثال:overspeed

  • overridesobject | null

    A template rule's overrides; null for a custom rule.

  • definitionobject | null

    A custom rule's definition; null for a template rule.

  • scope_kindstring

    What the rule applies to: the whole account, a group (an accounts department and the departments under it, by the vehicle's department in fleet), one vehicle, or every vehicle in one geofence (its geofence.* facts are that geofence's).

    أحد:customergroupvehiclegeofence

  • scope_idstring | null

    The department (group), vehicle or geofence id; null for the whole account.

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • enabledboolean

    مثال:true

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/rules" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Highway overspeed", "template": "overspeed", "scope_kind": "vehicle", "scope_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d", "enabled": true}'
مثال الاستجابة · 201
{
  "id": "019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a",
  "name": "Highway overspeed",
  "template": "overspeed",
  "overrides": {
    "params": [
      {
        "name": "limit_kmh",
        "number": 100,
        "hours": {
          "from_day": "sun",
          "to_day": "sun",
          "start": "07:00",
          "end": "18:00",
          "time_zone": "Asia/Riyadh"
        }
      }
    ],
    "hold_s": 60,
    "min_gap_s": 900,
    "severity": "warning",
    "actions": [
      "alarm"
    ],
    "duty": "safety"
  },
  "definition": {
    "when": [
      {
        "fact": "position.speed_kmh",
        "op": ">",
        "number": 100,
        "text": "open",
        "boolean": true,
        "limit": true,
        "window_s": 900
      }
    ],
    "limit": [
      {
        "fact": "vehicle.speed_limit_kmh",
        "number": 100,
        "param": "limit_kmh"
      }
    ],
    "schedule": {
      "mode": "outside",
      "hours": {
        "from_day": "sun",
        "to_day": "sun",
        "start": "07:00",
        "end": "18:00",
        "time_zone": "Asia/Riyadh"
      }
    },
    "hold_s": 30,
    "min_gap_s": 600,
    "severity": "warning",
    "actions": [
      "alarm",
      "notify"
    ],
    "duty": "safety",
    "late": "notify"
  },
  "scope_kind": "vehicle",
  "scope_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "enabled": true,
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z"
}

تعديل قاعدة تنبيه.

PATCH/v1/rules/{ruleId}

Changes the fields given and keeps the rest. overrides applies to template rules and definition to custom rules; each replaces the stored value whole. An empty name clears the name; scope_kind and scope_id change together.

النطاقrules:write

المعاملات

  • ruleIdstring المسار مطلوب

    مثال:019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a

محتوى الطلب

  • namestring

    An empty name clears it.

    مثال:Highway overspeed

  • overridesobject

    Changes to a template's defaults. Omitted fields keep the template's values.

    حقول overrides
    • paramsobject[]

      Values for the template's parameters, one per name.

      حقول params
      • namestring مطلوب

        مثال:limit_kmh

      • numbernumber

        مثال:100

      • hoursobject

        Days and hours in a time zone: from from_day to to_day (across the week's end when to_day comes first), from start to end each day (end 24:00 is midnight).

        حقول hours
        • from_daystring مطلوب

          أحد:sunmontuewedthufrisat

        • to_daystring مطلوب

          أحد:sunmontuewedthufrisat

        • startstring مطلوب

          مثال:07:00

        • endstring مطلوب

          مثال:18:00

        • time_zonestring مطلوب

          An IANA time zone.

          مثال:Asia/Riyadh

    • hold_sinteger

      Seconds the conditions must hold before the rule fires.

      مثال:60

    • min_gap_sinteger

      Minimum seconds between two firings on the same vehicle.

      مثال:900

    • severitystring

      أحد:infowarningcritical

    • actionsstring[]

      مثال:["alarm"]

    • dutystring

      notify goes to the account's users holding this duty (accounts users' duties); a template rule takes its template's unless overridden.

      أحد:dispatchworkshopfuelcold_chaincompliancesafety

  • definitionobject

    A custom rule: declarative, no scripting. It fires on the rising edge per vehicle once the conditions hold for hold_s, at most once per min_gap_s per vehicle.

    حقول definition
    • whenobject[] مطلوب
      حقول when
      • factstring مطلوب

        A namespaced fact: position.* (the latest record; position.priority the highest record priority, 2 = panic), state.* (device state), signal.<key> (one measurement whichever model reports it: a device IO element is read as the signal it maps to in infra/devices/io/signals.toml), geofence.*, vehicle.*, alarm.*, rider.* (rider.onboard, rider.unknown_card) or cargo.* (cargo.warmest_c, cargo.coldest_c: the compartment's probes).

        مثال:position.speed_kmh

      • opstring مطلوب

        changed: the value differs from the previous record. drop: the value fell by at least number within window_s.

        أحد:=!=>>=<<=changeddrop

      • numbernumber

        Compare with this number.

        مثال:100

      • textstring

        Compare with this text (= and != only).

        مثال:open

      • booleanboolean

        Compare with this boolean (= and != only).

        مثال:true

      • limitboolean

        Compare with the rule's limit.

        أحد:true

      • window_sinteger

        Seconds over which drop is measured; only for drop.

        مثال:900

    • limitobject[]

      The threshold a condition with limit true compares with: the first term that has a value. Required when a condition uses it.

      حقول limit
      • factstring

        مثال:vehicle.speed_limit_kmh

      • numbernumber

        مثال:100

      • paramstring

        مثال:limit_kmh

    • scheduleobject

      When a custom rule applies: inside or outside the hours, or (hours null) the account's operating calendar: its operating week and hours (accounts), Ramadan's hours and the Kingdom's holidays (closed).

      حقول schedule
      • modestring مطلوب

        أحد:insideoutside

      • hoursobject | null مطلوب
    • hold_sinteger مطلوب

      Seconds the conditions must hold before the rule fires.

      مثال:30

    • min_gap_sinteger مطلوب

      Minimum seconds between two firings on the same vehicle.

      مثال:600

    • severitystring مطلوب

      أحد:infowarningcritical

    • actionsstring[] مطلوب

      مثال:["alarm","notify"]

    • dutystring

      notify goes to the account's users holding this duty (accounts users' duties); a template rule takes its template's unless overridden.

      أحد:dispatchworkshopfuelcold_chaincompliancesafety

    • latestring

      Critical rules only: still notify on records that arrive late (buffered while out of coverage), marked delayed.

      أحد:notify

  • scope_kindstring

    What the rule applies to: the whole account, a group (an accounts department and the departments under it, by the vehicle's department in fleet), one vehicle, or every vehicle in one geofence (its geofence.* facts are that geofence's).

    أحد:customergroupvehiclegeofence

  • scope_idstring

    Give with scope_kind (omitted for customer).

    مثال:019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

  • enabledboolean

    مثال:false

الاستجابة 200

  • idstring

    مثال:019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a

  • namestring | null

    مثال:Highway overspeed

  • templatestring | null

    The built-in template the rule is made from; null for a custom rule.

    مثال:overspeed

  • overridesobject | null

    A template rule's overrides; null for a custom rule.

  • definitionobject | null

    A custom rule's definition; null for a template rule.

  • scope_kindstring

    What the rule applies to: the whole account, a group (an accounts department and the departments under it, by the vehicle's department in fleet), one vehicle, or every vehicle in one geofence (its geofence.* facts are that geofence's).

    أحد:customergroupvehiclegeofence

  • scope_idstring | null

    The department (group), vehicle or geofence id; null for the whole account.

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • enabledboolean

    مثال:true

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403404429

مثال الطلب
curl -X PATCH "https://api.ping.nml.sa/v1/rules/019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Highway overspeed", "scope_kind": "vehicle", "scope_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c", "enabled": false}'
مثال الاستجابة · 200
{
  "id": "019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a",
  "name": "Highway overspeed",
  "template": "overspeed",
  "overrides": {
    "params": [
      {
        "name": "limit_kmh",
        "number": 100,
        "hours": {
          "from_day": "sun",
          "to_day": "sun",
          "start": "07:00",
          "end": "18:00",
          "time_zone": "Asia/Riyadh"
        }
      }
    ],
    "hold_s": 60,
    "min_gap_s": 900,
    "severity": "warning",
    "actions": [
      "alarm"
    ],
    "duty": "safety"
  },
  "definition": {
    "when": [
      {
        "fact": "position.speed_kmh",
        "op": ">",
        "number": 100,
        "text": "open",
        "boolean": true,
        "limit": true,
        "window_s": 900
      }
    ],
    "limit": [
      {
        "fact": "vehicle.speed_limit_kmh",
        "number": 100,
        "param": "limit_kmh"
      }
    ],
    "schedule": {
      "mode": "outside",
      "hours": {
        "from_day": "sun",
        "to_day": "sun",
        "start": "07:00",
        "end": "18:00",
        "time_zone": "Asia/Riyadh"
      }
    },
    "hold_s": 30,
    "min_gap_s": 600,
    "severity": "warning",
    "actions": [
      "alarm",
      "notify"
    ],
    "duty": "safety",
    "late": "notify"
  },
  "scope_kind": "vehicle",
  "scope_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "enabled": true,
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z"
}

حذف قاعدة تنبيه.

DELETE/v1/rules/{ruleId}

The rule stops evaluating. Alarms it opened remain, with rule_id set to null.

النطاقrules:write

المعاملات

  • ruleIdstring المسار مطلوب

    مثال:019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a

الاستجابة 204

Deleted.

الأخطاء

400401403404429

مثال الطلب
curl -X DELETE "https://api.ping.nml.sa/v1/rules/019ac0c5-1b2c-7d3e-8f4a-5b6c7d8e9f0a" \
  -H "Authorization: Bearer $PING_API_KEY"