Download OpenAPI specification:Download
DocumentHub admin Api
Create a document collection
| sort | string Sorts a list of collections. Supported sort attributes are:
|
| page[size] | integer Example: page[size]=10 The maximum number of items to include per page. The last page of a collection may include fewer items. |
| page[number] | integer Example: page[number]=1 Determines which page of the entities to retrieve. |
object Filter documents returned in the response. |
{- "meta": {
- "page": {
- "number": 1,
- "size": 10,
- "total": 100
}
}, - "data": [
- {
- "id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
- "name": "my document collection",
- "created_at": "2022-11-04T20:10:06.927Z",
- "updated_at": "2022-11-04T20:10:06.927Z"
}
]
}Create a document collection
collection creation
| name required | string |
{- "name": "string"
}{- "id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
- "name": "my document collection",
- "created_at": "2022-11-04T20:10:06.927Z",
- "updated_at": "2022-11-04T20:10:06.927Z"
}Get document collection
| collectionId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted collection |
{- "id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
- "name": "my document collection",
- "created_at": "2022-11-04T20:10:06.927Z",
- "updated_at": "2022-11-04T20:10:06.927Z"
}Create or Update the document collection. collectionId must be globally unique. A collectionId of a different kind (service/portal) must not already exist.
| collectionId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted collection |
collection put
| name required | string |
{- "name": "my document collection"
}{- "id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
- "name": "my document collection",
- "created_at": "2022-11-04T20:10:06.927Z",
- "updated_at": "2022-11-04T20:10:06.927Z"
}Update the document collection
| collectionId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted collection |
collection update
| name required | string |
{- "name": "string"
}{- "id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
- "name": "my document collection",
- "created_at": "2022-11-04T20:10:06.927Z",
- "updated_at": "2022-11-04T20:10:06.927Z"
}Delete the document collection
| collectionId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted collection |
{- "status": 404,
- "title": "Not Found",
- "instance": "kong:trace:6816496025408232265",
- "detail": "Not Found"
}List documents in a collection
| collectionId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted collection |
| sort | string Sorts a collection of documents. The sort parameter is only applied for 'application/json' content-type. Supported sort attributes are:
|
| page[size] | integer Example: page[size]=10 The maximum number of items to include per page. The last page of a collection may include fewer items. |
| page[number] | integer Example: page[number]=1 Determines which page of the entities to retrieve. |
object Filter documents returned in the response. |
| Accept | string (DocumentContentTypeEnum) Default: application/json Enum: "application/json" "application/vnd.konnect.document-tree+json" |
{- "meta": {
- "page": {
- "number": 1,
- "size": 10,
- "total": 100
}
}, - "data": [
- {
- "id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
- "parent_document_id": "dd4e1b98-3629-4dd3-acc0-759a726ffee2",
- "slug": "getting-started",
- "title": "Getting Started",
- "filename": "myDocument.md",
- "status": "published",
- "metadata": {
- "owner": "John Appleseed"
}, - "created_at": "2022-11-04T20:10:06.927Z",
- "updated_at": "2022-11-04T20:10:06.927Z"
}
]
}Create document and put it in a collection
| collectionId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted collection |
document creation
| parent_document_id | string <uuid> parent document id |
| slug required | string (Slug) <= 512 characters ^[\w\/-]+$ document slug |
| status | string (PublishStatus) Enum: "published" "unpublished" document publish status. Default to published. |
| title required | string document title |
| raw_content | string <byte> Must be a base64 encoded string. Either raw_content or str_mdr_content are required. |
| str_md_content | string Markdown content. Either raw_content or str_mdr_content are required. |
object (Metadata) Contains key value pairs information about entity's metadata. | |
| filename required | string name of the uploaded file |
{- "parent_document_id": "dd4e1b98-3629-4dd3-acc0-759a726ffee2",
- "slug": "path-for-seo",
- "status": "published",
- "title": "How to create a document in Konnect DocumentHub",
- "raw_content": "YmFzZTY0LWVuY29kZWQgdGV4dCBzdHJpbmc=",
- "str_md_content": "## My Markdown",
- "metadata": {
- "owner": "John Appleseed"
}, - "filename": "my_doc.md"
}{- "document_id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
- "revision_id": "ecfb698d-77a8-4ab5-91fa-45ee383b48ba",
- "created_at": "2022-11-04T20:10:06.927Z",
- "updated_at": "2022-11-04T20:10:06.927Z"
}Get a document
| collectionId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted collection |
| slug required | string Example: slug=/about/company Unique slug of the document. |
{- "id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
- "parent_document_id": "dd4e1b98-3629-4dd3-acc0-759a726ffee2",
- "slug": "getting-started",
- "status": "published",
- "revision": {
- "id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
- "document_id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
- "content": "string",
- "metadata": {
- "owner": "John Appleseed"
}, - "title": "Hello World"
}, - "created_at": "2022-11-04T20:10:06.927Z",
- "updated_at": "2022-11-04T20:10:06.927Z"
}Get the document
| collectionId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted collection |
| documentId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted document |
| Accept | string (DocumentFormatContentTypeEnum) Default: application/json Enum: "text/markdown" "application/json" "application/vnd.konnect.document-nodes+json" |
{- "id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
- "parent_document_id": "dd4e1b98-3629-4dd3-acc0-759a726ffee2",
- "slug": "getting-started",
- "status": "published",
- "revision": {
- "id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
- "document_id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
- "content": "string",
- "metadata": {
- "owner": "John Appleseed"
}, - "title": "Hello World"
}, - "created_at": "2022-11-04T20:10:06.927Z",
- "updated_at": "2022-11-04T20:10:06.927Z"
}Delete the document. Returns 404 if the document cannot be found, 409 if deleting the document would result in other orphaned documents.
| collectionId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted collection |
| documentId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted document |
{- "status": 404,
- "title": "Not Found",
- "instance": "kong:trace:6816496025408232265",
- "detail": "Not Found"
}Update the document
| collectionId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted collection |
| documentId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted document |
document update
| parent_document_id | string or 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. |
| slug | string (Slug) <= 512 characters ^[\w\/-]+$ document slug |
| status | string (PublishStatus) Enum: "published" "unpublished" document publish status. Default to published. |
| title | string document title |
| raw_content | string <byte> base64 encoded string of the document content |
| str_md_content | string markdown content |
| filename | string name of the uploaded file |
object or null (MetadataNullable) Contains key value pairs information about entity's metadata. |
{- "parent_document_id": "dd4e1b98-3629-4dd3-acc0-759a726ffee2",
- "slug": "path-for-seo",
- "status": "published",
- "title": "How to update a document in Konnect DocumentHub",
- "raw_content": "YmFzZTY0LWVuY29kZWQgdGV4dCBzdHJpbmc=",
- "str_md_content": "## My Markdown",
- "filename": "my_doc.md",
- "metadata": { }
}{- "id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
- "parent_document_id": "dd4e1b98-3629-4dd3-acc0-759a726ffee2",
- "slug": "path-for-seo",
- "status": "published",
- "created_at": "2022-11-04T20:10:06.927Z",
- "updated_at": "2022-11-04T20:10:06.927Z",
- "revision": {
- "id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
- "document_id": "2272b454-4af6-4c56-8a02-d6145ac62e67",
- "content": {
- "type": "document",
- "content": [
- {
- "type": "paragraph",
- "content": [
- {
- "type": "text",
- "text": "Hello World"
}
]
}
]
}, - "metadata": {
- "owner": "John Appleseed"
}, - "title": "Hello world",
- "raw_md_content": "I0ludHJvZHVjdGlvbg==",
- "file": {
- "filename": "my_doc.md",
- "modified_at": "2023-01-11T02:30:42.227Z"
}
}
}This api allows the user to move a document within the document tree using the parameters parent_document_id and index. If parent_document_id is not provided, the document will be placed at the top level of the document tree. index represents a zero-indexed document order relative to its siblings under the same parent. For example, if we want to put the document at top level in first position we would send parent_document_id: null and index: 0. This api also supports using a negative index to count backwards from the end of the document list, which means you can put the document in last position by using index: -1.
| collectionId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted collection |
| documentId required | string <uuid> Example: bb84c46a-432d-4314-81e4-478614a52dcb Targeted document |
move document
| parent_document_id | string <uuid> parent document id |
| index | integer index of the document in the parent document's children |
{- "parent_document_id": "dd4e1b98-3629-4dd3-acc0-759a726ffee2",
- "index": 1
}{- "status": 0,
- "title": "string",
- "type": "string",
- "instance": "string",
- "detail": "string",
- "invalid_parameters": [
- {
- "field": "name",
- "rule": "required",
- "source": "body",
- "reason": "is a required field"
}
]
}