curl --request PATCH \
--url https://api.galtea.ai/userGroups/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Name",
"description": "A description",
"allProducts": false,
"permissionPreset": "READER",
"permissions": [
"analytics.read",
"metric.read",
"product.read"
]
}
'import requests
url = "https://api.galtea.ai/userGroups/{id}"
payload = {
"name": "Example Name",
"description": "A description",
"allProducts": False,
"permissionPreset": "READER",
"permissions": ["analytics.read", "metric.read", "product.read"]
}
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({
name: 'Example Name',
description: 'A description',
allProducts: false,
permissionPreset: 'READER',
permissions: ['analytics.read', 'metric.read', 'product.read']
})
};
fetch('https://api.galtea.ai/userGroups/{id}', 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.galtea.ai/userGroups/{id}",
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([
'name' => 'Example Name',
'description' => 'A description',
'allProducts' => false,
'permissionPreset' => 'READER',
'permissions' => [
'analytics.read',
'metric.read',
'product.read'
]
]),
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.galtea.ai/userGroups/{id}"
payload := strings.NewReader("{\n \"name\": \"Example Name\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissionPreset\": \"READER\",\n \"permissions\": [\n \"analytics.read\",\n \"metric.read\",\n \"product.read\"\n ]\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.galtea.ai/userGroups/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Example Name\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissionPreset\": \"READER\",\n \"permissions\": [\n \"analytics.read\",\n \"metric.read\",\n \"product.read\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/userGroups/{id}")
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 \"name\": \"Example Name\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissionPreset\": \"READER\",\n \"permissions\": [\n \"analytics.read\",\n \"metric.read\",\n \"product.read\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "ug_123",
"organizationId": "org_123",
"name": "QA Team",
"type": "EVALUATOR",
"description": "Quality assurance team",
"createdAt": "2023-11-07T05:31:56Z",
"userIds": [
"user_123"
],
"metricIds": [
"metric_123"
],
"productIds": [
"product_123"
],
"allProducts": false,
"permissionPreset": "READER",
"permissions": [
"analytics.read",
"metric.read",
"product.read"
],
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Update user group
Update an existing user group. Send only the fields you change: an absent field keeps its value, and a null permissions makes the group follow the EDITOR preset. Only an owner of the organization or an admin may change a group, its permission list included. See User Groups.
curl --request PATCH \
--url https://api.galtea.ai/userGroups/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Name",
"description": "A description",
"allProducts": false,
"permissionPreset": "READER",
"permissions": [
"analytics.read",
"metric.read",
"product.read"
]
}
'import requests
url = "https://api.galtea.ai/userGroups/{id}"
payload = {
"name": "Example Name",
"description": "A description",
"allProducts": False,
"permissionPreset": "READER",
"permissions": ["analytics.read", "metric.read", "product.read"]
}
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({
name: 'Example Name',
description: 'A description',
allProducts: false,
permissionPreset: 'READER',
permissions: ['analytics.read', 'metric.read', 'product.read']
})
};
fetch('https://api.galtea.ai/userGroups/{id}', 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.galtea.ai/userGroups/{id}",
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([
'name' => 'Example Name',
'description' => 'A description',
'allProducts' => false,
'permissionPreset' => 'READER',
'permissions' => [
'analytics.read',
'metric.read',
'product.read'
]
]),
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.galtea.ai/userGroups/{id}"
payload := strings.NewReader("{\n \"name\": \"Example Name\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissionPreset\": \"READER\",\n \"permissions\": [\n \"analytics.read\",\n \"metric.read\",\n \"product.read\"\n ]\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.galtea.ai/userGroups/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Example Name\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissionPreset\": \"READER\",\n \"permissions\": [\n \"analytics.read\",\n \"metric.read\",\n \"product.read\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/userGroups/{id}")
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 \"name\": \"Example Name\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissionPreset\": \"READER\",\n \"permissions\": [\n \"analytics.read\",\n \"metric.read\",\n \"product.read\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "ug_123",
"organizationId": "org_123",
"name": "QA Team",
"type": "EVALUATOR",
"description": "Quality assurance team",
"createdAt": "2023-11-07T05:31:56Z",
"userIds": [
"user_123"
],
"metricIds": [
"metric_123"
],
"productIds": [
"product_123"
],
"allProducts": false,
"permissionPreset": "READER",
"permissions": [
"analytics.read",
"metric.read",
"product.read"
],
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Authorizations
Headers
Body
The preset the group follows; when the preset changes, the group's permissions change with it. Null means the group holds its own list in permissions. Send a preset id with no permissions list to follow it, or null with a permissions list to hold that list. Omit both fields to keep the group's permissions.
EDITOR, HUMAN_EVALUATOR, READER, null "READER"
The permissions the group grants, each written entity.action, sorted. A product entry applies to the products the group reaches; a metric, model or comment entry applies across the organization. For a group that follows a preset, this is the preset's current list. Null means the group follows the EDITOR preset: it grants every permission its members role allows. An empty list grants nothing. A user in several groups may do a product action when any group that reaches the product lists it, and an organization action when any group lists it. The role of the user still limits what a list can grant. A list makes the group hold its own and cannot go with a permissionPreset id. Send null to follow EDITOR; omit the field to keep the group's permissions.
[
"analytics.read",
"metric.read",
"product.read"
]
Response
User group updated successfully. The body is the resource as its GET answers it.
The permissions the group grants, each written entity.action, sorted. A product entry applies to the products the group reaches; a metric, model or comment entry applies across the organization. For a group that follows a preset, this is the preset's current list. Null means the group follows the EDITOR preset: it grants every permission its members role allows. An empty list grants nothing. A user in several groups may do a product action when any group that reaches the product lists it, and an organization action when any group lists it. The role of the user still limits what a list can grant.
[
"analytics.read",
"metric.read",
"product.read"
]