curl --request POST \
--url https://api.galtea.ai/userGroups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Name",
"organizationId": "org_123",
"type": "EVALUATOR",
"description": "A description",
"allProducts": false,
"permissionPreset": "READER",
"permissions": [
"analytics.read",
"metric.read",
"product.read"
],
"productIds": [
"product_123"
]
}
'import requests
url = "https://api.galtea.ai/userGroups"
payload = {
"name": "Example Name",
"organizationId": "org_123",
"type": "EVALUATOR",
"description": "A description",
"allProducts": False,
"permissionPreset": "READER",
"permissions": ["analytics.read", "metric.read", "product.read"],
"productIds": ["product_123"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Example Name',
organizationId: 'org_123',
type: 'EVALUATOR',
description: 'A description',
allProducts: false,
permissionPreset: 'READER',
permissions: ['analytics.read', 'metric.read', 'product.read'],
productIds: ['product_123']
})
};
fetch('https://api.galtea.ai/userGroups', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Example Name',
'organizationId' => 'org_123',
'type' => 'EVALUATOR',
'description' => 'A description',
'allProducts' => false,
'permissionPreset' => 'READER',
'permissions' => [
'analytics.read',
'metric.read',
'product.read'
],
'productIds' => [
'product_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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.galtea.ai/userGroups"
payload := strings.NewReader("{\n \"name\": \"Example Name\",\n \"organizationId\": \"org_123\",\n \"type\": \"EVALUATOR\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissionPreset\": \"READER\",\n \"permissions\": [\n \"analytics.read\",\n \"metric.read\",\n \"product.read\"\n ],\n \"productIds\": [\n \"product_123\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.galtea.ai/userGroups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Example Name\",\n \"organizationId\": \"org_123\",\n \"type\": \"EVALUATOR\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissionPreset\": \"READER\",\n \"permissions\": [\n \"analytics.read\",\n \"metric.read\",\n \"product.read\"\n ],\n \"productIds\": [\n \"product_123\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/userGroups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Example Name\",\n \"organizationId\": \"org_123\",\n \"type\": \"EVALUATOR\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissionPreset\": \"READER\",\n \"permissions\": [\n \"analytics.read\",\n \"metric.read\",\n \"product.read\"\n ],\n \"productIds\": [\n \"product_123\"\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"
}Create user group
Create a new user group. Send permissionPreset to make it follow a preset, or permissions to store its own list, and productIds to link products to it: the group, its list and its product links are written together, or none of them. See User Groups.
curl --request POST \
--url https://api.galtea.ai/userGroups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Name",
"organizationId": "org_123",
"type": "EVALUATOR",
"description": "A description",
"allProducts": false,
"permissionPreset": "READER",
"permissions": [
"analytics.read",
"metric.read",
"product.read"
],
"productIds": [
"product_123"
]
}
'import requests
url = "https://api.galtea.ai/userGroups"
payload = {
"name": "Example Name",
"organizationId": "org_123",
"type": "EVALUATOR",
"description": "A description",
"allProducts": False,
"permissionPreset": "READER",
"permissions": ["analytics.read", "metric.read", "product.read"],
"productIds": ["product_123"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Example Name',
organizationId: 'org_123',
type: 'EVALUATOR',
description: 'A description',
allProducts: false,
permissionPreset: 'READER',
permissions: ['analytics.read', 'metric.read', 'product.read'],
productIds: ['product_123']
})
};
fetch('https://api.galtea.ai/userGroups', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Example Name',
'organizationId' => 'org_123',
'type' => 'EVALUATOR',
'description' => 'A description',
'allProducts' => false,
'permissionPreset' => 'READER',
'permissions' => [
'analytics.read',
'metric.read',
'product.read'
],
'productIds' => [
'product_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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.galtea.ai/userGroups"
payload := strings.NewReader("{\n \"name\": \"Example Name\",\n \"organizationId\": \"org_123\",\n \"type\": \"EVALUATOR\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissionPreset\": \"READER\",\n \"permissions\": [\n \"analytics.read\",\n \"metric.read\",\n \"product.read\"\n ],\n \"productIds\": [\n \"product_123\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.galtea.ai/userGroups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Example Name\",\n \"organizationId\": \"org_123\",\n \"type\": \"EVALUATOR\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissionPreset\": \"READER\",\n \"permissions\": [\n \"analytics.read\",\n \"metric.read\",\n \"product.read\"\n ],\n \"productIds\": [\n \"product_123\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/userGroups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Example Name\",\n \"organizationId\": \"org_123\",\n \"type\": \"EVALUATOR\",\n \"description\": \"A description\",\n \"allProducts\": false,\n \"permissionPreset\": \"READER\",\n \"permissions\": [\n \"analytics.read\",\n \"metric.read\",\n \"product.read\"\n ],\n \"productIds\": [\n \"product_123\"\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, or null with one. With neither field, the group follows EDITOR.
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. Takes the same list as PATCH /userGroups/{id}. A list makes the group hold its own and cannot go with a permissionPreset id. Omit the field or send null to follow EDITOR.
[
"analytics.read",
"metric.read",
"product.read"
]
Response
User group created successfully. On Prefer: return=minimal, or when the read after the write fails, the answer has no body.
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"
]