Change a reader group; what's left out stays. Then it's whichever of your users match its conditions, and the tabs, collections and articles for it follow.
Needs a read + write key.
Tuti APIUsers
Change a reader group; what's left out stays. Then it's whichever of your users match its conditions, and the tabs, collections and articles for it follow.
Needs a read + write key.
/groups/{group}Authorization Bearer token
groupstring · 1–50 characters, matches ^[a-z0-9][a-z0-9_.:-]*$requiredThe group's key, which stays
application/json · object · required
namestring · 1–50 charactersIts name
descriptionstring · at most 300 charactersWhat it's for, for the team
conditionsarray of object · 1–10 itemsAll of its conditions, at least one, in place of those it has (see groups.create)
Option 1objectpropertystring · 1–64 charactersrequiredThe user property it looks at, by name
opstringrequiredWhether the property is, is_not, contains or excludes a text
One of"is""is_not""contains""excludes"
valuestring · 1–200 charactersrequiredThe text it compares with
Option 2objectpropertystring · 1–64 charactersrequiredThe user property it looks at, by name
opstringrequiredWhether the property is_any_of or is_none_of a list
One of"is_any_of""is_none_of"
valuearray of string · 1–50 itemsrequiredThe texts it compares with, up to 50
Each item: 1–200 characters
Option 3objectpropertystring · 1–64 charactersrequiredThe user property it looks at, by name
opstringrequiredWhether the property is set; these take no value
One of"is_set""is_not_set"
matchstringall needs every condition to match a user, any one of them
One of"all""any"
200The group, with who's in it nowapplication/json · ReaderGroup
The group, with who's in it now
keystringrequiredIts key: from its name when made, it never changes, and names it in these paths and on tabs, collections and articles (groups)
namestringrequiredIts name
descriptionstringrequiredWhat it's for, for the team; empty if none
conditionsarray of GroupConditionrequiredWho's in it: one of your app's users is when their properties match all of these, or any one (match)
propertystringrequiredThe user property it looks at, by name
opstringrequiredHow it compares the property with value
One of"is""is_not""is_any_of""is_none_of""contains""excludes""is_set""is_not_set"
valuestring or array of stringThe text it compares with, or a list for is_any_of and is_none_of; none for is_set and is_not_set
Option 1stringOption 2array of stringmatchstringrequiredall of the conditions must match, or any one
One of"all""any"
readersintegerrequiredHow many of your users are in it now
samplearray of stringrequiredThe names of the first 3 of them, by name
400The request isn't valid: a field is missing, has the wrong type or is out of range, or the body isn't a JSON object. The message names the field.application/json · Error
errorobjectrequiredcodestringrequiredWhat went wrong, for code to check: stays the same
messagestringrequiredWhat went wrong, for a person: may change
401No API key was sent, or it isn't valid: it was revoked, or whoever created it left the team.application/json · Error
errorobjectrequiredcodestringrequiredWhat went wrong, for code to check: stays the same
messagestringrequiredWhat went wrong, for a person: may change
402The project's plan doesn't include this or is at its limit, it's out of AI credits, or a payment didn't go through. The message says what's needed.application/json · Error
errorobjectrequiredcodestringrequiredWhat went wrong, for code to check: stays the same
messagestringrequiredWhat went wrong, for a person: may change
403It isn't allowed: the key is read-only, its creator isn't a project owner or admin where only they may, only a person can do it in the app, a setting is off, or someone's address isn't confirmed. The code says which.application/json · Error
errorobjectrequiredcodestringrequiredWhat went wrong, for code to check: stays the same
messagestringrequiredWhat went wrong, for a person: may change
404Nothing by that name, number or id in this project.application/json · Error
errorobjectrequiredcodestringrequiredWhat went wrong, for code to check: stays the same
messagestringrequiredWhat went wrong, for a person: may change
429Too many requests: past 600 a minute per key, try again after the seconds in the Retry-After header. Some operations have limits of their own (their description gives them), whose 429 has no Retry-After.application/json · Error
errorobjectrequiredcodestringrequiredWhat went wrong, for code to check: stays the same
messagestringrequiredWhat went wrong, for a person: may change
500Something went wrong on Tuti's side. Try again in a moment.application/json · Error
errorobjectrequiredcodestringrequiredWhat went wrong, for code to check: stays the same
messagestringrequiredWhat went wrong, for a person: may change
curl 'https://tuti.so/api/v1/groups/string' \
--request PATCH \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Enterprise customers",
"conditions": [
{
"property": "plan",
"op": "is",
"value": "enterprise"
}
]
}'const response = await fetch("https://tuti.so/api/v1/groups/string", {
method: "PATCH",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "Enterprise customers",
"conditions": [
{
"property": "plan",
"op": "is",
"value": "enterprise"
}
]
}),
});
const text = await response.text();import requests
response = requests.patch(
"https://tuti.so/api/v1/groups/string",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
data="{\n \"name\": \"Enterprise customers\",\n \"conditions\": [\n {\n \"property\": \"plan\",\n \"op\": \"is\",\n \"value\": \"enterprise\"\n }\n ]\n}",
)
print(response.text){
"key": "pro-customers",
"name": "Pro customers",
"description": "Customers on a paid plan",
"conditions": [
{
"property": "plan",
"op": "is_any_of",
"value": [
"pro",
"enterprise"
]
}
],
"match": "all",
"readers": 42,
"sample": [
"Sam from Acme"
]
}{
"error": {
"code": "invalid_input",
"message": "title: Title is too short"
}
}{
"error": {
"code": "unauthorized",
"message": "This API key isn't valid or was revoked"
}
}{
"error": {
"code": "plan_required",
"message": "A custom domain needs the Pro plan. See Settings → Billing."
}
}{
"error": {
"code": "forbidden",
"message": "This key can only read. Create a read + write key to change things."
}
}{
"error": {
"code": "not_found",
"message": "No such post"
}
}{
"error": {
"code": "rate_limited",
"message": "Up to 600 requests a minute per key"
}
}{
"error": {
"code": "internal_error",
"message": "Something went wrong"
}
}