PATCH
/
api
/
v1
/
me
/
notifications
Toggle notification mute
curl --request PATCH \
  --url https://api.example.com/api/v1/me/notifications
import requests

url = "https://api.example.com/api/v1/me/notifications"

response = requests.patch(url)

print(response.text)
const options = {method: 'PATCH'};

fetch('https://api.example.com/api/v1/me/notifications', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/me/notifications",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/api/v1/me/notifications"

req, _ := http.NewRequest("PATCH", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.example.com/api/v1/me/notifications")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/v1/me/notifications")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body

Overview

Sets the user’s notificationsMuted boolean. The push-delivery worker consults this flag on every job and skips the send entirely when it’s true — except for jobs with kind: 'critical' (account banned, security alerts, etc.), which bypass the mute. See Push notification fan-out — Mute semantics for the precedence rules.
This is a global mute, not per-conversation. Per-conversation mutes are deferred to a later phase; the data model already has the user-side flag but no UI granularity exists today.

Authentication

Bearer <accessToken> required. requireAuth + requireOnboarded middleware applied.

Path parameters

None.

Query parameters

None.

Request body

FieldTypeRequiredNotesExample
notificationsMutedbooleanyestrue to suppress all non-critical push for this user. false to resume normal delivery.true

Example payload

{ "notificationsMuted": true }

Response — 200 OK

FieldTypeNotesExample
successbooleanAlways true.true
notificationsMutedbooleanEchoes the value just set, so the client can update local state without a re-read.true
{ "success": true, "notificationsMuted": true }

What the mute affects

Push kindWhen notificationsMuted: true
message.newSkipped by the worker.
match.newSkipped.
tenancy.approvedSkipped.
criticalDelivered — bypasses the mute. Reserved for security / account-state events that the user MUST see (account banned, password reset confirmation, etc.). Phase 7.
The mute is enforced at the worker layer, not the producer layer. Producers (chat / match / tenancy services) still enqueue the jobs unconditionally — this keeps the producers cheap and lets a future “show in-app inbox even while muted” feature share the same pipeline.

Side effects

  • Sets the user’s notificationsMuted field to the new value.
  • Does NOT cancel already-enqueued push jobs. A burst of messages delivered to BullMQ just before the user mutes may still result in 1–2 already-claimed jobs running, but they’ll be dropped at the worker’s mute check.

Error responses

StatusCodeMeaning
400VALIDATION_FAILEDnotificationsMuted missing or not a boolean.
401UNAUTHENTICATEDMissing, malformed, or expired access token.
403ONBOARDING_INCOMPLETECaller has not finished onboarding.

Example error — 400 VALIDATION_FAILED

{
  "type": "https://api.swappr.co.uk/errors/validation-failed",
  "title": "Validation failed",
  "status": 400,
  "code": "VALIDATION_FAILED",
  "detail": "Request body failed validation",
  "instance": "/api/v1/me/notifications",
  "requestId": "01HZQ7K3M4N5P6Q7R8S9T0V1W2",
  "errors": [
    { "path": "notificationsMuted", "message": "Invalid input: expected boolean", "code": "invalid_type" }
  ]
}

See also

curl

curl -X PATCH https://api.swappr.co.uk/api/v1/me/notifications \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "notificationsMuted": true }'