Tuti APIAPI references

Sync an API reference

Read a URL's or a GitHub file's API reference again now, as the 6-hourly sync does, with apiReferences.replace's rules: the team's choices stay. An uploaded reference is refused: replace its spec instead. Counted against the fetch limits apiReferences.create gives (429).

Needs a read + write key.

POST/api-references/{slug}/sync

Authorization Bearer token

Path parameters

  • slugstring · 1–80 charactersrequired

    The API reference's slug: its address in the docs

Body

application/json · object · required

  • urlstring · 1–2000 characters

    A URL reference's new address, read from now on (kept as a URL parser writes it). It's read first, with apiReferences.create's checks: one that can't be is refused (400) with the source left as it was; so is one overtaken by another change of the source, or by a sync (409)

  • githubobject

    A GitHub file reference's new file: any of its repoId, path and ref, the rest kept. Read first, as url is

    Show 3 properties
    • repoIdinteger · at most 2147483647, more than 0

      GitHub's id for the repository, as githubRepositories.list gives it

    • pathstring

      The file's path in the repository

    • refstring · 1–255 characters, matches ^[^\s~^:?*[\\\x00-\x1f\x7f]+$

      A branch; left out, the one it's read from now

Responses

  • 200The rest of the answer is the API reference as it is once this sync is done

    application/json · object

    The rest of the answer is the API reference as it is once this sync is done

    • slugstringrequired

      Its address in the docs (/docs/<slug>): from its name when it was added, and kept when it's renamed

    • namestringrequired

      Its name in the docs' tree

    • tabstring · nullablerequired

      Its tab's slug; null when the docs have no tabs

    • formatstringrequired

      What the spec is: OpenAPI, or a GraphQL schema

      One of"openapi""graphql"

    • sourcestringrequired

      Where the spec is read from: text uploaded and replaced by hand (apiReferences.replace), an address (sourceUrl) or a file on GitHub (repoId, path, ref), read again every 6 hours and on apiReferences.sync

      One of"upload""url""github"

    • sourceUrlstring · nullablerequired

      The address a url reference's spec is read from, as a URL parser writes it; null otherwise

    • repoIdinteger · nullablerequired

      GitHub's id for a github reference's repository (githubRepositories.list); null otherwise

    • pathstring · nullablerequired

      The file's path in that repository; null otherwise

    • refstring · nullablerequired

      The branch the file is read on; null otherwise

    • baseUrlstring · nullablerequired

      Where requests go when the spec's servers have no host; null when none is set

    • treeStylestringrequired

      How it sits in the docs' tree: each group a folder (folders) or a heading (headings), or one entry that lists the operations

      One of"folders""headings""entry"

    • tryItbooleanrequired

      Whether readers can send requests from its pages

    • countsobjectrequired

      Its operations, counted

      Show 3 properties
      • operationsintegerrequired

        How many operations the spec has

      • onHelpCenterintegerrequired

        How many of them are on the help center

      • newintegerrequired

        How many a read added since the team last looked

    • publishedbooleanrequired

      Whether it's on the help center: a draft is on it nowhere

    • syncedAtstringrequired

      When the spec was last read successfully

    • syncTriedAtstringrequired

      When its source was last read, whether that worked or not

    • changedAtstringrequired

      When a read last changed what the spec has

    • syncErrorstring · nullablerequired

      Why the last read failed, or found no operations, so the pages stayed as they were; null once one works

    • changesSpecChanges · nullablerequired

      What this sync did, as replace's. Null when the read fails or finds no operations (failure), or when another sync (the 6-hourly one, a second Sync now, a change of its source) overtook this one: it writes nothing, as that one's answer is newer

      Show 3 properties
      • addedintegerrequired

        How many operations the new spec added

      • removedintegerrequired

        How many it removed

      • changedbooleanrequired

        Whether anything at all changed: the pages are rebuilt only then

    • failurestring · nullablerequired

      Why the read failed or found no operations: the reference keeps the pages as they were, and syncError (the reference's page too) says it until a sync works. Null otherwise

  • 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

  • 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

  • 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/api-references/public-api/sync' \
  --request POST \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "https://api.example.com/openapi.json"
}'
const response = await fetch("https://tuti.so/api/v1/api-references/public-api/sync", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "url": "https://api.example.com/openapi.json"
  }),
});
const text = await response.text();
import requests

response = requests.post(
    "https://tuti.so/api/v1/api-references/public-api/sync",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    data="{\n  \"url\": \"https://api.example.com/openapi.json\"\n}",
)
print(response.text)
{
  "slug": "public-api",
  "name": "Public API",
  "tab": "developers",
  "format": "openapi",
  "source": "url",
  "sourceUrl": "https://api.example.com/openapi.json",
  "repoId": null,
  "path": null,
  "ref": null,
  "baseUrl": "https://api.example.com",
  "treeStyle": "folders",
  "tryIt": true,
  "counts": {
    "operations": 24,
    "onHelpCenter": 22,
    "new": 2
  },
  "published": true,
  "syncedAt": "2026-11-19T09:00:00.000Z",
  "syncTriedAt": "2026-11-19T09:00:00.000Z",
  "changedAt": "2026-11-18T16:30:00.000Z",
  "syncError": null,
  "changes": {
    "added": 2,
    "removed": 0,
    "changed": true
  },
  "failure": null
}
{
  "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": "not_found",
    "message": "No such post"
  }
}
{
  "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"
  }
}