Tuti APIDocs

Update AI answers' settings

Set how the docs' AI answers: answer length, instructions and off-limits topics. None of it overrides answering only from the docs

Needs a read + write key.

PATCH/assistant

Authorization Bearer token

Body

application/json · object · required

  • tonestring · at most 200 characters

    Deprecated, and will be removed: a tone that's sent is put before the instructions (those sent, else those saved), a blank line between, and comes back as part of instructions

  • lengthstring

    How long answers are: short, medium or detailed

    One of"short""medium""detailed"

  • instructionsstring · at most 2202 characters

    Standing instructions for the AI, the tone to write in included, up to 2,202 characters

  • offLimitsarray of string · at most 20 items

    Up to 20 topics the AI doesn't answer, each up to 60 characters; replaces the list. A question that names an off-limits topic (as whole words, in any case) gets “I can't help with that here” without asking the AI

    Each item: at most 60 characters

Responses

  • 200The AI answers' settings, as saved

    application/json · AssistantSettings

    The AI answers' settings, as saved

    • tonestringrequired

      Deprecated, and always empty: a tone is part of instructions

      One of""

    • lengthstringrequired

      How long answers are: short (one to three sentences), medium (a short paragraph) or detailed

      One of"short""medium""detailed"

    • instructionsstringrequired

      Standing instructions for the AI, the tone to write in included

    • offLimitsarray of stringrequired

      Topics the AI doesn't answer: a question that names one gets “I can't help with that here” without asking the AI

  • 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

  • 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

  • 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/assistant' \
  --request PATCH \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "length": "short",
  "instructions": "Friendly and plain; address the reader as you.\n\nMention the Team page when a question is about inviting people.",
  "offLimits": [
    "refund",
    "legal advice"
  ]
}'
const response = await fetch("https://tuti.so/api/v1/assistant", {
  method: "PATCH",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "length": "short",
    "instructions": "Friendly and plain; address the reader as you.\n\nMention the Team page when a question is about inviting people.",
    "offLimits": [
      "refund",
      "legal advice"
    ]
  }),
});
const text = await response.text();
import requests

response = requests.patch(
    "https://tuti.so/api/v1/assistant",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    data="{\n  \"length\": \"short\",\n  \"instructions\": \"Friendly and plain; address the reader as you.\\n\\nMention the Team page when a question is about inviting people.\",\n  \"offLimits\": [\n    \"refund\",\n    \"legal advice\"\n  ]\n}",
)
print(response.text)
{
  "tone": "",
  "length": "medium",
  "instructions": "Friendly and plain; address the reader as you.",
  "offLimits": [
    "refund",
    "legal advice"
  ]
}
{
  "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": "forbidden",
    "message": "This key can only read. Create a read + write key to change things."
  }
}
{
  "error": {
    "code": "rate_limited",
    "message": "Up to 600 requests a minute per key"
  }
}
{
  "error": {
    "code": "internal_error",
    "message": "Something went wrong"
  }
}