Internal DocumentHub admin Api v2 (0.0.2)

Download OpenAPI specification:Download

DocumentHub admin Api

Collections

document collections operations

List collections

Create a document collection

Authorizations:
konnectAccessToken
query Parameters
sort
string

Sorts a list of collections. Supported sort attributes are:

  • created_at
  • updated_at
  • name
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.

Responses

Response samples

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

Create collection

Create a document collection

Authorizations:
konnectAccessToken
Request Body schema: application/json

collection creation

name
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

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

Get document collection

Authorizations:
konnectAccessToken
path Parameters
collectionId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted collection

Responses

Response samples

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

Create or Update the document collection. collectionId must be globally unique. A collectionId of a different kind (service/portal) must not already exist.

Authorizations:
konnectAccessToken
path Parameters
collectionId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted collection

Request Body schema: application/json

collection put

name
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "my document collection"
}

Response samples

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

Update the document collection

Authorizations:
konnectAccessToken
path Parameters
collectionId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted collection

Request Body schema: application/json

collection update

name
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

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

Delete the document collection

Authorizations:
konnectAccessToken
path Parameters
collectionId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted collection

Responses

Response samples

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

Documents

document operations

List collection documents

List documents in a collection

Authorizations:
konnectAccessToken
path Parameters
collectionId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted collection

query Parameters
sort
string

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

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 put it in a collection

Authorizations:
konnectAccessToken
path Parameters
collectionId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted collection

Request Body schema: application/json

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

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",
  • "created_at": "2022-11-04T20:10:06.927Z",
  • "updated_at": "2022-11-04T20:10:06.927Z"
}

Get a document by slug

Get a document

Authorizations:
konnectAccessToken
path Parameters
collectionId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted collection

query Parameters
slug
required
string
Example: slug=/about/company

Unique slug of the document.

Responses

Response samples

Content type
application/json
{
  • "id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
  • "parent_document_id": "dd4e1b98-3629-4dd3-acc0-759a726ffee2",
  • "slug": "getting-started",
  • "status": "published",
  • "revision": {
    },
  • "created_at": "2022-11-04T20:10:06.927Z",
  • "updated_at": "2022-11-04T20:10:06.927Z"
}

Get the document

Get the document

Authorizations:
konnectAccessToken
path Parameters
collectionId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted collection

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

Targeted document

header Parameters
Accept
string (DocumentFormatContentTypeEnum)
Default: application/json
Enum: "text/markdown" "application/json" "application/vnd.konnect.document-nodes+json"

Responses

Response samples

Content type
{
  • "id": "d32d905a-ed33-46a3-a093-d8f536af9a8a",
  • "parent_document_id": "dd4e1b98-3629-4dd3-acc0-759a726ffee2",
  • "slug": "getting-started",
  • "status": "published",
  • "revision": {
    },
  • "created_at": "2022-11-04T20:10:06.927Z",
  • "updated_at": "2022-11-04T20:10:06.927Z"
}

Delete the document

Delete the document. Returns 404 if the document cannot be found, 409 if deleting the document would result in other orphaned documents.

Authorizations:
konnectAccessToken
path Parameters
collectionId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted collection

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"
}

Update the document

Update the document

Authorizations:
konnectAccessToken
path Parameters
collectionId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted collection

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) <= 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.

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",
  • "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": {
    }
}

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:
konnectAccessToken
path Parameters
collectionId
required
string <uuid>
Example: bb84c46a-432d-4314-81e4-478614a52dcb

Targeted collection

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": [
    ]
}