概览

Create workspace

POST/api/v1/create_workspace
Features

Create a new Docsbook documentation site (workspace) — the FIRST call for 'make a docs site', 'set up documentation', «сделай документацию». Idempotent: a repository that already has a workspace is returned with already_existed: true, so no lookup is needed first. Pages come next: write_docs, which takes MANY files in one call, so a whole first site lands as one commit. GITHUB IS OPTIONAL — this is the tool for BOTH cases: • From scratch, no GitHub at all: OMIT repo_full_name. Docsbook creates and hosts the documentation repository itself, under its own GitHub organisation, with its own credentials. The user needs no GitHub account, no connected GitHub app and no repository — never tell them to connect GitHub or bring a repo for this. Then call write_docs to publish the pages you wrote. • From the user's OWN repository: pass repo_full_name ('owner/repo'). It is what the site READS and what its public address is made of, so it must exist on GitHub and it must belong to this Docsbook account. A repository this account has no claim on, or that GitHub does not have, is created as a Docsbook-hosted site instead, and the result then reports a different repo_full_name than you asked for, with a note saying so. If a workspace for this repo already exists, returns the existing one (already_existed: true). ALWAYS give the user site_url from the result verbatim; never build a link out of a GitHub username or repo name.

Price — free, never metered.

Also reachable by name at POST /api/v1/tools/create_workspace.

Input2
Authorizationheaderrequired
Your API key, sent as Authorization: Bearer dbk_YOUR_API_KEY.Sent from your browser straight to the API — never to Docsbook, never stored.
repo_full_namestring · body
GitHub repository in 'owner/repo' format, e.g. 'acme/docs'. OMIT for a Docsbook-hosted site created from scratch — no GitHub account or repository needed.
custom_namestring · body
Display name for the site, e.g. 'Acme API'. Derive it from the product's brand or repo name — never invent one; ask the user if you cannot. It also names the hosted repository, so pass it whenever you create from scratch.
Output3
okboolean
Whether the tool itself succeeded. A tool that ran and refused — an exhausted balance, a plan restriction, a bad argument — answers 200 with ok: false: the call was made and billed, and that refusal is its answer.
resultobject
The tool's own JSON answer, already parsed — not a string to parse a second time.
Show child attributes29
already_existedboolean
true when this repository already had a workspace — nothing new was created.
idnumber
repoFullNamestring
'owner/repo', or a Docsbook-hosted placeholder when the site was created from scratch.
customNamestring
null
site_urlstring
The live docs URL — report this verbatim, never build one from repoFullName.
customDomainstring
null
planstring
free | pro | business
visibilitystring
public | private
not_discoverablestring
Present ONLY when visibility is private, i.e. when no crawler and no answer engine can open this site. Says what that rules out — keyword work, SERP meta, crawler-facing sitemap/llms.txt tuning, backlinks, ranking readings, being cited by ChatGPT or Perplexity — and what is worth the run instead. A private SOURCE REPOSITORY is NOT this and does not rule anything out: Docsbook serves indexed public sites from private repositories.
discoverability_blocked_bystring
Alongside not_discoverable: "private" (the owner's choice) or "plan_locked" (the plan lapsed and Docsbook made it private — tell the owner before doing any work).
aiEnabledboolean
hasApiKeyboolean
Whether a REST bearer exists — never the key itself.
hasCustomAiKeyboolean
hasCustomTranslationKeyboolean
hasPasswordboolean
hasSourceOfTruthGraphboolean
Whether the semantic index has ever been built.
ssoobject
{ configured: false } or { issuer, clientId, allowedDomain, configured: true }.
plan_capabilitiesobject
What this plan unlocks.
upgrade_hintstring
null
cta_urlstring
null
cta_hintstring
average_product_price_centsnumber
null
revenue_hintstring
site_source_urlstring
null
site_source_hintstring
subheaderFoldersobject[]
Top-level folder placements, each carrying the placement it resolves to — "subheader_tab" (a tab in the category strip, its pages kept out of the root sidebar tree), "sidebar_tree" (an ordinary folder in the sidebar), "subheader_tab_and_sidebar_tree" (both) or "hidden". Read placement rather than re-deriving it from inSubheader / showInSidebar / hiddenInSidebar.
navigation_placement_hintstring
Present when the project has folder placements: what each one resolves to and why a tab's hiddenInSidebar is not a defect to fix.
publish_mismatch_warningstring
Present only when the live site does not show what was published.
……
Plus every other project setting on this row — branding colors/fonts, navigation, UI toggles, SEO/GEO/AEO flags, access rules, domain, languages — minus secrets.
duration_msinteger
Server-side wall time for the call.
Use cases
  • Use this ONLY when they point at a repository of THEIRS — including the git remote of the checkout they are working in, which counts as pointing at it.
Limitations
  • Never pass somebody else's repository — a competitor's, a prospect's, an open-source project you are only reading: naming one does not create documentation from it, it would claim their name on a public Docsbook address.
Responses
200The tool ran. Read ok to see whether it succeeded.
401Missing or invalid API key.
Example input
curl -X POST 'https://docsbook.io/api/v1/create_workspace' \
  -H 'Authorization: Bearer dbk_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{}'
Example output
{
  "ok": true,
  "result": {
    "already_existed": true,
    "id": 0,
    "repoFullName": "<repoFullName>",
    "customName": "<customName>",
    "site_url": "<site_url>",
    "customDomain": "<customDomain>",
    "plan": "<plan>",
    "visibility": "<visibility>",
    "not_discoverable": "<not_discoverable>",
    "discoverability_blocked_by": "<discoverability_blocked_by>",
    "aiEnabled": true,
    "hasApiKey": true,
    "hasCustomAiKey": true,
    "hasCustomTranslationKey": true,
    "hasPassword": true,
    "hasSourceOfTruthGraph": true,
    "sso": {},
    "plan_capabilities": {},
    "upgrade_hint": "<upgrade_hint>",
    "cta_url": "<cta_url>",
    "cta_hint": "<cta_hint>",
    "average_product_price_cents": "<average_product_price_cents>",
    "revenue_hint": "<revenue_hint>",
    "site_source_url": "<site_source_url>",
    "site_source_hint": "<site_source_hint>",
    "subheaderFolders": [],
    "navigation_placement_hint": "<navigation_placement_hint>",
    "publish_mismatch_warning": "<publish_mismatch_warning>",
    "…": "<…>"
  },
  "duration_ms": 0
}

更新于

此页面对您有帮助吗?