curl --request PUT \
--url https://api.mnemom.ai/v1/agents/groups:batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"org_id": "<string>",
"ops": [
{
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "<string>"
}
]
}
'import requests
url = "https://api.mnemom.ai/v1/agents/groups:batch"
payload = {
"org_id": "<string>",
"ops": [
{
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
org_id: '<string>',
ops: [{group_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', agent_id: '<string>'}]
})
};
fetch('https://api.mnemom.ai/v1/agents/groups:batch', 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.mnemom.ai/v1/agents/groups:batch",
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([
'org_id' => '<string>',
'ops' => [
[
'group_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agent_id' => '<string>'
]
]
]),
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.mnemom.ai/v1/agents/groups:batch"
payload := strings.NewReader("{\n \"org_id\": \"<string>\",\n \"ops\": [\n {\n \"group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.mnemom.ai/v1/agents/groups:batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"org_id\": \"<string>\",\n \"ops\": [\n {\n \"group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mnemom.ai/v1/agents/groups:batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"org_id\": \"<string>\",\n \"ops\": [\n {\n \"group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"added": [
"<string>"
],
"removed": [
"<string>"
],
"added_count": 123,
"removed_count": 123,
"add_noop_count": 123,
"remove_noop_count": 123,
"ops_applied": 123,
"ops_received": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Apply an atomic add/remove membership batch
Apply a mixed set of add + remove operations across multiple agents and multiple groups in a single call, all-or-nothing.
curl --request PUT \
--url https://api.mnemom.ai/v1/agents/groups:batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"org_id": "<string>",
"ops": [
{
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "<string>"
}
]
}
'import requests
url = "https://api.mnemom.ai/v1/agents/groups:batch"
payload = {
"org_id": "<string>",
"ops": [
{
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
org_id: '<string>',
ops: [{group_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', agent_id: '<string>'}]
})
};
fetch('https://api.mnemom.ai/v1/agents/groups:batch', 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.mnemom.ai/v1/agents/groups:batch",
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([
'org_id' => '<string>',
'ops' => [
[
'group_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agent_id' => '<string>'
]
]
]),
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.mnemom.ai/v1/agents/groups:batch"
payload := strings.NewReader("{\n \"org_id\": \"<string>\",\n \"ops\": [\n {\n \"group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.mnemom.ai/v1/agents/groups:batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"org_id\": \"<string>\",\n \"ops\": [\n {\n \"group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mnemom.ai/v1/agents/groups:batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"org_id\": \"<string>\",\n \"ops\": [\n {\n \"group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"added": [
"<string>"
],
"removed": [
"<string>"
],
"added_count": 123,
"removed_count": 123,
"add_noop_count": 123,
"remove_noop_count": 123,
"ops_applied": 123,
"ops_received": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
Supabase JWT token in Authorization: Bearer header
Body
Response
Batch applied atomically. added/removed are the ids that actually CHANGED; the *_noop_count fields count operations that were already in the requested state; ops_applied (post-dedupe) may be less than ops_received (raw count) when duplicate operations were collapsed.
Agent ids that were newly added (real changes only)
Agent ids that were actually removed (real changes only)
Add ops whose agent was already a member (idempotent no-op)
Remove ops whose agent was already absent (idempotent no-op)
Distinct operations applied after dedupe
Raw operation count as submitted (before dedupe)