RPA Tasks¶
Query the latest attempt of each RPA task, and rerun a task.
Every call in this group
- Method
POSTtohttps://{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 checkSuccess. - 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 throwsKL.APIClient.Client.ApiException. - Guides API introduction, Authentication
Actions¶
| Action | Summary |
|---|---|
| QueryForLatestRPATasks | Retrieves monitor data for all RPA Tasks, or RPA Tasks specified by filters, and returns the latest attempt of each task. A task that has been rerun reports the bot, message and runstamp of its latest attempt only - earlier attempts are not returned and cannot be queried through this endpoint. The response carries no total - request successive pages until one comes back with fewer entries than the requested page size. |
| ResubmitRPATask | Reruns the RPA Task by identifier, optionally with a new payload. |
QueryForLatestRPATasks¶
Retrieves monitor data for all RPA Tasks, or RPA Tasks specified by filters, and returns the latest attempt of each task. A task that has been rerun reports the bot, message and runstamp of its latest attempt only - earlier attempts are not returned and cannot be queried through this endpoint. The response carries no total - request successive pages until one comes back with fewer entries than the requested page size.
- Token feature Get Bots
- Content type application/json
Request¶
Schema: QueryRPATasksParameter. Pass an object with rpa task properties to filter the rpa query results. All properties are optional.
| Field | Type | Description |
|---|---|---|
TaskIdentifier |
string | (Optional) Filter to the task with this identifier, in the form '{TaskNumber}.{RunNumber}'. Only the TaskNumber portion is used - the RunNumber is ignored, and the task is always returned at its latest run. Omit the property to query without an identifier filter; an empty or otherwise malformed value is rejected rather than ignored. |
Status |
object | (Optional) Filter to tasks currently in this status (e.g. Queued, Running, Complete, Cancelled, Hold, Error) |
BotName |
string | (Optional) Filter to tasks whose latest run was executed by a bot with this name. Tasks where only an earlier attempt ran on this bot are not matched. The comparison is case-INsensitive, and a value that matches no bot is rejected rather than ignored. |
Automation |
string | (Optional) Filter to tasks whose automation name matches this value. The comparison is case-INsensitive. A value that matches no automation is rejected rather than ignored. |
Process |
string | (Optional) Filter to tasks whose process name matches this value. The comparison is case-INsensitive. A blank value is rejected rather than ignored; a non-blank value that matches no process returns no tasks. |
LastUpdateTimeAfter |
string (date-time) | (Optional) Filter to tasks whose last update time is strictly greater than this datetime. The value is compared exactly as supplied - it is not converted to or from UTC, so pass it in the same zone the tasks were recorded in. |
PageIndex |
integer | (Optional - Default is 0) The page division (starts at 0). A negative value is clamped to 0 rather than rejected. |
PageSize |
integer | (Optional - Default is 20) Max size of the result list. Zero or a negative value falls back to 20; a value above the 1000 maximum is clamped to 1000 rather than rejected. |
OrderBy |
object | (Optional - Default is LastUpdated) The column the results are sorted by. An unset value sorts by LastUpdated, not by task identifier. |
Direction |
object | (Optional - Default is Descending) The direction the results are sorted in. Any value other than Ascending sorts Descending, and unlike the Jobs and Processing queries an unset direction sorts Descending here. |
Response¶
Returns the requested RPA Tasks supplied by filters
Envelope: DataResponseQueryRPATaskResponse. Data is array of RPATaskEntryDTO.
{
"Success": true,
"MessageKey": null,
"Data": [
{
"TaskIdentifier": "1.1",
"Status": "Complete",
"Message": "",
"BotName": "Example Bot",
"Runstamp": "20201117-222444018",
"Automation": "Invoice Capture",
"Process": "Index Documents",
"LastUpdated": "2026-10-07T20:19:08.9218489+00:00"
}
]
}
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 V1RPAAPIApi(config);
var response = await api.V1RPAAPIControllerQueryForLatestRPATasksAsync(new QueryRPATasksParameter
{
Status = RPATaskStatus.Queued,
OrderBy = RPATaskColumns.JobNumber,
Direction = SortDirection.Ascending,
TaskIdentifier = "string",
BotName = "string",
Automation = "string",
Process = "string",
LastUpdateTimeAfter = DateTime.Parse("2026-01-01T00:00:00Z"),
// More properties: see QueryRPATasksParameter 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_RPAAPI/QueryForLatestRPATasks" \
-H "TempIdentityToken: $KL_TOKEN" \
-H "Content-Type: application/json" \
-d '{"TaskIdentifier": "string", "Status": null, "BotName": "string", "Automation": "string", "Process": "string", "LastUpdateTimeAfter": "2026-01-01T00:00:00Z", "PageIndex": 0, "PageSize": 0, "OrderBy": null, "Direction": null}'
$body = @'
{
"TaskIdentifier": "string",
"Status": null,
"BotName": "string",
"Automation": "string",
"Process": "string",
"LastUpdateTimeAfter": "2026-01-01T00:00:00Z",
"PageIndex": 0,
"PageSize": 0,
"OrderBy": null,
"Direction": null
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_RPAAPI/QueryForLatestRPATasks" `
-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_RPAAPI/QueryForLatestRPATasks",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={
"TaskIdentifier": "string",
"Status": null,
"BotName": "string",
"Automation": "string",
"Process": "string",
"LastUpdateTimeAfter": "2026-01-01T00:00:00Z",
"PageIndex": 0,
"PageSize": 0,
"OrderBy": null,
"Direction": 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_RPAAPI/QueryForLatestRPATasks", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({
"TaskIdentifier": "string",
"Status": null,
"BotName": "string",
"Automation": "string",
"Process": "string",
"LastUpdateTimeAfter": "2026-01-01T00:00:00Z",
"PageIndex": 0,
"PageSize": 0,
"OrderBy": null,
"Direction": null
})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);
ResubmitRPATask¶
Reruns the RPA Task by identifier, optionally with a new payload.
- Token feature Manage Bots
- Content type application/json
Request¶
An object identifying the RPA Task to rerun. TaskIdentifier is required.
Schema: ResumbitRPATasksParameter. An object identifying the task to rerun
| Field | Type | Description |
|---|---|---|
TaskIdentifier |
string | The identifier of the rpa task to rerun, in the form '{TaskNumber}.{RunNumber}' |
Payload |
string | (Optional) The payload to run the task with. If omitted, the task is re-run with its original payload. |
Response¶
RPA Task was successfully resubmitted
Envelope: KLApiResponse.
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 V1RPAAPIApi(config);
var response = await api.V1RPAAPIControllerResubmitRPATaskAsync(new ResumbitRPATasksParameter
{
TaskIdentifier = "string",
Payload = "string",
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response);
$body = @'
{
"TaskIdentifier": "string",
"Payload": "string"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_RPAAPI/ResubmitRPATask" `
-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_RPAAPI/ResubmitRPATask",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={
"TaskIdentifier": "string",
"Payload": "string"
})
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_RPAAPI/ResubmitRPATask", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({
"TaskIdentifier": "string",
"Payload": "string"
})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);