Update group
curl --request PATCH \
--url https://api.sidenet.ai/v1/groups/{groupId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme — production",
"monthly_limit": 250
}
'import requests
url = "https://api.sidenet.ai/v1/groups/{groupId}"
payload = {
"name": "Acme — production",
"monthly_limit": 250
}
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: 'Acme — production', monthly_limit: 250})
};
fetch('https://api.sidenet.ai/v1/groups/{groupId}', 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.sidenet.ai/v1/groups/{groupId}",
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' => 'Acme — production',
'monthly_limit' => 250
]),
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.sidenet.ai/v1/groups/{groupId}"
payload := strings.NewReader("{\n \"name\": \"Acme — production\",\n \"monthly_limit\": 250\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.sidenet.ai/v1/groups/{groupId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme — production\",\n \"monthly_limit\": 250\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sidenet.ai/v1/groups/{groupId}")
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\": \"Acme — production\",\n \"monthly_limit\": 250\n}"
response = http.request(request)
puts response.read_body{
"group": {
"id": "<string>",
"name": "<string>",
"monthly_limit": 123,
"month_spend": 123,
"limit_remaining": 123
}
}Users & Groups
Update group
Updates a group: its display name and/or its monthly spend cap.
The cap is enforced per calendar month against the group’s attributed spend; when it is reached, requests billing to the group are rejected until the month rolls over or the cap is raised. null removes the cap. Changes take effect on the next request (checks are cached for a few seconds).
Requires your organization API key, from your backend.
PATCH
/
v1
/
groups
/
{groupId}
Update group
curl --request PATCH \
--url https://api.sidenet.ai/v1/groups/{groupId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme — production",
"monthly_limit": 250
}
'import requests
url = "https://api.sidenet.ai/v1/groups/{groupId}"
payload = {
"name": "Acme — production",
"monthly_limit": 250
}
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: 'Acme — production', monthly_limit: 250})
};
fetch('https://api.sidenet.ai/v1/groups/{groupId}', 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.sidenet.ai/v1/groups/{groupId}",
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' => 'Acme — production',
'monthly_limit' => 250
]),
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.sidenet.ai/v1/groups/{groupId}"
payload := strings.NewReader("{\n \"name\": \"Acme — production\",\n \"monthly_limit\": 250\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.sidenet.ai/v1/groups/{groupId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme — production\",\n \"monthly_limit\": 250\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sidenet.ai/v1/groups/{groupId}")
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\": \"Acme — production\",\n \"monthly_limit\": 250\n}"
response = http.request(request)
puts response.read_body{
"group": {
"id": "<string>",
"name": "<string>",
"monthly_limit": 123,
"month_spend": 123,
"limit_remaining": 123
}
}Authorizations
Organization API key, generated in studio.sidenet.ai. Backend only — never in a browser.
Path Parameters
Your id for the group (the group_id sent when minting or updating a user).
Example:
"grp_84f20c19"
Body
application/json
Response
The updated group
Show child attributes
Show child attributes