Documents

document operations

List collection documents

List documents in a collection

get
http://documenthub.documenthub.svc.cluster.local:4400/v2/collections/{collectionId}/documents

Query Parameters

sortstring

Sorts a collection of documents.
The sort parameter is only applied for ‘application/json’ content-type.
Supported sort attributes are:

  • created_at
  • updated_at
  • slug
  • title
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

filterobject

Filter documents returned in the response.

Show Child Parameters

Path Parameters

collectionIdstring(uuid)required

Targeted collection

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

Headers

Acceptstring

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

Default:application/json

Response

Documents in the collection

ListDocuments

* Additional properties are NOT allowed.
metaobjectrequired

returns the pagination information

Show Child Parameters
dataarray[object]required
* Additional properties are NOT allowed.
Show Child Parameters
get/collections/{collectionId}/documents
 

Create document

Create document and put it in a collection

post
http://documenthub.documenthub.svc.cluster.local:4400/v2/collections/{collectionId}/documents

Path Parameters

collectionIdstring(uuid)required

Targeted collection

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

Body

application/json

document creation

CreateDocumentPayload

a document payload

parent_document_idstring(uuid)

parent document id

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

slugstringrequired

document slug

Match pattern:^[\w\/-]+$

<= 512 characters

Example:path-for-seo

statusstring

document publish status. Default to published.

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

Contains key value pairs information about entity’s metadata.

Example:{"owner":"John Appleseed"}

* Additional properties are allowed.
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

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

post/collections/{collectionId}/documents

Body

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

Get a document by slug

Get a document

get
http://documenthub.documenthub.svc.cluster.local:4400/v2/collections/{collectionId}/documents/slug

Query Parameters

slugstringrequired

Unique slug of the document.

Example:/about/company

Path Parameters

collectionIdstring(uuid)required

Targeted collection

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

Response

application/json

Document

Document

a document

idstring(uuid)required

the id of the document

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

parent_document_idstring | null(uuid)

the id of the parent document

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

slugstringrequired

the slug of the document

Example:getting-started

statusstringrequired

document publish status. Default to published.

Allowed values:publishedunpublished

revisionobjectrequired

revision of a document

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/collections/{collectionId}/documents/slug
 
application/json

Get the document

Get the document

get
http://documenthub.documenthub.svc.cluster.local:4400/v2/collections/{collectionId}/documents/{documentId}

Path Parameters

collectionIdstring(uuid)required

Targeted collection

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

documentIdstring(uuid)required

Targeted document

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

Headers

Acceptstring

Allowed values:text/markdownapplication/jsonapplication/vnd.konnect.document-nodes+json

Default:application/json

Response

Document

Document

a document

idstring(uuid)required

the id of the document

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

parent_document_idstring | null(uuid)

the id of the parent document

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

slugstringrequired

the slug of the document

Example:getting-started

statusstringrequired

document publish status. Default to published.

Allowed values:publishedunpublished

revisionobjectrequired

revision of a document

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/collections/{collectionId}/documents/{documentId}