> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.finput.com.au/api/endpoints/notifications/update-notification-preferences/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.finput.com.au/_mcp/server. # Update the caller's notification preferences PATCH https://api.finput.com.au/api/v1/notifications/preferences Content-Type: application/json Reference: https://docs.finput.com.au/api/endpoints/notifications/update-notification-preferences ## Authentication - `Authorization` header (bearer token, required) — JWT access token obtained from `POST /api/v1/auth/login`, or a `finput_sk_...` API token ## Request ### Body (application/json) This endpoint expects a NotificationPreferencesUpdate. - `categories` (map from string to boolean, optional) - `quiet_hours_enabled` (boolean, optional, nullable) - `quiet_hours_start` (string, optional, nullable) - `quiet_hours_end` (string, optional, nullable) - `timezone` (string, optional, nullable) — Sets a user-chosen zone, or the device's when sent with `follow_device: true`. `""` clears it and hands the choice back to device reports, and is refused while quiet hours depend on it. `null` leaves it unchanged. - `follow_device` (boolean, optional, nullable) — `true` stores `timezone` as the device's zone (`timezone_source: device`) rather than a user choice, so later registrations keep it current. Needs a non-empty `timezone`, and works while quiet hours are on. `false` or `null` is the same as leaving it out. ## Response ### 200 The preferences after the update. - `categories` (map from string to boolean, optional) — Every category, keyed by `NotificationCategory`, with its effective setting — the user's choice, or the default. - `quiet_hours_enabled` (boolean, optional) - `quiet_hours_start` (string, optional, nullable) — Local time in `timezone`, 24-hour `HH:MM`. - `quiet_hours_end` (string, optional, nullable) — Local time in `timezone`. Earlier than the start means the window wraps midnight. - `timezone` (string, optional) — IANA zone quiet hours are evaluated in. Empty until a device reports one or the user chooses one. - `timezone_source` (enum, optional) — `device` — the latest zone a registered install reported. `user` — chosen explicitly; device reports never overwrite it. Empty when no zone is known. - Allowed values: ``, `device`, `user` - `updated_at` (datetime, optional, nullable) - `available_categories` (list of NotificationCategoryDescription, optional) ## Errors ### 400 Bad Request Error An unknown category, a malformed time, an unrecognised timezone, or quiet hours without a complete window and a timezone. - `error` (string, optional) - `errors` (map from string to list of string, optional) ### 401 Unauthorized Error Not authenticated. - `error` (string, optional) - `errors` (map from string to list of string, optional) ### 403 Forbidden Error Called with an API token. - `error` (string, optional) - `errors` (map from string to list of string, optional) ## Types ### NotificationCategoryDescription - `key` (enum, optional) — The closed set of things Finput pushes about. There is no billing, plan, trial or marketing category, and there will not be one. Read `available_categories` for labels rather than hardcoding them, and ignore a key you do not recognise. - Allowed values: `issue_reports`, `rate_card`, `account` - `label` (string, optional) - `description` (string, optional) - `default_enabled` (boolean, optional) ## Examples **Request** ```json {} ``` **Response** ```json { "categories": { "account": true, "issue_reports": true, "rate_card": false }, "quiet_hours_enabled": true, "quiet_hours_start": "22:00", "quiet_hours_end": "07:00", "timezone": "Australia/Sydney", "timezone_source": "", "updated_at": "2024-01-15T09:30:00Z", "available_categories": [ { "key": "issue_reports", "label": "Issue reports", "description": "string", "default_enabled": true } ] } ``` **SDK Code** ```python import requests url = "https://api.finput.com.au/api/v1/notifications/preferences" payload = {} headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.finput.com.au/api/v1/notifications/preferences'; const options = { method: 'PATCH', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.finput.com.au/api/v1/notifications/preferences" payload := strings.NewReader("{}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.finput.com.au/api/v1/notifications/preferences") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.finput.com.au/api/v1/notifications/preferences") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('PATCH', 'https://api.finput.com.au/api/v1/notifications/preferences', [ 'body' => '{}', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.finput.com.au/api/v1/notifications/preferences"); var request = new RestRequest(Method.PATCH); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.finput.com.au/api/v1/notifications/preferences")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```