> 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/register-push-device/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.finput.com.au/_mcp/server. # Register an install for push POST https://api.finput.com.au/api/v1/notifications/devices Content-Type: application/json Call on every launch and whenever the OS issues a new token. The call is idempotent, keyed by `token`: - A token the server has not seen creates a device — `201`. - A known token is refreshed in place — `200`, never a second device — and reactivated if a delivery had marked it dead. - A token registered to a different user moves to the caller. A token belongs to one install, so a second user presenting it has signed in on that install, and the first user stops receiving pushes there. Pushes carry a generic sentence and identifiers only (`kind`, `*_id`, plus `category`); fetch details from the API after the tap. The Android notification channel id and the iOS `thread-id` are the category key. Refused for API tokens (`403`, `token_auth_not_permitted`). Reference: https://docs.finput.com.au/api/endpoints/notifications/register-push-device ## 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 PushDeviceRegistration. - `token` (string, required) — The FCM registration token for this install. - `platform` (enum, required) - Allowed values: `ios`, `android` - `app_environment` (enum, required) — Which build registered. A development build's token is issued against APNs' sandbox and does not deliver from a production sender. - Allowed values: `development`, `production` - `timezone` (string, optional) — The phone's IANA timezone. Adopted for quiet hours unless the user has chosen a zone themselves. Send it on every registration so quiet hours follow a broker who travels. ## Response ### 200 A known token, refreshed. - `id` (integer, optional) - `platform` (enum, optional) - Allowed values: `ios`, `android` - `app_environment` (enum, optional) — Which build registered. A development build's token is issued against APNs' sandbox and does not deliver from a production sender. - Allowed values: `development`, `production` - `is_active` (boolean, optional) - `last_seen_at` (datetime, optional) - `created_at` (datetime, optional) ### 201 A new device. - `id` (integer, optional) - `platform` (enum, optional) - Allowed values: `ios`, `android` - `app_environment` (enum, optional) — Which build registered. A development build's token is issued against APNs' sandbox and does not deliver from a production sender. - Allowed values: `development`, `production` - `is_active` (boolean, optional) - `last_seen_at` (datetime, optional) - `created_at` (datetime, optional) ## Errors ### 400 Bad Request Error Validation error — unknown platform or app environment, an empty token, or a timezone that is not an IANA name. - `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) ## Examples ### Example 1 **Request** ```json { "token": "string", "platform": "ios", "app_environment": "development" } ``` **Response** ```json { "id": 1, "platform": "ios", "app_environment": "development", "is_active": true, "last_seen_at": "2024-01-15T09:30:00Z", "created_at": "2024-01-15T09:30:00Z" } ``` **SDK Code** ```python import requests url = "https://api.finput.com.au/api/v1/notifications/devices" payload = { "token": "string", "platform": "ios", "app_environment": "development" } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.finput.com.au/api/v1/notifications/devices'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"token":"string","platform":"ios","app_environment":"development"}' }; 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/devices" payload := strings.NewReader("{\n \"token\": \"string\",\n \"platform\": \"ios\",\n \"app_environment\": \"development\"\n}") req, _ := http.NewRequest("POST", 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/devices") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"token\": \"string\",\n \"platform\": \"ios\",\n \"app_environment\": \"development\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.finput.com.au/api/v1/notifications/devices") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"token\": \"string\",\n \"platform\": \"ios\",\n \"app_environment\": \"development\"\n}") .asString(); ``` ```php request('POST', 'https://api.finput.com.au/api/v1/notifications/devices', [ 'body' => '{ "token": "string", "platform": "ios", "app_environment": "development" }', '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/devices"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"token\": \"string\",\n \"platform\": \"ios\",\n \"app_environment\": \"development\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "token": "string", "platform": "ios", "app_environment": "development" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.finput.com.au/api/v1/notifications/devices")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" 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() ``` ### Example 2 **Request** ```json { "token": "string", "platform": "ios", "app_environment": "development" } ``` **Response** ```json { "id": 1, "platform": "ios", "app_environment": "development", "is_active": true, "last_seen_at": "2024-01-15T09:30:00Z", "created_at": "2024-01-15T09:30:00Z" } ``` **SDK Code** ```python import requests url = "https://api.finput.com.au/api/v1/notifications/devices" payload = { "token": "string", "platform": "ios", "app_environment": "development" } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.finput.com.au/api/v1/notifications/devices'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"token":"string","platform":"ios","app_environment":"development"}' }; 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/devices" payload := strings.NewReader("{\n \"token\": \"string\",\n \"platform\": \"ios\",\n \"app_environment\": \"development\"\n}") req, _ := http.NewRequest("POST", 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/devices") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"token\": \"string\",\n \"platform\": \"ios\",\n \"app_environment\": \"development\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.finput.com.au/api/v1/notifications/devices") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"token\": \"string\",\n \"platform\": \"ios\",\n \"app_environment\": \"development\"\n}") .asString(); ``` ```php request('POST', 'https://api.finput.com.au/api/v1/notifications/devices', [ 'body' => '{ "token": "string", "platform": "ios", "app_environment": "development" }', '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/devices"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"token\": \"string\",\n \"platform\": \"ios\",\n \"app_environment\": \"development\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "token": "string", "platform": "ios", "app_environment": "development" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.finput.com.au/api/v1/notifications/devices")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" 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() ```