Loading...

PUT /api/alerts/{deviceId}

Each tracker has its own list of alerts and reminders. Use this operation to set the complete configuration for a vehicle. For example, when adjusting its speed alert, you may also need to keep the zone alerts its supervisor still uses.

Read the current rules with GET /api/alerts/{deviceId}, edit the ones that need to change, and submit every rule that should remain active. Plaspy replaces the previous list with the one you send. Use the response to check the saved configuration.

Request Details

PUT /api/alerts/{deviceId}

Request Parameters

Send the complete set of rules as a JSON array.

Path parameters

ParameterTypeRequiredDescription
deviceIdStringRequiredStringYesTracker identifier in the path. Use the id from the device list.

Fields in each rule

ParameterTypeRequiredDescription
typeStringRequiredStringYesRule type from the alert catalog.
nameStringRequiredStringYesName identifying the rule on the device.
dParameterStringConditionalStringConditionalParameter for the alert type. For a zone rule, use the public zon-… ID from the zones list.
sParameterStringConditionalStringConditionalAdditional text parameter when listed by the catalog for the type.
pushNotificationBooleanOptionalBooleanNoSet to true to enable push notifications.
notifyEmailBooleanOptionalBooleanNoEnable email notifications. Supply recipients in email.
smsBooleanOptionalBooleanNoEnable SMS. Supply recipients in phoneNumber.
whatsAppNotificationBooleanOptionalBooleanNoEnable WhatsApp. Supply recipients in whatsAppNumbers.
emailStringConditionalStringConditionalRecipient address or list when notifyEmail is enabled.
phoneNumberStringConditionalStringConditionalNumber or list of numbers for SMS notifications.
whatsAppNumbersStringConditionalStringConditionalNumber or list of numbers for WhatsApp notifications.
telegramNotificationBooleanOptionalBooleanNoEnable Telegram notifications.

The body is a JSON array. Copy the entries from alerts that you want to retain. An omitted rule is removed. The example sends [] to deliberately clear all alerts and reminders.

Adding SMS or WhatsApp notifications to a new number requires the corresponding channel privilege. Adding a command requires permission to send commands, plus permission to send SMS commands if it uses SMS. When replacing the list, you can retain destinations and commands already configured for that alert type.

Authentication Required

You need access to the map and the edit privilege. Demo users have read-only access.

Send a valid bearer token in the authorization header. See Authentication.

Example Request

PUT /api/alerts/123456789012345 HTTP/1.1 Host: api.plaspy.com Authorization: Bearer {token} Content-Type: application/json

Example Request Body

[]

Response Parameters

The response contains success: true, the deviceId, and alerts with the configuration as saved. In the example the list is empty.

FieldTypePresenceDescription
deviceIdStringAlwaysStringAlwaysIdentifier of the tracker for this operation.
alertsObject arrayAlwaysObject arrayAlwaysAlert and reminder rules configured on the tracker.
successBooleanAlwaysBooleanAlwaysIn a successful response, true confirms the operation.
apiUsageIntegerAlwaysIntegerAlwaysUnits charged for this request.
apiDailyUsageIntegerAlwaysIntegerAlwaysDaily usage before the units for this request are added.

Main fields in each rule

FieldTypePresenceDescription
idIntegerAlwaysIntegerAlwaysZero-based position of the rule in the device’s list.
typeStringAlwaysStringAlwaysNumeric rule type code returned as a string.
nameStringWhen setStringWhen setName identifying the rule.
dParameterStringWhen setStringWhen setValue of the numeric parameter. For a zone rule this is the public zon-… ID.
sParameterStringWhen setStringWhen setText parameter value, when applicable.
pushNotificationBooleanAlwaysBooleanAlwaysIndicates whether push notifications are enabled.
notifyEmailBooleanAlwaysBooleanAlwaysIndicates whether email notifications are sent to the recipients in email.
smsBooleanAlwaysBooleanAlwaysIndicates whether SMS notifications are sent to the numbers in phoneNumber.
whatsAppNotificationBooleanAlwaysBooleanAlwaysIndicates whether WhatsApp notifications are sent to the numbers in whatsAppNumbers.

Example HTTP 200 response

{ "success": true, "apiUsage": 1, "apiDailyUsage": 24, "deviceId": "123456789012345", "alerts": [] }

Errors

FieldTypePresenceDescription
successBooleanDepends on the errorBooleanDepends on the errorIn the operation errors shown here, the value is false.
errorStringDepends on the errorStringDepends on the errorMessage explaining why the request was rejected.
errorsObjectIn field validation errorsObjectIn field validation errorsIn a validation response, maps fields to their messages. The response shape depends on the error.

HTTP 400 if the device is not visible or a rule cannot be saved. Validation errors identify the affected item and field in errors. HTTP 403 if edit access or a privilege required for newly added notifications or commands is missing.

Example error

{ "success": false, "error": "One of the devices was not found in the account." }
Index
Questions?

We answer all support request within 24 business hours approximately, If you have a question that needs an immediate resolution, please contact us by other way.

We answer you in business hours, as soon as possible. We are located in Bogotá, Colombia, time zone (GMT-5).

Last modification: 2026-11-30 11:00:47