Tuti APIUsers

Update a reader group

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.

PATCH/groups/{group}

Authorization Bearer token

Path parameters

  • groupstring · 1–50 characters, matches ^[a-z0-9][a-z0-9_.:-]*$required

    The group's key, which stays

Body

application/json · object · required

  • namestring · 1–50 characters

    Its name

  • descriptionstring · at most 300 characters

    What it's for, for the team

  • conditionsarray of object · 1–10 items

    All of its conditions, at least one, in place of those it has (see groups.create)

    Show 3 options
    • Option 1object
      Show 3 properties
      • propertystring · 1–64 charactersrequired

        The user property it looks at, by name

      • opstringrequired

        Whether the property is, is_not, contains or excludes a text

        One of"is""is_not""contains""excludes"

      • valuestring · 1–200 charactersrequired

        The text it compares with

    • Option 2object
      Show 3 properties
      • propertystring · 1–64 charactersrequired

        The user property it looks at, by name

      • opstringrequired

        Whether the property is_any_of or is_none_of a list

        One of"is_any_of""is_none_of"

      • valuearray of string · 1–50 itemsrequired

        The texts it compares with, up to 50

        Each item: 1–200 characters

    • Option 3object
      Show 2 properties
      • propertystring · 1–64 charactersrequired

        The user property it looks at, by name

      • opstringrequired

        Whether the property is set; these take no value

        One of"is_set""is_not_set"

  • matchstring

    all needs every condition to match a user, any one of them

    One of"all""any"

Responses

  • 200The group, with who's in it now

    application/json · ReaderGroup

    The group, with who's in it now

    • keystringrequired

      Its key: from its name when made, it never changes, and names it in these paths and on tabs, collections and articles (groups)

    • namestringrequired

      Its name

    • descriptionstringrequired

      What it's for, for the team; empty if none

    • conditionsarray of GroupConditionrequired

      Who's in it: one of your app's users is when their properties match all of these, or any one (match)

      Show 3 properties
      • propertystringrequired

        The user property it looks at, by name

      • opstringrequired

        How 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 string

        The text it compares with, or a list for is_any_of and is_none_of; none for is_set and is_not_set

        Show 2 options
        • Option 1string
        • Option 2array of string
    • matchstringrequired

      all of the conditions must match, or any one

      One of"all""any"

    • readersintegerrequired

      How many of your users are in it now

    • samplearray of stringrequired

      The 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

    • errorobjectrequired
      Show 2 properties
      • codestringrequired

        What went wrong, for code to check: stays the same

      • messagestringrequired

        What 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

    • errorobjectrequired
      Show 2 properties
      • codestringrequired

        What went wrong, for code to check: stays the same

      • messagestringrequired

        What 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

    • errorobjectrequired
      Show 2 properties
      • codestringrequired

        What went wrong, for code to check: stays the same

      • messagestringrequired

        What 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

    • errorobjectrequired
      Show 2 properties
      • codestringrequired

        What went wrong, for code to check: stays the same

      • messagestringrequired

        What went wrong, for a person: may change

  • 404Nothing by that name, number or id in this project.

    application/json · Error

    • errorobjectrequired
      Show 2 properties
      • codestringrequired

        What went wrong, for code to check: stays the same

      • messagestringrequired

        What 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

    • errorobjectrequired
      Show 2 properties
      • codestringrequired

        What went wrong, for code to check: stays the same

      • messagestringrequired

        What went wrong, for a person: may change

  • 500Something went wrong on Tuti's side. Try again in a moment.

    application/json · Error

    • errorobjectrequired
      Show 2 properties
      • codestringrequired

        What went wrong, for code to check: stays the same

      • messagestringrequired

        What 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"
  }
}