Update an installation
curl --request PATCH \
--url https://pushctl.com/api/v1/installations/{installationId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "user-123"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user_id: 'user-123'})
};
fetch('https://pushctl.com/api/v1/installations/{installationId}', 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://pushctl.com/api/v1/installations/{installationId}",
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([
'user_id' => 'user-123'
]),
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;
}import requests
url = "https://pushctl.com/api/v1/installations/{installationId}"
payload = { "user_id": "user-123" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "<string>",
"installation_id": "<string>",
"device": {
"app_version": "<string>",
"os_version": "<string>",
"model": "<string>",
"locale": "<string>",
"timezone": "<string>"
},
"registered_at": "2023-11-07T05:31:56Z",
"last_seen_at": "2023-11-07T05:31:56Z",
"identifier_updated_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"permission_updated_at": "2023-11-07T05:31:56Z",
"invalidated_at": "2023-11-07T05:31:56Z",
"invalid_reason": "<string>"
}
}{
"message": "Unauthenticated."
}{
"message": "This action is unauthorized."
}{
"message": "Not Found"
}{
"message": "<string>",
"errors": {}
}Installations
Update an installation
Updates the user association or permission state for an existing installation.
PATCH
/
api
/
v1
/
installations
/
{installationId}
Update an installation
curl --request PATCH \
--url https://pushctl.com/api/v1/installations/{installationId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "user-123"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user_id: 'user-123'})
};
fetch('https://pushctl.com/api/v1/installations/{installationId}', 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://pushctl.com/api/v1/installations/{installationId}",
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([
'user_id' => 'user-123'
]),
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;
}import requests
url = "https://pushctl.com/api/v1/installations/{installationId}"
payload = { "user_id": "user-123" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "<string>",
"installation_id": "<string>",
"device": {
"app_version": "<string>",
"os_version": "<string>",
"model": "<string>",
"locale": "<string>",
"timezone": "<string>"
},
"registered_at": "2023-11-07T05:31:56Z",
"last_seen_at": "2023-11-07T05:31:56Z",
"identifier_updated_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"permission_updated_at": "2023-11-07T05:31:56Z",
"invalidated_at": "2023-11-07T05:31:56Z",
"invalid_reason": "<string>"
}
}{
"message": "Unauthenticated."
}{
"message": "This action is unauthorized."
}{
"message": "Not Found"
}{
"message": "<string>",
"errors": {}
}Authorizations
Use an application-scoped token with the ability required by the endpoint.
Path Parameters
Stable client-generated installation identifier. Maximum 255 characters.
Maximum string length:
255Body
application/json
Response
Installation updated.
Show child attributes
Show child attributes
Was this page helpful?
⌘I