Create group
curl --request POST \
--url https://api.sidenet.ai/v1/groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "grp_84f20c19",
"name": "Acme — production",
"monthly_limit": 250
}
'import requests
url = "https://api.sidenet.ai/v1/groups"
payload = {
"id": "grp_84f20c19",
"name": "Acme — production",
"monthly_limit": 250
}
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({id: 'grp_84f20c19', name: 'Acme — production', monthly_limit: 250})
};
fetch('https://api.sidenet.ai/v1/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.sidenet.ai/v1/groups",
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([
'id' => 'grp_84f20c19',
'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"
payload := strings.NewReader("{\n \"id\": \"grp_84f20c19\",\n \"name\": \"Acme — production\",\n \"monthly_limit\": 250\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.sidenet.ai/v1/groups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"grp_84f20c19\",\n \"name\": \"Acme — production\",\n \"monthly_limit\": 250\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sidenet.ai/v1/groups")
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 \"id\": \"grp_84f20c19\",\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
Create group
Creates a group ahead of use, so its monthly spend cap is in place before the first user or session references it.
Creating explicitly is optional: minting a token or updating a user with an unseen group_id provisions the group automatically (with the default $5 cap). A later mint sending this id matches the group created here.
Requires your organization API key, from your backend.
POST
/
v1
/
groups
Create group
curl --request POST \
--url https://api.sidenet.ai/v1/groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "grp_84f20c19",
"name": "Acme — production",
"monthly_limit": 250
}
'import requests
url = "https://api.sidenet.ai/v1/groups"
payload = {
"id": "grp_84f20c19",
"name": "Acme — production",
"monthly_limit": 250
}
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({id: 'grp_84f20c19', name: 'Acme — production', monthly_limit: 250})
};
fetch('https://api.sidenet.ai/v1/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.sidenet.ai/v1/groups",
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([
'id' => 'grp_84f20c19',
'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"
payload := strings.NewReader("{\n \"id\": \"grp_84f20c19\",\n \"name\": \"Acme — production\",\n \"monthly_limit\": 250\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.sidenet.ai/v1/groups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"grp_84f20c19\",\n \"name\": \"Acme — production\",\n \"monthly_limit\": 250\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sidenet.ai/v1/groups")
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 \"id\": \"grp_84f20c19\",\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.
Body
application/json
Response
The created group
Show child attributes
Show child attributes