Tuti APIAPI references

Replace a reference's spec

Replace an uploaded API reference's spec. The team's choices stay: an operation (by its key) and a type (by its name) keep their addresses, and what's hidden stays hidden. What the new spec adds is new until the team has looked, and starts off the help center while any earlier operation is off it.

Needs a read + write key.

POST/api-references/{slug}/replace

Authorization Bearer token

Path parameters

  • slugstring · 1–80 charactersrequired

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

Body

application/json · object · required

  • specstring · at most 5242880 charactersrequired

    The new spec's text, as in apiReferences.create. One that can't be read, or has no operations, changes nothing and is refused with the reason

Responses

  • 200The answer: the API reference with its new spec; changes says what the new spec did

    application/json · object

    The answer: the API reference with its new spec; changes says what the new spec did

    • 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

    • changesSpecChangesrequired

      What a new spec did to the reference's operations, by their keys

      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

  • 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/replace' \
  --request POST \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "spec": "openapi: 3.1.0\ninfo:\n  title: Acme\n  version: '\''2'\''\npaths:\n  /posts:\n    get:\n      summary: List posts\n"
}'
const response = await fetch("https://tuti.so/api/v1/api-references/public-api/replace", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "spec": "openapi: 3.1.0\ninfo:\n  title: Acme\n  version: '2'\npaths:\n  /posts:\n    get:\n      summary: List posts\n"
  }),
});
const text = await response.text();
import requests

response = requests.post(
    "https://tuti.so/api/v1/api-references/public-api/replace",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    data="{\n  \"spec\": \"openapi: 3.1.0\\ninfo:\\n  title: Acme\\n  version: '2'\\npaths:\\n  /posts:\\n    get:\\n      summary: List posts\\n\"\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
  }
}
{
  "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"
  }
}