Internal DocumentHub admin Api (0.0.1)

Download OpenAPI specification:Download

DocumentHub admin Api

Customization

customization operations

Get the document tree

Get the document tree

Authorizations:
bearerAuth
path Parameters
resourceKind
required
string
Value: "services"
Example: services

Kind of the Konnect resource

resourceId
required
string <uuid>
Example: bf138ba2-c9b1-4229-b268-04d9d8a6410b

Id of the Konnect resource

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get many documents

Get many documents

Authorizations:
bearerAuth
path Parameters
resourceKind
required
string
Value: "services"
Example: services

Kind of the Konnect resource

resourceId
required
string <uuid>
Example: bf138ba2-c9b1-4229-b268-04d9d8a6410b

Id of the Konnect resource

query Parameters
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.

header Parameters
Accept
string (DocumentContentTypeEnum)
Default: application/json
Enum: "application/json" "application/vnd.konnect.document-tree+json"

Responses

Response samples

Content type
{
  • "meta": {
    },
  • "data": [
    ]
}

Create document

Create document and associate it with a Konnect resource

Authorizations:
bearerAuth
path Parameters
resourceKind
required
string
Value: "services"
Example: services

Kind of the Konnect resource

resourceId
required
string <uuid>
Example: bf138ba2-c9b1-4229-b268-04d9d8a6410b

Id of the Konnect resource

Request Body schema: application/json

document creation

parent_document_id
string or null <uuid>

parent document id

slug
required
string (Slug) <= 80 characters ^[\w-]+$

document slug

status
required
string (PublishStatus)
Enum: "published" "unpublished"
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.

metadata
object or null

metadata of the document

filename
required
string

name of the uploaded file

Responses

Request samples

Content type
application/json
{
  • "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": {
    },
  • "filename": "my_doc.md"
}

Response samples

Content type
application/json
{
  • "document_id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
  • "revision_id": "ecfb698d-77a8-4ab5-91fa-45ee383b48ba"
}

Get the document

Get the document

Authorizations:
bearerAuth
path Parameters
resourceKind
required
string
Value: "services"
Example: services

Kind of the Konnect resource

resourceId
required
string <uuid>
Example: bf138ba2-c9b1-4229-b268-04d9d8a6410b

Id of the Konnect resource

documentId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted document

query Parameters
raw
boolean
Example: raw=true

include raw document data in the response

Responses

Response samples

Content type
{
  • "id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
  • "status": "published",
  • "parent_document_id": "dd4e1b98-3629-4dd3-acc0-759a726ffee2",
  • "slug": "path-for-seo",
  • "created_at": "2023-01-11T02:30:42.227Z",
  • "modified_at": "2023-01-11T02:30:42.227Z",
  • "revision": {
    }
}

Update the document

Update the document

Authorizations:
bearerAuth
path Parameters
resourceKind
required
string
Value: "services"
Example: services

Kind of the Konnect resource

resourceId
required
string <uuid>
Example: bf138ba2-c9b1-4229-b268-04d9d8a6410b

Id of the Konnect resource

documentId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted document

Request Body schema: application/json

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) <= 80 characters ^[\w-]+$

document slug

status
string (PublishStatus)
Enum: "published" "unpublished"
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

metadata
object or null

Responses

Request samples

Content type
application/json
{
  • "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": { }
}

Response samples

Content type
application/json
{
  • "id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
  • "status": "published",
  • "parent_document_id": "dd4e1b98-3629-4dd3-acc0-759a726ffee2",
  • "slug": "path-for-seo",
  • "created_at": "2023-01-11T02:30:42.227Z",
  • "modified_at": "2023-01-11T02:30:42.227Z",
  • "revision": {
    }
}

Delete the document

Delete the document and all its associated revisions including the saved files in the datastore. This is a hard delete, files are not recoverable. Returns 404 if the document cannot be found, 409 if deleting the document would result in other orphaned documents.

Authorizations:
bearerAuth
path Parameters
resourceKind
required
string
Value: "services"
Example: services

Kind of the Konnect resource

resourceId
required
string <uuid>
Example: bf138ba2-c9b1-4229-b268-04d9d8a6410b

Id of the Konnect resource

documentId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted document

Responses

Response samples

Content type
application/problem+json
{
  • "status": 404,
  • "title": "Not Found",
  • "instance": "kong:trace:6816496025408232265",
  • "detail": "Not Found"
}

Move a document

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.

Authorizations:
bearerAuth
path Parameters
resourceKind
required
string
Value: "services"
Example: services

Kind of the Konnect resource

resourceId
required
string <uuid>
Example: bf138ba2-c9b1-4229-b268-04d9d8a6410b

Id of the Konnect resource

documentId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted document

Request Body schema: application/json

move document

parent_document_id
string <uuid>

parent document id

index
integer

index of the document in the parent document's children

Responses

Request samples

Content type
application/json
{
  • "parent_document_id": "dd4e1b98-3629-4dd3-acc0-759a726ffee2",
  • "index": 1
}

Response samples

Content type
application/problem+json
{
  • "status": 0,
  • "title": "string",
  • "type": "string",
  • "instance": "string",
  • "detail": "string",
  • "invalid_parameters": [
    ]
}