Mute alarm push notifications for one device
Stops alarm push notifications for a single device without affecting any other device. Use when a faulty or flapping sensor is flooding users — a sensor toggling every second generates a notification every second, and nothing else on the path limits that. Muted alarms are still recorded in the notification log with outcome "muted", so the device stays explainable. A reason is required. Re-muting updates the existing mute in place. Requires dual auth: X-Admin-API-Key + JWT.
curl -X PUT "https://api.spkey.co/admin/devices/example_string/notification-mute" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"reason": "example_string",
"expiresAt": "2024-12-25T10:00:00Z"
}'
import requests
import json
url = "https://api.spkey.co/admin/devices/example_string/notification-mute"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"reason": "example_string",
"expiresAt": "2024-12-25T10:00:00Z"
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.spkey.co/admin/devices/example_string/notification-mute", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"reason": "example_string",
"expiresAt": "2024-12-25T10:00:00Z"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"reason": "example_string",
"expiresAt": "2024-12-25T10:00:00Z"
}`)
req, err := http.NewRequest("PUT", "https://api.spkey.co/admin/devices/example_string/notification-mute", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN (JWT)")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.spkey.co/admin/devices/example_string/notification-mute')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN (JWT)'
request['X-API-Key'] = 'YOUR_API_KEY'
request.body = '{
"reason": "example_string",
"expiresAt": "2024-12-25T10:00:00Z"
}'
response = http.request(request)
puts response.body
{
"success": true,
"mute": {
"deviceId": "example_string",
"reason": "example_string",
"mutedBy": "example_string",
"expiresAt": "null",
"createdAt": "example_string",
"expired": true
}
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Internal Server Error",
"message": "An unexpected error occurred on the server",
"code": 500,
"requestId": "req_1234567890"
}
/admin/devices/{deviceId}/notification-muteTarget server for requests. Edit to use your own host.
JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.
API key for B2B organization access. Provided during organization onboarding.
MatterDevice UUID (= AWS IoT thingName) to mute or unmute.
The media type of the request body
Why this device is muted. REQUIRED — an unexplained mute becomes permanent, because nobody later knows whether lifting it is safe.
ISO-8601 instant after which the mute stops applying. Omit for an indefinite mute. Expiry is evaluated on read, so it cannot fail open.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token (JWT). JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.
API Key for authentication. API key for B2B organization access. Provided during organization onboarding.
Path Parameters
MatterDevice UUID (= AWS IoT thingName) to mute or unmute.
Body
Why this device is muted. REQUIRED — an unexplained mute becomes permanent, because nobody later knows whether lifting it is safe.
ISO-8601 instant after which the mute stops applying. Omit for an indefinite mute. Expiry is evaluated on read, so it cannot fail open.
Responses
true