Create and optionally trigger a new LRT job
Learn more about create and optionally trigger a new LRT job.
Use the Create and optionally trigger a new LRT job to create and optionally trigger a new LRT job. This lets you start long-running agent work programmatically and track it to completion.
HTTP method and endpoint
Use the following HTTP method and endpoint path to create and optionally trigger a new LRT job.
POST {TenantURL}/ai/agentflow/api/v202605/{tenant_id}/lrt/jobs
The following table describes the endpoint path parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
TenantURL | String | Yes | The base URL for your tenant. |
tenant_id | String | Yes | The tenant identifier. |
Request headers
The following request headers must be included.
| Header | Value | Required |
|---|---|---|
Authorization | <access_token> | Yes |
x-refresh-token | <refresh_token> | Yes |
Content-Type | application/json | Yes |
Request body
The following table describes the request body parameters.
| Parameter | Type | Required | Description | Accepted values / Default |
|---|---|---|---|---|
| query | String | Yes | The prompt or query to submit for execution. | — |
| agent_id | String | Yes | The unique identifier of the agent to run. | — |
| trigger | Boolean | No | Whether to trigger the job immediately after creation. | Default: false |
Example request
Use the following example to see how a complete request is structured, with headers and a JSON body.
POST {TenantURL}/ai/agentflow/api/v202605/tenant-xyz/lrt/jobs
Authorization: <access_token>
x-refresh-token: <refresh_token>
Content-Type: application/json
{
"query": "<your query>",
"agent_id": "<agent_id>",
"trigger": true
}
Response body
The following table describes the fields returned in the response body.
| Parameter | Type | Description |
|---|---|---|
job_id | String | The unique identifier of the LRT job. |
tenant_id | String | The unique identifier of the tenant. |
agent_id | String | The unique identifier of the agent that the job or schedule runs. |
name | String | The display name. |
title | String | The title of the conversation. |
query | String | The prompt or query that was submitted for execution. |
status | String | The status of the job. |
next_run_at | String | The date and time when the job is next queued to run. |
last_run_at | String | The date and time when the last run finished. |
conversation_id | String | The unique identifier of the conversation that the job created. |
bulk_upload | Boolean | Whether the job runs as a bulk file-upload job. |
file_ids | Array | The unique identifiers of the files attached to this job. |
files | Array | The details of each attached file (ID, name, extension, size, record count, and upload time). |
result | Object | The execution result details, when available. |
last_error | String | The most recent error for the job, if any. |
created_at | String | The date and time when the job or schedule was created. |
updated_at | String | The date and time when the record was last updated. |
Example response
The following example shows a response with successful response.
{
"job_id": "0b4720e4-0b1c-41f7-9b53-0ebc907f45f8",
"tenant_id": "tenant-xyz",
"agent_id": "MRA",
"name": "Manual LRT entity processing",
"title": "Process pending entities",
"query": "<string>",
"status": "running",
"next_run_at": "<string>",
"last_run_at": "<string>",
"conversation_id": "<string>",
"bulk_upload": false,
"file_ids": "<value>",
"files": "<value>",
"result": "<value>",
"last_error": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
Error codes and recommended actions
The following table lists the possible error responses returned by this API.
| HTTP status | Description | Recommended action |
|---|---|---|
422 Unprocessable Entity | Validation Error | Review the request parameters or body, correct the invalid values, and resend the request. |