Skip to content

Work Items

V1_KWorkItemAPI23 actions

Work item automation: create work items, add documents, pages and files, read and upsert metadata, read OCR, query state and history. The group to use for new work-item integrations.

Every call in this group

  • Method POST to https://{tenant}/api/{Group}/{Action}, also for reads.
  • Header TempIdentityToken: <token>. Create tokens in Configuration > Services > API Access.
  • Success HTTP 200 with { "Success": true, "MessageKey": ..., "Data": ... }. Always check Success.
  • Failure HTTP 412 with { "Success": false, "Messages": [ { "MessageKey": ... } ] }. The spec lists failures as 400; the server sends 412. HTTP 401 means the token or its features; HTTP 422 means the body does not match the model.
  • C# samples Use the generated client KL.APIClient. Generate the client from your tenant's spec (how). A non-200 status throws KL.APIClient.Client.ApiException.
  • Guides API introduction, Authentication

Actions

Action Summary
AddDocument Add a document, and optionally a File or Metadata, to a Work Item.
AddPage Add a document, and optionally a File or Metadata, to a Work Item.
AddPagesFromBatchFiles Add page files (that were added via StoreBatchFile) to a WorkItem Document.
DeleteWorkItem Completely remove this Work Item and any ascociated files, state, and holds.
GetDocumentFile Get a Document file for a WorkItem.
GetDocumentOcrData Get Ocr data for a Document of a WorkItem.
GetPageFile Get a Page file for a WorkItem.
GetPageOcrData Get Ocr data for a Page of a WorkItem.
GetWorkItem Get a detailed result object representing the contents of the Work Item and its metadata.
GetWorkItemHistory Get the events that have occurred to modify a WorkItem's state
GetWorkState
GetWorkflowHistory Get the Workflow events that have occurred during the processing of a WorkItem
NewWorkItem Create a new Work Item which may later be queued for work.
QueryWorkState
RemoveDocument Remove a Document from a WorkItem.
RemoveDocumentFile Remove a Document file for a WorkItem.
SetDocumentFile Set the file for a document, removing all current document files and pages.
SetDocumentOcr Add ocr to an existing document.
SetPageOcr Add ocr to an existing document.
StoreBatchFile Store a file for a batch, but don't associate it with the batch itself. The result of this should be used by subsequent calls.
UpsertDocumentMetadata Upsert metadata on an existing Work Item Document.
UpsertPageMetadata Upsert metadata on an existing Work Item Page.
UpsertWorkItemMetadata Upsert metadata on an existing Work Item.

AddDocument

POST/api/V1_KWorkItemAPI/AddDocument

Add a document, and optionally a File or Metadata, to a Work Item.

  • Token feature Manage Work Items
  • Content type multipart/form-data

Request

Form fields (multipart/form-data):

Field Type Required Description
WorkItemId string No The Work Item Id to add the document to.
File file No The input file to add to the new document.
FileName string No The name of the document file to upload, including extension.
mimeType string No The MIME type of the document file to upload.
MetadataParameter string No JSON string of a AddPaasDocumentMetadataParameter object. Example KL.Apps.OpenAPI.Controllers.Domain.RequestParameters.PaasWorkItem.AddPaasDocumentMetadataParameter.

Response

WorkItem Document response.

Envelope: KLApiDataResponsePaasWorkItemDocumentIdDTO. Data is PaasWorkItemDocumentIdDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000"
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerAddDocumentAsync(Guid.Parse("00000000-0000-0000-0000-000000000000"), File.OpenRead("document.pdf"), "document.pdf", "application/pdf", "string");
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/AddDocument" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -F "file=@./document.pdf" -F "...other form fields..."

AddPage

POST/api/V1_KWorkItemAPI/AddPage

Add a document, and optionally a File or Metadata, to a Work Item.

  • Token feature Manage Work Items
  • Content type multipart/form-data

Request

Form fields (multipart/form-data):

Field Type Required Description
WorkItemId string No The Work Item Id to add the page to.
DocumentId string No The Work Item Document Id to add the page to.
File file No The input file to add to the new page.
FileName string No The name of the page file to upload, including extension.
mimeType string No The MIME type of the page file to upload.
MetadataParameter string No JSON string of a AddPaasDocumentMetadataParameter object. Example KL.Apps.OpenAPI.Controllers.Domain.RequestParameters.PaasWorkItem.AddPaasDocumentMetadataParameter.

Response

WorkItem Page response.

Envelope: KLApiDataResponsePaasWorkItemPageIdDTO. Data is PaasWorkItemPageIdDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "PageId": "00000000-0000-0000-0000-000000000000"
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerAddPageAsync(Guid.Parse("00000000-0000-0000-0000-000000000000"), Guid.Parse("00000000-0000-0000-0000-000000000000"), File.OpenRead("document.pdf"), "document.pdf", "application/pdf", "string");
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/AddPage" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -F "file=@./document.pdf" -F "...other form fields..."

AddPagesFromBatchFiles

POST/api/V1_KWorkItemAPI/AddPagesFromBatchFiles

Add page files (that were added via StoreBatchFile) to a WorkItem Document.

  • Token feature Manage Work Items
  • Content type application/json

Request

Schema: AddPagesFromBatchFilesParameter

Field Type Description
BlobPageFileInputs array of BlobPageFileInput Pages with files (and optional metadata) that are to be added to the WorkItem document.
WorkItemId string (uuid) WorkItem Id.
DocumentId string (uuid) Document Id.

Response

Work Item Info.

Envelope: KLApiDataResponsePaasWorkItemDocumentIdDTO. Data is PaasWorkItemDocumentIdDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000"
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerAddPagesFromBatchFilesAsync(new AddPagesFromBatchFilesParameter
{
    BlobPageFileInputs = new List<BlobPageFileInput> { new BlobPageFileInput
        {
            PageFileType = PageFileType.Raw,
            PageMetadataToSet = new List<BatchMetadataParameterValue>(),
            Info = new BlobIdentifierWithInfo(),
        } },
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    DocumentId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/AddPagesFromBatchFiles" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"BlobPageFileInputs": [{}], "WorkItemId": "00000000-0000-0000-0000-000000000000", "DocumentId": "00000000-0000-0000-0000-000000000000"}'
$body = @'
{
  "BlobPageFileInputs": [
    {}
  ],
  "WorkItemId": "00000000-0000-0000-0000-000000000000",
  "DocumentId": "00000000-0000-0000-0000-000000000000"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/AddPagesFromBatchFiles" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/AddPagesFromBatchFiles",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "BlobPageFileInputs": [
                      {}
                    ],
                    "WorkItemId": "00000000-0000-0000-0000-000000000000",
                    "DocumentId": "00000000-0000-0000-0000-000000000000"
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/AddPagesFromBatchFiles", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "BlobPageFileInputs": [
      {}
    ],
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000"
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

DeleteWorkItem

POST/api/V1_KWorkItemAPI/DeleteWorkItem

Completely remove this Work Item and any ascociated files, state, and holds.

  • Token feature Manage Work Items
  • Content type application/json

Request

Work Item ID.

Schema: PaasWorkItemIdDTO

Field Type Description
WorkItemId string (uuid)

Response

WorkItem Id response.

Envelope: KLApiDataResponsePaasWorkItemIdDTO. Data is PaasWorkItemIdDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "WorkItemId": "00000000-0000-0000-0000-000000000000"
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerDeleteWorkItemAsync(new PaasWorkItemIdDTO
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/DeleteWorkItem" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000"}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/DeleteWorkItem" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/DeleteWorkItem",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000"
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/DeleteWorkItem", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000"
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

GetDocumentFile

POST/api/V1_KWorkItemAPI/GetDocumentFile

Get a Document file for a WorkItem.

  • Token feature Manage Work Items
  • Content type application/json

Request

Request object to fetch a Document file from a WorkItem..

Schema: GetDocumentFileParameter. Request object to fetch a Document file from a WorkItem.

Field Type Description
WorkItemId string (uuid) Id of the Work Item.
DocumentId string (uuid) Id of the Work Item Document.
DocumentFileId string (uuid) Id of the Work Item DocumentFile.

Response

WorkItem Document file.

Returns file.

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

using var stream = await api.V1KWorkItemAPIControllerGetDocumentFileAsync(new GetDocumentFileParameter
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    DocumentId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    DocumentFileId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
});
using var output = File.Create("download.bin");
await stream.CopyToAsync(output);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetDocumentFile" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000", "DocumentId": "00000000-0000-0000-0000-000000000000", "DocumentFileId": "00000000-0000-0000-0000-000000000000"}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000",
  "DocumentId": "00000000-0000-0000-0000-000000000000",
  "DocumentFileId": "00000000-0000-0000-0000-000000000000"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetDocumentFile" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetDocumentFile",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000",
                    "DocumentId": "00000000-0000-0000-0000-000000000000",
                    "DocumentFileId": "00000000-0000-0000-0000-000000000000"
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetDocumentFile", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "DocumentFileId": "00000000-0000-0000-0000-000000000000"
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

GetDocumentOcrData

POST/api/V1_KWorkItemAPI/GetDocumentOcrData

Get Ocr data for a Document of a WorkItem.

  • Token feature Manage Work Items
  • Content type application/json

Request

Request object to fetch Ocr data for a Document from a WorkItem..

Schema: GetDocumentOcrParameter. Request object to fetch Ocr data for a Document from a WorkItem.

Field Type Description
WorkItemId string (uuid) Id of the Work Item.
DocumentId string (uuid) Id of the Work Item Document.
ExceptionIfMissingPageOcr boolean Avoid exceptioning when a page has not been OCR'd if true (null will be inserted for the page instead)

Response

List of page Ocr results.

Envelope: KLApiDataResponseListPageOcrDTO. Data is array of PageOcrDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": [
    {
      "PageId": "00000000-0000-0000-0000-000000000000",
      "Text": null,
      "Confidence": 0
    }
  ]
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerGetDocumentOcrDataAsync(new GetDocumentOcrParameter
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    DocumentId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    ExceptionIfMissingPageOcr = false,
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetDocumentOcrData" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000", "DocumentId": "00000000-0000-0000-0000-000000000000", "ExceptionIfMissingPageOcr": false}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000",
  "DocumentId": "00000000-0000-0000-0000-000000000000",
  "ExceptionIfMissingPageOcr": false
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetDocumentOcrData" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetDocumentOcrData",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000",
                    "DocumentId": "00000000-0000-0000-0000-000000000000",
                    "ExceptionIfMissingPageOcr": false
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetDocumentOcrData", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "ExceptionIfMissingPageOcr": false
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

GetPageFile

POST/api/V1_KWorkItemAPI/GetPageFile

Get a Page file for a WorkItem.

  • Token feature Manage Work Items
  • Content type application/json

Request

Request object to fetch a Page file from a WorkItem..

Schema: GetPageFileParameter. Request object to fetch a Page file from a WorkItem.

Field Type Description
WorkItemId string (uuid) Id of the Work Item.
DocumentId string (uuid) Id of the Work Item Document.
PageId string (uuid) Id of the Work Item Page.
PageFileId string (uuid) Id of the Work Item PageFile.

Response

WorkItem Page file.

Returns file.

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

using var stream = await api.V1KWorkItemAPIControllerGetPageFileAsync(new GetPageFileParameter
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    DocumentId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    PageId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    PageFileId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
});
using var output = File.Create("download.bin");
await stream.CopyToAsync(output);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetPageFile" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000", "DocumentId": "00000000-0000-0000-0000-000000000000", "PageId": "00000000-0000-0000-0000-000000000000", "PageFileId": "00000000-0000-0000-0000-000000000000"}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000",
  "DocumentId": "00000000-0000-0000-0000-000000000000",
  "PageId": "00000000-0000-0000-0000-000000000000",
  "PageFileId": "00000000-0000-0000-0000-000000000000"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetPageFile" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetPageFile",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000",
                    "DocumentId": "00000000-0000-0000-0000-000000000000",
                    "PageId": "00000000-0000-0000-0000-000000000000",
                    "PageFileId": "00000000-0000-0000-0000-000000000000"
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetPageFile", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "PageId": "00000000-0000-0000-0000-000000000000",
    "PageFileId": "00000000-0000-0000-0000-000000000000"
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

GetPageOcrData

POST/api/V1_KWorkItemAPI/GetPageOcrData

Get Ocr data for a Page of a WorkItem.

  • Token feature Manage Work Items
  • Content type application/json

Request

Request object to fetch Ocr data for a Page from a WorkItem..

Schema: GetPageOcrParameter. Request object to fetch Ocr data for a Page from a WorkItem.

Field Type Description
WorkItemId string (uuid) Id of the Work Item.
DocumentId string (uuid) Id of the Work Item Document.
PageId string (uuid) Id of the Work Item Page.
ExceptionIfMissingPageOcr boolean Avoid exceptioning when a page has not been OCR'd if true (null will be returned instead)

Response

Page Ocr result.

Envelope: KLApiDataResponsePageOcrDTO. Data is PageOcrDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "PageId": "00000000-0000-0000-0000-000000000000",
    "Text": null,
    "Confidence": 0
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerGetPageOcrDataAsync(new GetPageOcrParameter
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    DocumentId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    PageId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    ExceptionIfMissingPageOcr = false,
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetPageOcrData" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000", "DocumentId": "00000000-0000-0000-0000-000000000000", "PageId": "00000000-0000-0000-0000-000000000000", "ExceptionIfMissingPageOcr": false}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000",
  "DocumentId": "00000000-0000-0000-0000-000000000000",
  "PageId": "00000000-0000-0000-0000-000000000000",
  "ExceptionIfMissingPageOcr": false
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetPageOcrData" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetPageOcrData",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000",
                    "DocumentId": "00000000-0000-0000-0000-000000000000",
                    "PageId": "00000000-0000-0000-0000-000000000000",
                    "ExceptionIfMissingPageOcr": false
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetPageOcrData", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "PageId": "00000000-0000-0000-0000-000000000000",
    "ExceptionIfMissingPageOcr": false
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

GetWorkItem

POST/api/V1_KWorkItemAPI/GetWorkItem

Get a detailed result object representing the contents of the Work Item and its metadata.

  • Token feature Manage Work Items
  • Content type application/json

Request

Work Item ID.

Schema: PaasWorkItemIdDTO

Field Type Description
WorkItemId string (uuid)

Response

WorkItem projection.

Envelope: KLApiDataResponseWorkItemProjectionDTO. Data is WorkItemProjectionDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "Name": "",
    "Documents": [],
    "Metadata": {}
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerGetWorkItemAsync(new PaasWorkItemIdDTO
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkItem" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000"}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkItem" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkItem",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000"
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkItem", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000"
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

GetWorkItemHistory

POST/api/V1_KWorkItemAPI/GetWorkItemHistory

Get the events that have occurred to modify a WorkItem's state

  • Token feature Manage Work Items
  • Content type application/json

Request

Work Item ID.

Schema: PaasWorkItemIdDTO

Field Type Description
WorkItemId string (uuid)

Response

WorkItem event history.

Envelope: KLApiDataResponseListWorkItemEventDTO. Data is array of WorkItemEventDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": [
    {
      "EventIndex": 0,
      "Occurred": "0001-01-01T00:00:00.0000000+00:00",
      "EventType": null,
      "EventParameters": null,
      "GroupingEventId": "00000000-0000-0000-0000-000000000000",
      "GroupEventType": null,
      "Hash": null
    }
  ]
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerGetWorkItemHistoryAsync(new PaasWorkItemIdDTO
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkItemHistory" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000"}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkItemHistory" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkItemHistory",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000"
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkItemHistory", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000"
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

GetWorkState

POST/api/V1_KWorkItemAPI/GetWorkState
  • Token feature Manage Work Items
  • Content type application/json

Request

Work Item ID.

Schema: PaasWorkItemIdDTO

Field Type Description
WorkItemId string (uuid)

Response

Work Item Info.

Envelope: KLApiDataResponseWorkItemInfoDTO. Data is WorkItemInfoDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "WorkItem": null,
    "WorkItemName": null,
    "WorkStatus": "Completed"
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerGetWorkStateAsync(new PaasWorkItemIdDTO
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkState" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000"}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkState" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkState",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000"
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkState", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000"
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

GetWorkflowHistory

POST/api/V1_KWorkItemAPI/GetWorkflowHistory

Get the Workflow events that have occurred during the processing of a WorkItem

  • Token feature Manage Work Items
  • Content type application/json

Request

Work Item ID.

Schema: PaasWorkItemIdDTO

Field Type Description
WorkItemId string (uuid)

Response

WorkItem event history.

Envelope: KLApiDataResponseListWorkflowEventDTO. Data is array of WorkflowEventDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": [
    {
      "EventId": "00000000-0000-0000-0000-000000000000",
      "BoolProperties": null,
      "DoubleProperties": null,
      "LongProperties": null,
      "StringProperties": null,
      "DurationMs": null,
      "Scopes": null,
      "UserId": null,
      "OccurredTime": 0,
      "MachineId": null,
      "IndexedEventType": "Standalone",
      "WorkType": null,
      "StepId": null,
      "ProcessVersion": null,
      "ProcessId": null,
      "WorkItemRootId": null,
      "WorkItemId": null,
      "ParentEventId": null,
      "IndexedEventStatus": "Event"
    }
  ]
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerGetWorkflowHistoryAsync(new PaasWorkItemIdDTO
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkflowHistory" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000"}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkflowHistory" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkflowHistory",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000"
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/GetWorkflowHistory", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000"
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

NewWorkItem

POST/api/V1_KWorkItemAPI/NewWorkItem

Create a new Work Item which may later be queued for work.

  • Token feature Manage Work Items
  • Content type application/json

Request

Work Item creation request object..

Schema: WorkItemCreationRequestParameter. Work Item creation request object.

Field Type Description
WorkItemName string Name of the Work Item.
Metadata array of MetadataValueDTO Work item metadata to set initially.
WorkingFormat object Set the working format for this WorkItem.

Response

WorkItem Id response.

Envelope: KLApiDataResponsePaasWorkItemIdDTO. Data is PaasWorkItemIdDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "WorkItemId": "00000000-0000-0000-0000-000000000000"
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerNewWorkItemAsync(new WorkItemCreationRequestParameter
{
    WorkItemName = "string",
    Metadata = new List<MetadataValueDTO> { new MetadataValueDTO
        {
            Bucket = "string",
            Key = "string",
            Value = "string",
        } },
    WorkingFormat = new ConfigureWorkingFormatParameter
    {
        ErrorUnsupportedFiles = new OptionalBooleanValueProperty
        {
            Value = false,
        },
        ColorMode = new OptionalValuePropertyConvertToTiffColorMode
        {
            Value = ConvertToTiffColorMode.Color,
        },
        CompressionType = new OptionalValuePropertyConvertToTiffCompressionType
        {
            Value = ConvertToTiffCompressionType.JPEG,
        },
        ImageDPI = new OptionalIntegerValueProperty
        {
            Value = 0,
        },
        UseOriginalFilesIfSinglepageTiffs = new OptionalBooleanValueProperty
        {
            Value = false,
        },
        JPEGQuality = new OptionalIntegerValueProperty
        {
            Value = 0,
        },
    },
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/NewWorkItem" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemName": "string", "Metadata": [{}], "WorkingFormat": null}'
$body = @'
{
  "WorkItemName": "string",
  "Metadata": [
    {}
  ],
  "WorkingFormat": null
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/NewWorkItem" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/NewWorkItem",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemName": "string",
                    "Metadata": [
                      {}
                    ],
                    "WorkingFormat": null
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/NewWorkItem", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemName": "string",
    "Metadata": [
      {}
    ],
    "WorkingFormat": null
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

QueryWorkState

POST/api/V1_KWorkItemAPI/QueryWorkState
  • Token feature Manage Work Items
  • Content type application/json

Request

Query parameters to run against active work items..

Schema: PaasWorkQueryParameter. Query parameters to run against active work items.

Field Type Description
Skip integer
Take integer
WorkItemName string
MetadataKeyFilter string
MetadataValueFilter string
FilterScope FilterScope
WorkStatusFilter KWorkerWorkStatus
CurrentWorkflowIdFilter string (uuid)
LastWorkedTimeFilter string (date-time)
LastWorkedTimeFilterDirection WorkQueryDateFilterDirection
MetadataToReturn array of MetadataRequest

Response

List of Work Item Info.

Envelope: KLApiDataResponseListWorkItemInfoWithMetadata. Data is array of WorkItemInfoWithMetadata.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": [
    {
      "WorkItemMetadata": null,
      "WorkItem": null,
      "WorkItemName": null,
      "WorkStatus": "Completed"
    }
  ]
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerQueryWorkStateAsync(new PaasWorkQueryParameter
{
    FilterScope = FilterScope.WorkItem,
    WorkStatusFilter = KWorkerWorkStatus.Completed,
    LastWorkedTimeFilterDirection = WorkQueryDateFilterDirection.GreaterThan,
    Skip = 0,
    Take = 0,
    WorkItemName = "string",
    MetadataKeyFilter = "string",
    MetadataValueFilter = "string",
    // More properties: see PaasWorkQueryParameter on the Schemas page
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/QueryWorkState" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"Skip": 0, "Take": 0, "WorkItemName": "string", "MetadataKeyFilter": "string", "MetadataValueFilter": "string", "FilterScope": "WorkItem", "WorkStatusFilter": "Completed", "CurrentWorkflowIdFilter": "00000000-0000-0000-0000-000000000000", "LastWorkedTimeFilter": "2026-01-01T00:00:00Z", "LastWorkedTimeFilterDirection": "GreaterThan", "MetadataToReturn": [{}]}'
$body = @'
{
  "Skip": 0,
  "Take": 0,
  "WorkItemName": "string",
  "MetadataKeyFilter": "string",
  "MetadataValueFilter": "string",
  "FilterScope": "WorkItem",
  "WorkStatusFilter": "Completed",
  "CurrentWorkflowIdFilter": "00000000-0000-0000-0000-000000000000",
  "LastWorkedTimeFilter": "2026-01-01T00:00:00Z",
  "LastWorkedTimeFilterDirection": "GreaterThan",
  "MetadataToReturn": [
    {}
  ]
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/QueryWorkState" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/QueryWorkState",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "Skip": 0,
                    "Take": 0,
                    "WorkItemName": "string",
                    "MetadataKeyFilter": "string",
                    "MetadataValueFilter": "string",
                    "FilterScope": "WorkItem",
                    "WorkStatusFilter": "Completed",
                    "CurrentWorkflowIdFilter": "00000000-0000-0000-0000-000000000000",
                    "LastWorkedTimeFilter": "2026-01-01T00:00:00Z",
                    "LastWorkedTimeFilterDirection": "GreaterThan",
                    "MetadataToReturn": [
                      {}
                    ]
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/QueryWorkState", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "Skip": 0,
    "Take": 0,
    "WorkItemName": "string",
    "MetadataKeyFilter": "string",
    "MetadataValueFilter": "string",
    "FilterScope": "WorkItem",
    "WorkStatusFilter": "Completed",
    "CurrentWorkflowIdFilter": "00000000-0000-0000-0000-000000000000",
    "LastWorkedTimeFilter": "2026-01-01T00:00:00Z",
    "LastWorkedTimeFilterDirection": "GreaterThan",
    "MetadataToReturn": [
      {}
    ]
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

RemoveDocument

POST/api/V1_KWorkItemAPI/RemoveDocument

Remove a Document from a WorkItem.

  • Token feature Manage Work Items
  • Content type application/json

Request

Request object to remove a Document file from a WorkItem..

Schema: GetDocumentParameter. Request object to remove a Document file from a WorkItem.

Field Type Description
WorkItemId string (uuid) Id of the Work Item.
DocumentId string (uuid) Id of the Work Item Document.

Response

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

await api.V1KWorkItemAPIControllerRemoveDocumentAsync(new GetDocumentParameter
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    DocumentId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
});
Console.WriteLine("Done.");
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/RemoveDocument" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000", "DocumentId": "00000000-0000-0000-0000-000000000000"}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000",
  "DocumentId": "00000000-0000-0000-0000-000000000000"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/RemoveDocument" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/RemoveDocument",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000",
                    "DocumentId": "00000000-0000-0000-0000-000000000000"
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/RemoveDocument", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000"
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

RemoveDocumentFile

POST/api/V1_KWorkItemAPI/RemoveDocumentFile

Remove a Document file for a WorkItem.

  • Token feature Manage Work Items
  • Content type application/json

Request

Request object to fetch a Document file from a WorkItem..

Schema: GetDocumentFileParameter. Request object to fetch a Document file from a WorkItem.

Field Type Description
WorkItemId string (uuid) Id of the Work Item.
DocumentId string (uuid) Id of the Work Item Document.
DocumentFileId string (uuid) Id of the Work Item DocumentFile.

Response

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

await api.V1KWorkItemAPIControllerRemoveDocumentFileAsync(new GetDocumentFileParameter
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    DocumentId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    DocumentFileId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
});
Console.WriteLine("Done.");
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/RemoveDocumentFile" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000", "DocumentId": "00000000-0000-0000-0000-000000000000", "DocumentFileId": "00000000-0000-0000-0000-000000000000"}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000",
  "DocumentId": "00000000-0000-0000-0000-000000000000",
  "DocumentFileId": "00000000-0000-0000-0000-000000000000"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/RemoveDocumentFile" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/RemoveDocumentFile",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000",
                    "DocumentId": "00000000-0000-0000-0000-000000000000",
                    "DocumentFileId": "00000000-0000-0000-0000-000000000000"
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/RemoveDocumentFile", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "DocumentFileId": "00000000-0000-0000-0000-000000000000"
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

SetDocumentFile

POST/api/V1_KWorkItemAPI/SetDocumentFile

Set the file for a document, removing all current document files and pages.

  • Token feature Manage Work Items
  • Content type multipart/form-data

Request

Form fields (multipart/form-data):

Field Type Required Description
WorkItemId string No The Work Item Id to add the document to.
DocumentId string No The Document to add the document file to.
File file No The input file to add to the new document.
FileName string No The name of the document file to upload, including extension.
mimeType string No The MIME type of the document file to upload.

Response

WorkItem Document response.

Envelope: KLApiDataResponsePaasWorkItemDocumentFileIdDTO. Data is PaasWorkItemDocumentFileIdDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "DocumentFileId": "00000000-0000-0000-0000-000000000000"
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerSetDocumentFileAsync(Guid.Parse("00000000-0000-0000-0000-000000000000"), Guid.Parse("00000000-0000-0000-0000-000000000000"), File.OpenRead("document.pdf"), "document.pdf", "application/pdf");
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/SetDocumentFile" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -F "file=@./document.pdf" -F "...other form fields..."

SetDocumentOcr

POST/api/V1_KWorkItemAPI/SetDocumentOcr

Add ocr to an existing document.

  • Token feature Manage Work Items
  • Content type application/json

Request

Request object to Set OCR data for a Document..

Schema: SetDocumentOcrParameter. Request object to Set OCR data for a Document.

Field Type Description
WorkItemId string (uuid) WorkItem Id.
DocumentId string (uuid) Document Id.
Ocr object The Document Ocr.

Response

WorkItem Document File response.

Envelope: KLApiDataResponsePaasWorkItemDocumentFileIdDTO. Data is PaasWorkItemDocumentFileIdDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "DocumentFileId": "00000000-0000-0000-0000-000000000000"
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerSetDocumentOcrAsync(new SetDocumentOcrParameter
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    DocumentId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    Ocr = new APIOcrContainer
    {
        ChildrensLevel = OcrIteratorLevel.Document,
        OcrEngineName = "string",
        Text = "string",
        Confidence = 0,
        Bounds = new ApiRect
        {
            X = 0,
            Y = 0,
            Width = 0,
            Height = 0,
        },
        Children = new List<APIOcrContainer> { new APIOcrContainer() },
    },
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/SetDocumentOcr" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000", "DocumentId": "00000000-0000-0000-0000-000000000000", "Ocr": null}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000",
  "DocumentId": "00000000-0000-0000-0000-000000000000",
  "Ocr": null
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/SetDocumentOcr" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/SetDocumentOcr",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000",
                    "DocumentId": "00000000-0000-0000-0000-000000000000",
                    "Ocr": null
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/SetDocumentOcr", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "Ocr": null
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

SetPageOcr

POST/api/V1_KWorkItemAPI/SetPageOcr

Add ocr to an existing document.

  • Token feature Manage Work Items
  • Content type application/json

Request

Request object to Set OCR data for a Page..

Schema: SetPageOcrParameter. Request object to Set OCR data for a Page.

Field Type Description
WorkItemId string (uuid) WorkItem Id.
DocumentId string (uuid) Document Id.
PageId string (uuid) Page Id.
Ocr object The Page Ocr.

Response

WorkItem Page File response.

Envelope: KLApiDataResponsePaasWorkItemPageFileIdDTO. Data is PaasWorkItemPageFileIdDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "PageId": "00000000-0000-0000-0000-000000000000",
    "PageFileId": "00000000-0000-0000-0000-000000000000"
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerSetPageOcrAsync(new SetPageOcrParameter
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    DocumentId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    PageId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    Ocr = new APIOcrContainer
    {
        ChildrensLevel = OcrIteratorLevel.Document,
        OcrEngineName = "string",
        Text = "string",
        Confidence = 0,
        Bounds = new ApiRect
        {
            X = 0,
            Y = 0,
            Width = 0,
            Height = 0,
        },
        Children = new List<APIOcrContainer> { new APIOcrContainer() },
    },
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/SetPageOcr" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000", "DocumentId": "00000000-0000-0000-0000-000000000000", "PageId": "00000000-0000-0000-0000-000000000000", "Ocr": null}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000",
  "DocumentId": "00000000-0000-0000-0000-000000000000",
  "PageId": "00000000-0000-0000-0000-000000000000",
  "Ocr": null
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/SetPageOcr" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/SetPageOcr",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000",
                    "DocumentId": "00000000-0000-0000-0000-000000000000",
                    "PageId": "00000000-0000-0000-0000-000000000000",
                    "Ocr": null
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/SetPageOcr", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "PageId": "00000000-0000-0000-0000-000000000000",
    "Ocr": null
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

StoreBatchFile

POST/api/V1_KWorkItemAPI/StoreBatchFile

Store a file for a batch, but don't associate it with the batch itself. The result of this should be used by subsequent calls.

  • Token feature Manage Work Items
  • Content type multipart/form-data

Request

Form fields (multipart/form-data):

Field Type Required Description
WorkItemId string No The Work Item Id.
File file No The input file to store with the batch.
FileName string No The name of the batch file to upload, including extension.
mimeType string No The MIME type of the batch file to upload.

Response

WorkItem Document response.

Envelope: KLApiDataResponseBlobIdentifierWithInfo. Data is BlobIdentifierWithInfo.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "FetchBinaryStrategyId": null,
    "Hash": null,
    "Length": 0,
    "FileNameHint": null,
    "MimeType": null,
    "BlobId": null,
    "ContainerName": null,
    "ConnectionStringName": null,
    "BlobStorageSystemId": null
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerStoreBatchFileAsync(Guid.Parse("00000000-0000-0000-0000-000000000000"), File.OpenRead("document.pdf"), "document.pdf", "application/pdf");
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/StoreBatchFile" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -F "file=@./document.pdf" -F "...other form fields..."

UpsertDocumentMetadata

POST/api/V1_KWorkItemAPI/UpsertDocumentMetadata

Upsert metadata on an existing Work Item Document.

  • Token feature Manage Work Items
  • Content type application/json

Request

Object defining metadata to be set on a WorkItem Document..

Schema: UpsertPaasDocumentMetadataParameter. Object defining metadata to be set on a WorkItem Document.

Field Type Description
WorkItemId string (uuid) Id of the Work Item
DocumentId string (uuid) Id of the affected Document
Metadata array of MetadataValueDTO Metadata to set on the Document

Response

WorkItem Document response.

Envelope: KLApiDataResponsePaasWorkItemDocumentIdDTO. Data is PaasWorkItemDocumentIdDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000"
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerUpsertDocumentMetadataAsync(new UpsertPaasDocumentMetadataParameter
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    DocumentId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    Metadata = new List<MetadataValueDTO> { new MetadataValueDTO
        {
            Bucket = "string",
            Key = "string",
            Value = "string",
        } },
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/UpsertDocumentMetadata" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000", "DocumentId": "00000000-0000-0000-0000-000000000000", "Metadata": [{}]}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000",
  "DocumentId": "00000000-0000-0000-0000-000000000000",
  "Metadata": [
    {}
  ]
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/UpsertDocumentMetadata" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/UpsertDocumentMetadata",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000",
                    "DocumentId": "00000000-0000-0000-0000-000000000000",
                    "Metadata": [
                      {}
                    ]
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/UpsertDocumentMetadata", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "Metadata": [
      {}
    ]
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

UpsertPageMetadata

POST/api/V1_KWorkItemAPI/UpsertPageMetadata

Upsert metadata on an existing Work Item Page.

  • Token feature Manage Work Items
  • Content type application/json

Request

Object defining metadata to be set on a WorkItem Page..

Schema: UpsertPaasPageMetadataParameter. Object defining metadata to be set on a WorkItem Page.

Field Type Description
WorkItemId string (uuid) Id of the Work Item
DocumentId string (uuid) Id of the affected Document
PageId string (uuid) Id of the affected Pasge
Metadata array of MetadataValueDTO Metadata to set on the Page

Response

WorkItem Page response.

Envelope: KLApiDataResponsePaasWorkItemPageIdDTO. Data is PaasWorkItemPageIdDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "PageId": "00000000-0000-0000-0000-000000000000"
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerUpsertPageMetadataAsync(new UpsertPaasPageMetadataParameter
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    DocumentId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    PageId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    Metadata = new List<MetadataValueDTO> { new MetadataValueDTO
        {
            Bucket = "string",
            Key = "string",
            Value = "string",
        } },
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/UpsertPageMetadata" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000", "DocumentId": "00000000-0000-0000-0000-000000000000", "PageId": "00000000-0000-0000-0000-000000000000", "Metadata": [{}]}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000",
  "DocumentId": "00000000-0000-0000-0000-000000000000",
  "PageId": "00000000-0000-0000-0000-000000000000",
  "Metadata": [
    {}
  ]
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/UpsertPageMetadata" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/UpsertPageMetadata",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000",
                    "DocumentId": "00000000-0000-0000-0000-000000000000",
                    "PageId": "00000000-0000-0000-0000-000000000000",
                    "Metadata": [
                      {}
                    ]
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/UpsertPageMetadata", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "DocumentId": "00000000-0000-0000-0000-000000000000",
    "PageId": "00000000-0000-0000-0000-000000000000",
    "Metadata": [
      {}
    ]
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);

UpsertWorkItemMetadata

POST/api/V1_KWorkItemAPI/UpsertWorkItemMetadata

Upsert metadata on an existing Work Item.

  • Token feature Manage Work Items
  • Content type application/json

Request

Object defining metadata to be set on a WorkItem..

Schema: UpsertPaasWorkItemMetadataParameter. Object defining metadata to be set on a WorkItem.

Field Type Description
WorkItemId string (uuid) Id of the Work Item
Metadata array of MetadataValueDTO Metadata to set on the Work Item

Response

WorkItem Id response.

Envelope: KLApiDataResponsePaasWorkItemIdDTO. Data is PaasWorkItemIdDTO.

Example response
{
  "Success": true,
  "MessageKey": null,
  "Data": {
    "WorkItemId": "00000000-0000-0000-0000-000000000000"
  }
}

Example

using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;

var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1KWorkItemAPIApi(config);

var response = await api.V1KWorkItemAPIControllerUpsertWorkItemMetadataAsync(new UpsertPaasWorkItemMetadataParameter
{
    WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
    Metadata = new List<MetadataValueDTO> { new MetadataValueDTO
        {
            Bucket = "string",
            Key = "string",
            Value = "string",
        } },
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/UpsertWorkItemMetadata" \
  -H "TempIdentityToken: $KL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"WorkItemId": "00000000-0000-0000-0000-000000000000", "Metadata": [{}]}'
$body = @'
{
  "WorkItemId": "00000000-0000-0000-0000-000000000000",
  "Metadata": [
    {}
  ]
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/UpsertWorkItemMetadata" `
  -Headers @{ TempIdentityToken = $env:KL_TOKEN } `
  -ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests

r = requests.post("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/UpsertWorkItemMetadata",
                  headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
                  json={
                    "WorkItemId": "00000000-0000-0000-0000-000000000000",
                    "Metadata": [
                      {}
                    ]
                  })
data = r.json()
if not data.get("Success"):
    raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_KWorkItemAPI/UpsertWorkItemMetadata", {
  method: "POST",
  headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
  body: JSON.stringify({
    "WorkItemId": "00000000-0000-0000-0000-000000000000",
    "Metadata": [
      {}
    ]
  })
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);