Preview. This site is still being built. Features, prices and terms may change, and nothing here is a binding offer. Read the preview notice

Preview. Still being built; nothing here is a binding offer. Details

CMS · docs

12 routes. Paths are relative to https://api.intersink.com/v1.

All groups

Versions with page counts, what latest resolves to, and deprecation

GET/cms/channels/{channelId}/doc-versions

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path

Response

200. data is object (DocVersionsAdminResultDto).

FieldTypeDescription
latest_versionrequiredstringExample: "v2"
versionsrequiredobject[]
versions[].namerequiredstringExample: "v2"
versions[].labelrequiredstring
versions[].is_latestrequiredbooleanWhat latest resolves to for readers now
versions[].marked_latestrequiredbooleanMarked latest in its settings (readers fall back while it has no live pages)
versions[].deprecatedrequiredboolean
versions[].bannerrequiredstring
versions[].sortrequirednumber
versions[].pagesrequirednumberExample: 42
versions[].publishedrequirednumberExample: 40
versions[].liverequiredbooleanHas live pages (readers can open it)
versions[].configuredrequiredbooleanHas a settings row

Create or change a version's settings: label, is_latest, deprecated + banner, order

PUT/cms/channels/{channelId}/doc-versions/{name}

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path
namerequiredstring, path

Request body application/json

FieldTypeDescription
labelstringAt most 60 characters. Example: "v2 (current)"
is_latestbooleanMake this the version latest points to (it must have live pages)
deprecatedbooleanEvery page of this version shows a deprecation banner
bannerstringAt most 300 characters. Example: "v1 is no longer maintained."
sortnumberOrder in the version switcher (lower first) Minimum -100000, maximum 100000.

Response

200. data is object (DocVersionRecordDto).

FieldTypeDescription
idrequirednumber
channel_idrequiredstring (uuid)
namerequiredstringExample: "v2"
labelrequiredstring
is_latestrequiredboolean
deprecatedrequiredboolean
bannerrequiredstring
sortrequirednumber

Delete a version's settings

DELETE/cms/channels/{channelId}/doc-versions/{name}

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path
namerequiredstring, path

Response

200. data is object (DocVersionDeletedDto).

FieldTypeDescription
namerequiredstringExample: "v0"
deletedrequiredbooleanExample: true

Start this version as a copy of another (copies start as drafts unless as_draft is false)

POST/cms/channels/{channelId}/doc-versions/{name}/clone

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path
namerequiredstring, path

Request body application/json

FieldTypeDescription
fromrequiredstringCopy every page of this version Example: "v1"
as_draftbooleanCopied pages start as drafts

Response

201. data is object (DocCloneResultDto). Copied

FieldTypeDescription
versionrequiredstringExample: "v2"
fromrequiredstringExample: "v1"
copiedrequirednumberExample: 42
as_draftrequiredboolean

List the channel's doc pages (all statuses; no bodies)

GET/cms/channels/{channelId}/docs

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path
pagenumber, queryMinimum 1, maximum 10000.
limitnumber, queryMinimum 1, maximum 100.
statusstring, queryOne of: "draft", "published", "archived".
versionstring, queryExample: "v1"
qstring, querySearch in the title and path At most 100 characters.

Response

200. data is object (DocListResultDto).

FieldTypeDescription
datarequiredobject[]Pages without body_md
data[].idrequirednumberExample: 12
data[].channel_idrequiredstring (uuid)
data[].kindrequiredstringOne of: "page", "group".
data[].versionrequiredstringExample: "v1"
data[].parent_idrequirednumberExample: 10
data[].slugrequiredstringExample: "sessions"
data[].pathrequiredstringExample: "guides/auth/sessions"
data[].sortrequirednumberExample: 0
data[].titlerequiredstringExample: "Sessions"
data[].nav_titlerequiredstring
data[].nav_hiddenrequiredboolean
data[].descriptionrequiredstring
data[].body_mdrequiredstringSafe, canonical Markdown
data[].tocrequiredobject[]
data[].toc[].depthrequirednumberExample: 2
data[].toc[].textrequiredstringExample: "Refresh tokens"
data[].toc[].idrequiredstringAnchor id (rehype-slug / github-slugger) Example: "refresh-tokens"
data[].reading_minutesrequirednumberExample: 3
data[].word_countrequirednumberExample: 512
data[].statusrequiredstringOne of: "draft", "published", "archived".
data[].deprecatedrequiredboolean
data[].deprecated_bannerrequiredstring
data[].seo_titlerequiredstring
data[].seo_descriptionrequiredstring
data[].author_user_idrequiredstring (uuid)
data[].updated_by_user_idrequiredstring (uuid)
data[].date_createdrequiredstring (date-time)
data[].date_updatedrequiredstring (date-time)
pagerequirednumberExample: 1
limitrequirednumberExample: 20
totalrequirednumberExample: 42
hasMorerequiredboolean

Create a doc page or sidebar group (Markdown is made safe; the answer lists changes as warnings)

POST/cms/channels/{channelId}/docs

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path

Request body application/json

FieldTypeDescription
titlerequiredstringAt most 200 characters. Example: "Sessions"
kindstringpage: has content; group: a sidebar heading only (no body, not a page of its own) One of: "page", "group".
slugstringThis page's path segment (default: from the title) At most 80 characters. Example: "sessions"
parent_idnumberParent page id (same channel and version); null = top level Example: 12
versionstringVersion tag (default: the channel's latest version, else v1). Fixed once created. Example: "v1"
sortnumberPosition among its siblings (lower first) Minimum -100000, maximum 100000. Example: 10
nav_titlestringShorter label for the sidebar At most 80 characters. Example: "Sessions"
nav_hiddenbooleanKept out of the sidebar and prev/next (still reachable by path)
descriptionstringAt most 300 characters. Example: "How sign-in sessions work and how to refresh them."
body_mdstringMarkdown (docs/cms-docs.md); made safe and canonical on save At most 100000 characters. Example: "## Refresh tokens\n\n:::warning[Keep it secret]\nNever ship a server key.\n:::\n\n``ts title=\"client.ts\"\nawait client.refresh()\n``"
statusstringOne of: "draft", "published", "archived".
deprecatedbooleanShow a deprecation banner on this page
deprecated_bannerstringAt most 300 characters. Example: "Use sessions instead."
seo_titlestringAt most 70 characters.
seo_descriptionstringAt most 170 characters.

Response

201. data is object (DocWriteResultDto). Created

FieldTypeDescription
idrequirednumberExample: 12
channel_idrequiredstring (uuid)
kindrequiredstringOne of: "page", "group".
versionrequiredstringExample: "v1"
parent_idrequirednumberExample: 10
slugrequiredstringExample: "sessions"
pathrequiredstringExample: "guides/auth/sessions"
sortrequirednumberExample: 0
titlerequiredstringExample: "Sessions"
nav_titlerequiredstring
nav_hiddenrequiredboolean
descriptionrequiredstring
body_mdrequiredstringSafe, canonical Markdown
tocrequiredobject[]
toc[].depthrequirednumberExample: 2
toc[].textrequiredstringExample: "Refresh tokens"
toc[].idrequiredstringAnchor id (rehype-slug / github-slugger) Example: "refresh-tokens"
reading_minutesrequirednumberExample: 3
word_countrequirednumberExample: 512
statusrequiredstringOne of: "draft", "published", "archived".
deprecatedrequiredboolean
deprecated_bannerrequiredstring
seo_titlerequiredstring
seo_descriptionrequiredstring
author_user_idrequiredstring (uuid)
updated_by_user_idrequiredstring (uuid)
date_createdrequiredstring (date-time)
date_updatedrequiredstring (date-time)
warningsrequiredobject[]What was changed to make the Markdown safe (empty when nothing)
warnings[].coderequiredstringOne of: "HTML_ESCAPED", "HTML_COMMENT_REMOVED", "MDX_REMOVED", "UNSAFE_URL", "CODE_LANGUAGE_REMOVED", "CODE_META_CLEANED", "DIRECTIVE_AS_TEXT", "UNKNOWN_CONTAINER", "ATTRIBUTES_REMOVED", "CODE_GROUP_CONTENT". Example: "HTML_ESCAPED"
warnings[].messagerequiredstringExample: "Raw HTML is not allowed in docs; it is shown as text."
warnings[].linerequirednumberExample: 3

One doc page with its Markdown

GET/cms/channels/{channelId}/docs/{id}

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path
idrequirednumber, path

Response

200. data is object (DocAdminDto).

FieldTypeDescription
idrequirednumberExample: 12
channel_idrequiredstring (uuid)
kindrequiredstringOne of: "page", "group".
versionrequiredstringExample: "v1"
parent_idrequirednumberExample: 10
slugrequiredstringExample: "sessions"
pathrequiredstringExample: "guides/auth/sessions"
sortrequirednumberExample: 0
titlerequiredstringExample: "Sessions"
nav_titlerequiredstring
nav_hiddenrequiredboolean
descriptionrequiredstring
body_mdrequiredstringSafe, canonical Markdown
tocrequiredobject[]
toc[].depthrequirednumberExample: 2
toc[].textrequiredstringExample: "Refresh tokens"
toc[].idrequiredstringAnchor id (rehype-slug / github-slugger) Example: "refresh-tokens"
reading_minutesrequirednumberExample: 3
word_countrequirednumberExample: 512
statusrequiredstringOne of: "draft", "published", "archived".
deprecatedrequiredboolean
deprecated_bannerrequiredstring
seo_titlerequiredstring
seo_descriptionrequiredstring
author_user_idrequiredstring (uuid)
updated_by_user_idrequiredstring (uuid)
date_createdrequiredstring (date-time)
date_updatedrequiredstring (date-time)

Update a doc page (a new slug or parent moves the pages under it too, atomically)

PATCH/cms/channels/{channelId}/docs/{id}

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path
idrequirednumber, path

Request body application/json

FieldTypeDescription
titlestringAt most 200 characters.
slugstringA new slug moves the pages under this one too At most 80 characters.
parent_idnumberA new parent moves the pages under this one too
sortnumberMinimum -100000, maximum 100000.
nav_titlestringAt most 80 characters.
nav_hiddenboolean
descriptionstringAt most 300 characters.
body_mdstringAt most 100000 characters.
statusstringOne of: "draft", "published", "archived".
deprecatedboolean
deprecated_bannerstringAt most 300 characters.
seo_titlestringAt most 70 characters.
seo_descriptionstringAt most 170 characters.

Response

200. data is object (DocWriteResultDto).

FieldTypeDescription
idrequirednumberExample: 12
channel_idrequiredstring (uuid)
kindrequiredstringOne of: "page", "group".
versionrequiredstringExample: "v1"
parent_idrequirednumberExample: 10
slugrequiredstringExample: "sessions"
pathrequiredstringExample: "guides/auth/sessions"
sortrequirednumberExample: 0
titlerequiredstringExample: "Sessions"
nav_titlerequiredstring
nav_hiddenrequiredboolean
descriptionrequiredstring
body_mdrequiredstringSafe, canonical Markdown
tocrequiredobject[]
toc[].depthrequirednumberExample: 2
toc[].textrequiredstringExample: "Refresh tokens"
toc[].idrequiredstringAnchor id (rehype-slug / github-slugger) Example: "refresh-tokens"
reading_minutesrequirednumberExample: 3
word_countrequirednumberExample: 512
statusrequiredstringOne of: "draft", "published", "archived".
deprecatedrequiredboolean
deprecated_bannerrequiredstring
seo_titlerequiredstring
seo_descriptionrequiredstring
author_user_idrequiredstring (uuid)
updated_by_user_idrequiredstring (uuid)
date_createdrequiredstring (date-time)
date_updatedrequiredstring (date-time)
warningsrequiredobject[]What was changed to make the Markdown safe (empty when nothing)
warnings[].coderequiredstringOne of: "HTML_ESCAPED", "HTML_COMMENT_REMOVED", "MDX_REMOVED", "UNSAFE_URL", "CODE_LANGUAGE_REMOVED", "CODE_META_CLEANED", "DIRECTIVE_AS_TEXT", "UNKNOWN_CONTAINER", "ATTRIBUTES_REMOVED", "CODE_GROUP_CONTENT". Example: "HTML_ESCAPED"
warnings[].messagerequiredstringExample: "Raw HTML is not allowed in docs; it is shown as text."
warnings[].linerequirednumberExample: 3

Delete a doc page

DELETE/cms/channels/{channelId}/docs/{id}

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path
idrequirednumber, path

Response

200. data is object (DocDeletedDto).

FieldTypeDescription
idrequirednumberExample: 12
deletedrequiredbooleanExample: true

Check Markdown without saving: the safe Markdown, TOC, reading time and warnings

POST/cms/channels/{channelId}/docs/preview

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path

Request body application/json

FieldTypeDescription
body_mdrequiredstringMarkdown to check At most 100000 characters. Example: "Hi <b>there</b>\n\n:::tip Did you know\nIt works.\n:::"

Response

200. data is object (DocPreviewResultDto).

FieldTypeDescription
body_mdrequiredstringExample: "Hi \\<b>there\\</b>\n\n:::tip[Did you know]\nIt works.\n:::"
tocrequiredobject[]
toc[].depthrequirednumberExample: 2
toc[].textrequiredstringExample: "Refresh tokens"
toc[].idrequiredstringAnchor id (rehype-slug / github-slugger) Example: "refresh-tokens"
reading_minutesrequirednumber
word_countrequirednumber
code_blocksrequiredobject[]
code_blocks[].langrequiredstringExample: "ts"
code_blocks[].titlerequiredstringExample: "client.ts"
code_blocks[].grouprequirednumberIndex of its :::code-group, else null
calloutsrequirednumber
warningsrequiredobject[]
warnings[].coderequiredstringOne of: "HTML_ESCAPED", "HTML_COMMENT_REMOVED", "MDX_REMOVED", "UNSAFE_URL", "CODE_LANGUAGE_REMOVED", "CODE_META_CLEANED", "DIRECTIVE_AS_TEXT", "UNKNOWN_CONTAINER", "ATTRIBUTES_REMOVED", "CODE_GROUP_CONTENT". Example: "HTML_ESCAPED"
warnings[].messagerequiredstringExample: "Raw HTML is not allowed in docs; it is shown as text."
warnings[].linerequirednumberExample: 3

Move and reorder pages of one version in one go (all or nothing; paths follow)

POST/cms/channels/{channelId}/docs/reorder

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path

Request body application/json

FieldTypeDescription
versionrequiredstringExample: "v1"
itemsrequiredobject[]Up to 500 moves, applied together At most 500 items.
items[].idrequirednumberExample: 12
items[].parent_idnumberOmitted = parent unchanged; null = top level
items[].sortrequirednumberMinimum -100000, maximum 100000. Example: 0

Response

200. data is object (DocReorderResultDto).

FieldTypeDescription
versionrequiredstringExample: "v1"
movedrequirednumberPages whose parent, order or path changed Example: 4

Every page and group of a version as a tree, drafts included (default: the latest version)

GET/cms/channels/{channelId}/docs/tree

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path
versionstring, queryDefault: the latest version Example: "v1"

Response

200. data is object (DocTreeResultDto).

FieldTypeDescription
versionrequiredstringExample: "v1"
totalrequirednumberExample: 42
treerequiredobject[]
tree[].idrequirednumberExample: 12
tree[].kindrequiredstringOne of: "page", "group".
tree[].titlerequiredstringExample: "Sessions"
tree[].nav_titlerequiredstring
tree[].slugrequiredstringExample: "sessions"
tree[].pathrequiredstringExample: "guides/auth/sessions"
tree[].sortrequirednumber
tree[].statusrequiredstringOne of: "draft", "published", "archived".
tree[].nav_hiddenrequiredboolean
tree[].deprecatedrequiredboolean
tree[].date_updatedrequiredstring (date-time)
tree[].childrenrequiredobject[]
tree[].children[].idrequirednumberExample: 12
tree[].children[].kindrequiredstringOne of: "page", "group".
tree[].children[].titlerequiredstringExample: "Sessions"
tree[].children[].nav_titlerequiredstring
tree[].children[].slugrequiredstringExample: "sessions"
tree[].children[].pathrequiredstringExample: "guides/auth/sessions"
tree[].children[].sortrequirednumber
tree[].children[].statusrequiredstringOne of: "draft", "published", "archived".
tree[].children[].nav_hiddenrequiredboolean
tree[].children[].deprecatedrequiredboolean
tree[].children[].date_updatedrequiredstring (date-time)
tree[].children[].childrenrequiredobject[]