Tuti APIDocs

Ask the docs

Ask the docs a question: an AI answer from the published articles, citing them, or “I don't know”. Off (503) unless the server has AI and embeddings set up. Up to 20 questions an hour per key, and 300 per project (429)

POST/docs/ask

Authorization Bearer token

Body

application/json · object · required

  • qstring · 1–300 charactersrequired

    The question, up to 300 characters

  • followUpTostring · 1–100 characters

    To ask a follow-up: the id of the answer it follows (one this caller asked; 404 otherwise). The last 4 turns are its context, for finding what to answer from and for the AI, which still answers only from the articles

Responses

  • 200The answer

    application/json · object

    The answer

    • idstringrequired

      The question's id: pass it as followUpTo to ask a follow-up, or to docs.escalate to pass it to the team

    • statusstringrequired

      answered; no_answer (“I don't know”): the docs don't cover it; off_limits: it names one of the team's off-limits topics (see assistant.update), so the AI isn't asked; failed: the AI didn't answer in time; unavailable: the project is out of AI credits, so the AI isn't asked. With failed and unavailable, sources are the closest articles

      One of"answered""no_answer""off_limits""failed""unavailable"

    • answerstring · nullablerequired

      The answer, as plain text: paragraphs separated by blank lines, “- ” list items; null without one

    • sourcesarray of objectrequired

      The articles the answer cites

      Show 3 properties
      • slugstringrequired

        The article's slug (an API reference's operation: its path under /docs)

      • titlestringrequired

        Its title

      • urlstring · nullablerequired

        Its page; null for an AI-only article, which has none, so the answer names it without a link

  • 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

  • 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

  • 503This feature isn't set up on this server (for example AI or billing), or Tuti couldn't start the work just now: 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/docs/ask' \
  --request POST \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "q": "And on mobile?",
  "followUpTo": "cm3q5x0a1000008l4h2gk7v9e"
}'
const response = await fetch("https://tuti.so/api/v1/docs/ask", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "q": "And on mobile?",
    "followUpTo": "cm3q5x0a1000008l4h2gk7v9e"
  }),
});
const text = await response.text();
import requests

response = requests.post(
    "https://tuti.so/api/v1/docs/ask",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    data="{\n  \"q\": \"And on mobile?\",\n  \"followUpTo\": \"cm3q5x0a1000008l4h2gk7v9e\"\n}",
)
print(response.text)
{
  "id": "cm3q5x0a1000008l4h2gk7v9e",
  "status": "answered",
  "answer": "Owners and admins invite teammates from the Team page: enter their email and pick a role.",
  "sources": [
    {
      "slug": "invite-your-team",
      "title": "Invite your team",
      "url": "https://help.example.com/docs/invite-your-team"
    }
  ]
}
{
  "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": "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"
  }
}
{
  "error": {
    "code": "ai_unavailable",
    "message": "AI isn't set up on this server"
  }
}