Update snapshot assignment / global flag
curl --request PATCH \
--url https://your-instance.example.com/api/user-snapshots/{id}/assign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assignedOrgIds": [
"64ee9a8b1e7f2a0011223344",
"64ee9a8b1e7f2a0011223345"
],
"isGlobal": false
}
'import requests
url = "https://your-instance.example.com/api/user-snapshots/{id}/assign"
payload = {
"assignedOrgIds": ["64ee9a8b1e7f2a0011223344", "64ee9a8b1e7f2a0011223345"],
"isGlobal": False
}
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({
assignedOrgIds: ['64ee9a8b1e7f2a0011223344', '64ee9a8b1e7f2a0011223345'],
isGlobal: false
})
};
fetch('https://your-instance.example.com/api/user-snapshots/{id}/assign', 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://your-instance.example.com/api/user-snapshots/{id}/assign",
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([
'assignedOrgIds' => [
'64ee9a8b1e7f2a0011223344',
'64ee9a8b1e7f2a0011223345'
],
'isGlobal' => false
]),
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://your-instance.example.com/api/user-snapshots/{id}/assign"
payload := strings.NewReader("{\n \"assignedOrgIds\": [\n \"64ee9a8b1e7f2a0011223344\",\n \"64ee9a8b1e7f2a0011223345\"\n ],\n \"isGlobal\": false\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://your-instance.example.com/api/user-snapshots/{id}/assign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"assignedOrgIds\": [\n \"64ee9a8b1e7f2a0011223344\",\n \"64ee9a8b1e7f2a0011223345\"\n ],\n \"isGlobal\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/user-snapshots/{id}/assign")
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 \"assignedOrgIds\": [\n \"64ee9a8b1e7f2a0011223344\",\n \"64ee9a8b1e7f2a0011223345\"\n ],\n \"isGlobal\": false\n}"
response = http.request(request)
puts response.read_body{
"message": "Snapshot access updated",
"snapshot": {
"_id": "665f1a0c0e0a4b001a2c9f80",
"assignedOrgIds": [
"64ee9a8b1e7f2a0011223344"
],
"isGlobal": false
}
}{
"error": "Snapshot not found",
"message": "No snapshot exists with the given id"
}{
"error": "Snapshot not found",
"message": "No snapshot exists with the given id"
}{
"error": "Snapshot not found",
"message": "No snapshot exists with the given id"
}{
"error": "Snapshot not found",
"message": "No snapshot exists with the given id"
}User Snapshots
Update snapshot assignment / global flag
Updates which organizations a snapshot is assigned to and whether it is globally visible. Superadmins may set both assignedOrgIds and isGlobal; admins may only toggle isGlobal on snapshots they created.
PATCH
/
api
/
user-snapshots
/
{id}
/
assign
Update snapshot assignment / global flag
curl --request PATCH \
--url https://your-instance.example.com/api/user-snapshots/{id}/assign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assignedOrgIds": [
"64ee9a8b1e7f2a0011223344",
"64ee9a8b1e7f2a0011223345"
],
"isGlobal": false
}
'import requests
url = "https://your-instance.example.com/api/user-snapshots/{id}/assign"
payload = {
"assignedOrgIds": ["64ee9a8b1e7f2a0011223344", "64ee9a8b1e7f2a0011223345"],
"isGlobal": False
}
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({
assignedOrgIds: ['64ee9a8b1e7f2a0011223344', '64ee9a8b1e7f2a0011223345'],
isGlobal: false
})
};
fetch('https://your-instance.example.com/api/user-snapshots/{id}/assign', 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://your-instance.example.com/api/user-snapshots/{id}/assign",
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([
'assignedOrgIds' => [
'64ee9a8b1e7f2a0011223344',
'64ee9a8b1e7f2a0011223345'
],
'isGlobal' => false
]),
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://your-instance.example.com/api/user-snapshots/{id}/assign"
payload := strings.NewReader("{\n \"assignedOrgIds\": [\n \"64ee9a8b1e7f2a0011223344\",\n \"64ee9a8b1e7f2a0011223345\"\n ],\n \"isGlobal\": false\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://your-instance.example.com/api/user-snapshots/{id}/assign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"assignedOrgIds\": [\n \"64ee9a8b1e7f2a0011223344\",\n \"64ee9a8b1e7f2a0011223345\"\n ],\n \"isGlobal\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/user-snapshots/{id}/assign")
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 \"assignedOrgIds\": [\n \"64ee9a8b1e7f2a0011223344\",\n \"64ee9a8b1e7f2a0011223345\"\n ],\n \"isGlobal\": false\n}"
response = http.request(request)
puts response.read_body{
"message": "Snapshot access updated",
"snapshot": {
"_id": "665f1a0c0e0a4b001a2c9f80",
"assignedOrgIds": [
"64ee9a8b1e7f2a0011223344"
],
"isGlobal": false
}
}{
"error": "Snapshot not found",
"message": "No snapshot exists with the given id"
}{
"error": "Snapshot not found",
"message": "No snapshot exists with the given id"
}{
"error": "Snapshot not found",
"message": "No snapshot exists with the given id"
}{
"error": "Snapshot not found",
"message": "No snapshot exists with the given id"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
⌘I