Tuti APIPortal

Update the widget settings

Set the widget's launcher (its name, colour, corner, quick links and icon) and its panel's Home. Fields left out stay as they are.

Needs a read + write key.

PATCH/widget

Authorization Bearer token

Body

application/json · object · required

  • labelstring · 1–30 characters

    The launcher's name, a round button: read out by screen readers and its tooltip; up to 30 characters

  • colorstring · nullable · matches ^#[0-9a-f]{6}$

    The launcher's colour, #rrggbb; null follows the portal's accent colour where it stands out on light and dark pages, else the brand green. Sending the launcher's own stored colour keeps it, and sending that default otherwise is null

  • positionstring

    Its corner

    One of"bottom-right""bottom-left"

  • linksarray of object · at most 5 items

    Home's quick links, up to 5 (replaces the list)

    Show 2 properties
    • labelstring · 1–40 charactersrequired

      What it says, up to 40 characters

    • urlstring · at most 500 charactersrequired

      Where it goes: a full https:// address

  • iconstring

    The launcher's icon (image with iconImage). Where plans are sold, an icon other than chat needs a plan with the launcher's icon (402 otherwise); on a lower plan the one set is kept and the launcher shows chat

    One of"chat""help""megaphone""lightbulb""image"

  • iconImagestring · nullable · at least 1 character

    The id of an image uploaded in the app, for the image icon

  • titlestring · at most 60 characters

    The panel's Home: its heading, empty for “How can we help?”; up to 60 characters

  • greetingstring · at most 60 characters

    The greeting above Home's heading, empty for “Hi there 👋”, with the visitor's first name once their site signs them in; up to 60 characters

  • hiddenarray of string

    The parts turned off, gone from Home and the tabs (replaces the list)

    Each item one of"docs""messages""feedback""whatsNew"

  • onPortalboolean

    Whether the launcher shows on every page of the project's own portal too (true for new projects)

  • aiFirstboolean

    Whether a new message in Messages goes to the docs' AI first, where the server has AI answers and the project has docs, with “Ask a person” to pass it to the team; one with files goes to the team (true for new projects)

Responses

  • 200The widget's settings, as changed

    application/json · WidgetSettings

    The widget's settings, as changed

    • labelstringrequired

      The launcher's name, a round button: read out by screen readers and its tooltip

    • colorstring · nullablerequired

      The launcher's colour, #rrggbb; null follows the portal's accent colour where it stands out, else the brand green

    • positionstringrequired

      Its corner

      One of"bottom-right""bottom-left"

    • linksarray of PortalLinkrequired

      Home's quick links

      Show 2 properties
      • labelstringrequired

        What it says

      • urlstringrequired

        Where it goes: a full https:// address

    • iconstringrequired

      The launcher's icon as set; on a plan without the launcher's icon it shows chat

      One of"chat""help""megaphone""lightbulb""image"

    • iconImageUploadedImage · nullablerequired

      The uploaded icon, when the icon is image

      Show 4 properties
      • idstringrequired

        The upload's id

      • urlstringrequired

        A lasting link to the image

      • widthintegerrequired

        Its width in pixels

      • heightintegerrequired

        Its height in pixels

    • titlestringrequired

      The panel's Home: its heading, empty for “How can we help?”

    • greetingstringrequired

      The greeting above Home's heading, empty for “Hi there 👋”, with the visitor's first name once their site signs them in

    • hiddenarray of stringrequired

      The parts turned off, gone from Home and the tabs

      Each item one of"docs""messages""feedback""whatsNew"

    • onPortalbooleanrequired

      Whether the launcher shows on every page of the project's own portal too (true for new projects)

    • aiFirstbooleanrequired

      Whether a new message in Messages goes to the docs' AI first, where the server has AI answers and the project has docs, with “Ask a person” to pass it to the team; one with files goes to the team (true for new projects)

  • 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

  • 409It can't be done as things are now: for example the post was merged, or someone changed it meanwhile. 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

  • 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/widget' \
  --request PATCH \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "label": "Help & feedback",
  "color": "#5b21b6",
  "position": "bottom-left",
  "links": [
    {
      "label": "Status",
      "url": "https://status.example.com"
    }
  ],
  "icon": "help",
  "title": "Questions about Acme?",
  "hidden": [
    "whatsNew"
  ]
}'
const response = await fetch("https://tuti.so/api/v1/widget", {
  method: "PATCH",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "label": "Help & feedback",
    "color": "#5b21b6",
    "position": "bottom-left",
    "links": [
      {
        "label": "Status",
        "url": "https://status.example.com"
      }
    ],
    "icon": "help",
    "title": "Questions about Acme?",
    "hidden": [
      "whatsNew"
    ]
  }),
});
const text = await response.text();
import requests

response = requests.patch(
    "https://tuti.so/api/v1/widget",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    data="{\n  \"label\": \"Help & feedback\",\n  \"color\": \"#5b21b6\",\n  \"position\": \"bottom-left\",\n  \"links\": [\n    {\n      \"label\": \"Status\",\n      \"url\": \"https://status.example.com\"\n    }\n  ],\n  \"icon\": \"help\",\n  \"title\": \"Questions about Acme?\",\n  \"hidden\": [\n    \"whatsNew\"\n  ]\n}",
)
print(response.text)
{
  "label": "Help & feedback",
  "color": "#5b21b6",
  "position": "bottom-right",
  "links": [
    {
      "label": "Status",
      "url": "https://status.example.com"
    }
  ],
  "icon": "chat",
  "iconImage": {
    "id": "cm3media0001",
    "url": "https://media.example.com/cm3media0001/480.webp",
    "width": 480,
    "height": 120
  },
  "title": "Questions about Acme?",
  "greeting": "",
  "hidden": [
    "whatsNew"
  ],
  "onPortal": true,
  "aiFirst": true
}
{
  "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": "merged",
    "message": "This post was merged into another one; vote there instead"
  }
}
{
  "error": {
    "code": "rate_limited",
    "message": "Up to 600 requests a minute per key"
  }
}
{
  "error": {
    "code": "internal_error",
    "message": "Something went wrong"
  }
}