curl --request PATCH \
--url https://api.anhome.tuanle.dev/api/v1/tenant/notification-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email_enabled": true,
"push_enabled": true,
"invoice_updates": true,
"maintenance_updates": true,
"message_updates": true
}
'import requests
url = "https://api.anhome.tuanle.dev/api/v1/tenant/notification-preferences"
payload = {
"email_enabled": True,
"push_enabled": True,
"invoice_updates": True,
"maintenance_updates": True,
"message_updates": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email_enabled: true,
push_enabled: true,
invoice_updates: true,
maintenance_updates: true,
message_updates: true
})
};
fetch('https://api.anhome.tuanle.dev/api/v1/tenant/notification-preferences', 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.anhome.tuanle.dev/api/v1/tenant/notification-preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'email_enabled' => true,
'push_enabled' => true,
'invoice_updates' => true,
'maintenance_updates' => true,
'message_updates' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.anhome.tuanle.dev/api/v1/tenant/notification-preferences"
payload := strings.NewReader("{\n \"email_enabled\": true,\n \"push_enabled\": true,\n \"invoice_updates\": true,\n \"maintenance_updates\": true,\n \"message_updates\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.anhome.tuanle.dev/api/v1/tenant/notification-preferences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email_enabled\": true,\n \"push_enabled\": true,\n \"invoice_updates\": true,\n \"maintenance_updates\": true,\n \"message_updates\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anhome.tuanle.dev/api/v1/tenant/notification-preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email_enabled\": true,\n \"push_enabled\": true,\n \"invoice_updates\": true,\n \"maintenance_updates\": true,\n \"message_updates\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"email_enabled": true,
"push_enabled": true,
"invoice_updates": true,
"maintenance_updates": true,
"message_updates": true,
"updated_at": "2023-11-07T05:31:56Z"
},
"request_id": "<string>",
"meta": {}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}Update tenant notification preferences
Implements a real Phase 5 tenant/renter API route with persisted data access and tenant/organization scoping.
curl --request PATCH \
--url https://api.anhome.tuanle.dev/api/v1/tenant/notification-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email_enabled": true,
"push_enabled": true,
"invoice_updates": true,
"maintenance_updates": true,
"message_updates": true
}
'import requests
url = "https://api.anhome.tuanle.dev/api/v1/tenant/notification-preferences"
payload = {
"email_enabled": True,
"push_enabled": True,
"invoice_updates": True,
"maintenance_updates": True,
"message_updates": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email_enabled: true,
push_enabled: true,
invoice_updates: true,
maintenance_updates: true,
message_updates: true
})
};
fetch('https://api.anhome.tuanle.dev/api/v1/tenant/notification-preferences', 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.anhome.tuanle.dev/api/v1/tenant/notification-preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'email_enabled' => true,
'push_enabled' => true,
'invoice_updates' => true,
'maintenance_updates' => true,
'message_updates' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.anhome.tuanle.dev/api/v1/tenant/notification-preferences"
payload := strings.NewReader("{\n \"email_enabled\": true,\n \"push_enabled\": true,\n \"invoice_updates\": true,\n \"maintenance_updates\": true,\n \"message_updates\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.anhome.tuanle.dev/api/v1/tenant/notification-preferences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email_enabled\": true,\n \"push_enabled\": true,\n \"invoice_updates\": true,\n \"maintenance_updates\": true,\n \"message_updates\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anhome.tuanle.dev/api/v1/tenant/notification-preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email_enabled\": true,\n \"push_enabled\": true,\n \"invoice_updates\": true,\n \"maintenance_updates\": true,\n \"message_updates\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"email_enabled": true,
"push_enabled": true,
"invoice_updates": true,
"maintenance_updates": true,
"message_updates": true,
"updated_at": "2023-11-07T05:31:56Z"
},
"request_id": "<string>",
"meta": {}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
JSON request payload for tenant_update_notification_preferences.
Request payload for tenant update notification preferences.
email enabled value for tenant update notification preferences request.
push enabled value for tenant update notification preferences request.
invoice updates value for tenant update notification preferences request.
maintenance updates value for tenant update notification preferences request.
message updates value for tenant update notification preferences request.
Response
Tenant API operation succeeded
Endpoint-specific response payload. See the referenced schema for the resource fields.
Show child attributes
Show child attributes
Request correlation identifier returned from X-Request-Id or generated by the API.
Optional response metadata such as pagination limits, counts, or export context.