Get the document tree

Get the document tree

get
http://documenthub.documenthub.svc.cluster.local:4400/v0/{resourceKind}/{resourceId}/documents/tree

Path Parameters

resourceKindstringrequired

Kind of the Konnect resource

Allowed values:services

Example:services

resourceIdstring(uuid)required

Id of the Konnect resource

Example:bf138ba2-c9b1-4229-b268-04d9d8a6410b

Response

application/json

Tree of documents

a document tree

idstring(uuid)required

Example:d32d905a-ed33-46a3-a093-d8f536af9a8a

parent_document_idstring | null(uuid)

Example:dd4e1b98-3629-4dd3-acc0-759a726ffee2

titlestringrequired
slugstringrequired

document slug

Example:path-for-seo

metadataobjectrequired

metadata of the document

Example:{"author":"John Doe"}

statusstringrequired

Allowed values:publishedunpublished

childrenarray[object]required

a document tree

Example:[{"id":"d32d905a-ed33-46a3-a093-d8f536af9a8a","title":"Hello world","status":"published","slug":"hello-world","metadata":{"author":"John Doe"},"children":[]}]

Show Child Parameters
created_atstring(date-time)requiredread-only

An ISO-8601 timestamp representation of entity creation date.

Example:2022-11-04T20:10:06.927Z

updated_atstring(date-time)requiredread-only

An ISO-8601 timestamp representation of entity update date.

Example:2022-11-04T20:10:06.927Z

get/{resourceKind}/{resourceId}/documents/tree
 
application/json

Get many documents

Get many documents

get
http://documenthub.documenthub.svc.cluster.local:4400/v0/{resourceKind}/{resourceId}/documents

Query Parameters

page[size]integer

The maximum number of items to include per page. The last page of a collection may include fewer items.

Example:10

page[number]integer

Determines which page of the entities to retrieve.

Example:1

Path Parameters

resourceKindstringrequired

Kind of the Konnect resource

Allowed values:services

Example:services

resourceIdstring(uuid)required

Id of the Konnect resource

Example:bf138ba2-c9b1-4229-b268-04d9d8a6410b

Headers

Acceptstring

Allowed values:application/jsonapplication/vnd.konnect.document-tree+json

Default:application/json

Response

Tree of documents or flat list of documents

ListDocumentsWithStatus

* Additional properties are NOT allowed.
metaobjectrequired

returns the pagination information

Show Child Parameters
dataarrayrequired
* Additional properties are NOT allowed.
get/{resourceKind}/{resourceId}/documents
 

Create document

Create document and associate it with a Konnect resource

post
http://documenthub.documenthub.svc.cluster.local:4400/v0/{resourceKind}/{resourceId}/documents

Path Parameters

resourceKindstringrequired

Kind of the Konnect resource

Allowed values:services

Example:services

resourceIdstring(uuid)required

Id of the Konnect resource

Example:bf138ba2-c9b1-4229-b268-04d9d8a6410b

Body

application/json

document creation

CreateDocumentPayload

a document payload

parent_document_idstring | null(uuid)

parent document id

Example:dd4e1b98-3629-4dd3-acc0-759a726ffee2

slugstringrequired

document slug

Match pattern:^[\w-]+$

<= 80 characters

Example:path-for-seo

statusstringrequired

Allowed values:publishedunpublished

titlestringrequired

document title

Example:How to create a document in Konnect DocumentHub

raw_contentstring(byte)

Must be a base64 encoded string. Either raw_content or str_mdr_content are required.

Example:YmFzZTY0LWVuY29kZWQgdGV4dCBzdHJpbmc=

str_md_contentstring

Markdown content. Either raw_content or str_mdr_content are required.

Example:## My Markdown

metadataobject | null

metadata of the document

Example:{"author":"John Doe"}

filenamestringrequired

name of the uploaded file

Example:my_doc.md

Response

application/json

The document has been created

Document Creation Response Payload

a document payload

document_idstring(uuid)required

document id

Example:d32d905a-ed33-46a3-a093-d8f536af9a8a

revision_idstring(uuid)required

revision id

Example:ecfb698d-77a8-4ab5-91fa-45ee383b48ba

post/{resourceKind}/{resourceId}/documents

Body

{ "slug": "path-for-seo", "status": "published", "title": "How to create a document in Konnect DocumentHub", "filename": "my_doc.md" }
 
application/json

Get the document

Get the document

get
http://documenthub.documenthub.svc.cluster.local:4400/v0/{resourceKind}/{resourceId}/documents/{documentId}

Query Parameters

rawboolean

include raw document data in the response

Example:true

Path Parameters

resourceKindstringrequired

Kind of the Konnect resource

Allowed values:services

Example:services

resourceIdstring(uuid)required

Id of the Konnect resource

Example:bf138ba2-c9b1-4229-b268-04d9d8a6410b

documentIdstring(uuid)required

Targeted document

Example:bb84c46a-432d-4314-81e4-478614a52dcb

Response

The document

Document

a document

idstring(uuid)required

Example:d32d905a-ed33-46a3-a093-d8f536af9a8a

statusstringrequired

Allowed values:publishedunpublished

parent_document_idstring | null(uuid)required

Example:dd4e1b98-3629-4dd3-acc0-759a726ffee2

slugstringrequired

document slug

Match pattern:^[\w-]+$

<= 80 characters

Example:path-for-seo

created_atstring(date-time)required

Example:2023-01-11T02:30:42.227Z

modified_atstring(date-time)required

Example:2023-01-11T02:30:42.227Z

revisionobjectrequired

revision of a document

Show Child Parameters
get/{resourceKind}/{resourceId}/documents/{documentId}
 

Update the document

Update the document

put
http://documenthub.documenthub.svc.cluster.local:4400/v0/{resourceKind}/{resourceId}/documents/{documentId}

Path Parameters

resourceKindstringrequired

Kind of the Konnect resource

Allowed values:services

Example:services

resourceIdstring(uuid)required

Id of the Konnect resource

Example:bf138ba2-c9b1-4229-b268-04d9d8a6410b

documentIdstring(uuid)required

Targeted document

Example:bb84c46a-432d-4314-81e4-478614a52dcb

Body

application/json

document update

UpdateDocumentPayload

a document payload

parent_document_idstring | null(uuid)

Parent document Id. If this value is explicitly set to null, the
document will be put as a top level document at the bottom of the tree.

Example:dd4e1b98-3629-4dd3-acc0-759a726ffee2

slugstring

document slug

Match pattern:^[\w-]+$

<= 80 characters

Example:path-for-seo

statusstring

Allowed values:publishedunpublished

titlestring

document title

Example:How to update a document in Konnect DocumentHub

raw_contentstring(byte)

base64 encoded string of the document content

Example:YmFzZTY0LWVuY29kZWQgdGV4dCBzdHJpbmc=

str_md_contentstring

markdown content

Example:## My Markdown

filenamestring

name of the uploaded file

Example:my_doc.md

metadataobject | null

Response

application/json

The document has been updated

Document

a document

idstring(uuid)required

Example:d32d905a-ed33-46a3-a093-d8f536af9a8a

statusstringrequired

Allowed values:publishedunpublished

parent_document_idstring | null(uuid)required

Example:dd4e1b98-3629-4dd3-acc0-759a726ffee2

slugstringrequired

document slug

Match pattern:^[\w-]+$

<= 80 characters

Example:path-for-seo

created_atstring(date-time)required

Example:2023-01-11T02:30:42.227Z

modified_atstring(date-time)required

Example:2023-01-11T02:30:42.227Z

revisionobjectrequired

revision of a document

Show Child Parameters
put/{resourceKind}/{resourceId}/documents/{documentId}

Body

{}
 
application/json