Replace all usage groups in a set
curl --request PUT \
--url https://api.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
[
{
"name": "<string>",
"filter_expression": {
"filters": [
{
"field": {
"path": [
"<string>"
]
},
"value": 123,
"not": false
}
],
"component_type": "<string>"
},
"order": 1,
"budget": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
'import requests
url = "https://api.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups"
payload = [
{
"name": "<string>",
"filter_expression": {
"filters": [
{
"field": { "path": ["<string>"] },
"value": 123,
"not": False
}
],
"component_type": "<string>"
},
"order": 1,
"budget": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify([
{
name: '<string>',
filter_expression: {
filters: [{field: {path: ['<string>']}, value: 123, not: false}],
component_type: '<string>'
},
order: 1,
budget: 123,
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
])
};
fetch('https://api.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups', 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.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'name' => '<string>',
'filter_expression' => [
'filters' => [
[
'field' => [
'path' => [
'<string>'
]
],
'value' => 123,
'not' => false
]
],
'component_type' => '<string>'
],
'order' => 1,
'budget' => 123,
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$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.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups"
payload := strings.NewReader("[\n {\n \"name\": \"<string>\",\n \"filter_expression\": {\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"value\": 123,\n \"not\": false\n }\n ],\n \"component_type\": \"<string>\"\n },\n \"order\": 1,\n \"budget\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
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.put("https://api.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"name\": \"<string>\",\n \"filter_expression\": {\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"value\": 123,\n \"not\": false\n }\n ],\n \"component_type\": \"<string>\"\n },\n \"order\": 1,\n \"budget\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"name\": \"<string>\",\n \"filter_expression\": {\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"value\": 123,\n \"not\": false\n }\n ],\n \"component_type\": \"<string>\"\n },\n \"order\": 1,\n \"budget\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n]"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"order": 1,
"id": "<string>",
"etag": "<string>",
"version": 123,
"usage_groups": [
{
"id": "<string>",
"create_time": "<string>",
"update_time": "<string>",
"usage_group_set_id": "<string>",
"name": "<string>",
"order": 123,
"filter_expression": {
"filters": [
{
"field": {
"path": [
"<string>"
]
},
"value": 123,
"not": false
}
],
"component_type": "<string>"
},
"etag": "<string>",
"budget": 123
}
],
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"public": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Usage Groups
Replace all usage groups in a set
PUT
/
usage-group-sets
/
{usage_group_set_id}
/
usage-groups
Replace all usage groups in a set
curl --request PUT \
--url https://api.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
[
{
"name": "<string>",
"filter_expression": {
"filters": [
{
"field": {
"path": [
"<string>"
]
},
"value": 123,
"not": false
}
],
"component_type": "<string>"
},
"order": 1,
"budget": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
'import requests
url = "https://api.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups"
payload = [
{
"name": "<string>",
"filter_expression": {
"filters": [
{
"field": { "path": ["<string>"] },
"value": 123,
"not": False
}
],
"component_type": "<string>"
},
"order": 1,
"budget": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify([
{
name: '<string>',
filter_expression: {
filters: [{field: {path: ['<string>']}, value: 123, not: false}],
component_type: '<string>'
},
order: 1,
budget: 123,
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
])
};
fetch('https://api.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups', 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.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'name' => '<string>',
'filter_expression' => [
'filters' => [
[
'field' => [
'path' => [
'<string>'
]
],
'value' => 123,
'not' => false
]
],
'component_type' => '<string>'
],
'order' => 1,
'budget' => 123,
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$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.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups"
payload := strings.NewReader("[\n {\n \"name\": \"<string>\",\n \"filter_expression\": {\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"value\": 123,\n \"not\": false\n }\n ],\n \"component_type\": \"<string>\"\n },\n \"order\": 1,\n \"budget\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
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.put("https://api.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"name\": \"<string>\",\n \"filter_expression\": {\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"value\": 123,\n \"not\": false\n }\n ],\n \"component_type\": \"<string>\"\n },\n \"order\": 1,\n \"budget\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/usage-group-sets/{usage_group_set_id}/usage-groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"name\": \"<string>\",\n \"filter_expression\": {\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"value\": 123,\n \"not\": false\n }\n ],\n \"component_type\": \"<string>\"\n },\n \"order\": 1,\n \"budget\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n]"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"order": 1,
"id": "<string>",
"etag": "<string>",
"version": 123,
"usage_groups": [
{
"id": "<string>",
"create_time": "<string>",
"update_time": "<string>",
"usage_group_set_id": "<string>",
"name": "<string>",
"order": 123,
"filter_expression": {
"filters": [
{
"field": {
"path": [
"<string>"
]
},
"value": 123,
"not": false
}
],
"component_type": "<string>"
},
"etag": "<string>",
"budget": 123
}
],
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"public": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Organization API key (sl_…).
Headers
The organization ID the request is scoped to.
Path Parameters
Body
application/json
filter_expression
FilterExpression[Union[SemiStructuredDimension[SelectOrganizationUsageGroupDimensions], SelectOrganizationUsageGroupDimensions]] · object
required
Show child attributes
Show child attributes
Required range:
x >= 0Existing usage group id to keep across the replace. Omit it (or pass an id that is not in this set) to create a new usage group.
Response
Successful Response
Name of the usage group set. Must be less than 200 characters.
Maximum string length:
199Display order; lower values appear first.
Required range:
x >= 0The unique identifier of the usage group set.
Opaque strong ETag for optimistic concurrency.
Number of committed versions (snapshots). Increment it by one in a PATCH to snapshot the current groups as a new version; ordinary group edits mutate the current version in place and leave it unchanged.
Show child attributes
Show child attributes
Whether the set is visible to all org members for filtering.
⌘I

