Kissflow DocsHelp center

Agent API

Authenticate, call the Custom Agent REST routes, start a run, read its status and results, and handle reported errors.

Use the Agent API to start a published agent and read its background run. This reference covers authentication, the REST routes, the start, test and read endpoints, run statuses, and reported error codes. Keep the execution ID from every accepted start so you can inspect the existing run before considering another.

Video: Agent API

Authentication and access

Use a signed-in Kissflow session or both access-key headers. The user or service account needs App Admin, Edit, or View permission on the app. Tool actions use their own connection accounts.

HeaderValue
X-Access-Key-IdYour access-key ID
X-Access-Key-SecretYour access-key secret
Content-Typeapplication/json for the POST body

Keep access-key secrets on your server. App pages can use the signed-in session through the SDK.

Address parameters

Replace the placeholders with values from the target environment. Find the account ID and create an access key as described in How do I authenticate Kissflow API calls and find the IDs. That article also shows how to read IDs from a URL.

PlaceholderMeaning
BASE_URLYour Kissflow environment's HTTPS origin, without a trailing slash
AccountIdTarget account ID. Copy it under API authentication in My settings.
AppIdApp containing the agent. It is in the app's address: .../view/application/<AppId>.
AgentIdPublished agent to run. Call GET /custom-agent to list the app's agents and read the ID there.
ExecutionIdID returned when the run starts

Routes

All routes sit under /agent/2/{AccountId}/application/{AppId}/custom-agent.

Method and pathPurpose
POST /Create an agent. Returns 201.
GET /List the app's agents.
GET /{AgentId}App Admins and Editors read the Draft, optional Live definition, and readiness. Viewers use /{AgentId}/live.
PUT /{AgentId}Update the Draft.
DELETE /{AgentId}Delete the agent. Its execution history is kept.
GET /{AgentId}/liveRead the published invocation contract: display fields, inputs, outputs, MaxOutputItems, and readiness.
POST /{AgentId}/publishCopy the Draft to Live.
POST /{AgentId}/testRun the Draft. Takes the same body as /execute.
POST /{AgentId}/executeRun Live.
GET /{AgentId}/executionList runs (see below).
GET /{AgentId}/execution/{ExecutionId}Read one run.

Creating, updating, deleting, testing and publishing work only in the app's Development account; elsewhere they fail with KISSFLOW_ERROR_20601. Running Live (/execute) and reading runs work wherever the agent is deployed.

Start a run

POST /agent/2/{AccountId}/application/{AppId}/custom-agent/{AgentId}/execute

Pass an InputData object. Use the exact configured input Key values, including spelling and case. The following keys are examples; replace them with your own. POST /{AgentId}/test takes the same envelope, so you can test the Draft with any inputs you choose; they are validated like a normal run. A test runs real tools. It doesn't use a Live run slot. See Limits.

{
  "InputData": {
    "VendorName": "Example supplier",
    "PurchaseOrderAmount": 1200,
    "NeedsReview": true
  }
}
Input type (API label)Value
TextString
NumberNumber
Boolean (Yes/No)true or false
Attachment (File)A Kissflow file as {"Key": "...", "FileName": "..."}, or a direct link as {"Url": "https://.../invoice.pdf", "FileName": "invoice.pdf"}. See file guidance below.

Supply every required input. Each agent supports up to 15 inputs, including at most one File input.

curl --request POST \
  'https://<BASE_HOST>/agent/2/<ACCOUNT_ID>/application/<APP_ID>/custom-agent/<AGENT_ID>/execute' \
  --header 'X-Access-Key-Id: <ACCESS_KEY_ID>' \
  --header 'X-Access-Key-Secret: <ACCESS_KEY_SECRET>' \
  --header 'Content-Type: application/json' \
  --data '{"InputData":{"VendorName":"Example supplier","PurchaseOrderAmount":1200,"NeedsReview":true}}'

The start response is HTTP 202 and contains ExecutionId and Status. Save both.

{
  "ExecutionId": "<EXECUTION_ID>",
  "Status": "Queued"
}

202 means the request was accepted, not that the run finished. The placeholder host above is the host portion of BASE_URL. There is no cancel endpoint and no re-execute endpoint.

For a File input, use PDF, PNG, JPG, or JPEG, up to 5 MB; PDFs support up to 10 pages. A direct link must be https, can't redirect, and can't point to a private host; Kissflow redacts the URL from run history after the run. A signed URL that expires before the worker picks it up fails with KISSFLOW_ERROR_20419, which is retryable. A required file that cannot be loaded fails the run; an optional file unavailable at pickup may be skipped with a warning. Invalid formats, excessive size or page count, and unsafe URLs still fail the run.

Read a run

GET /agent/2/{AccountId}/application/{AppId}/custom-agent/{AgentId}/execution/{ExecutionId}
curl --request GET \
  'https://<BASE_HOST>/agent/2/<ACCOUNT_ID>/application/<APP_ID>/custom-agent/<AGENT_ID>/execution/<EXECUTION_ID>' \
  --header 'X-Access-Key-Id: <ACCESS_KEY_ID>' \
  --header 'X-Access-Key-Secret: <ACCESS_KEY_SECRET>'

Read the same execution until it reaches a terminal status. Each execution has a Stage of Draft (a test run) or Live. Completed runs return structured results shaped as {"items":[{...}]}: up to 10 rows, with up to 10 output fields per row. Output values are string, number or boolean. A Number output holds only a number. An empty items list is valid. Failed runs report an error code and whether trying again could help; they return no partial results.

The run record includes status, results, timestamps and any error. It doesn't include the agent's messages, prompts or tool calls, for any caller. To see why an agent answered as it did, add a Reason output.

Status (API value)MeaningYour next step
QueuedWaiting for an account run slotKeep the ID and read later.
NotStartedAccepted; not running yetRead later.
RunningPerforming the taskRead later.
CompletedResults availableValidate and consume outputs.
FailedStopped without resultsInspect the error and tool effects.

List runs

GET /agent/2/{AccountId}/application/{AppId}/custom-agent/{AgentId}/execution?PageNumber=1&PageSize=20

PageNumber defaults to 1. PageSize defaults to 20 and is capped at 50. Runs are returned newest first. App Admins and Editors can read all runs of the app's agents. Users with View permission read only their own. The latest run is kept; older runs and test runs expire.

Editing a Draft can affect a queued test. Publishing can affect a queued Live run.

Errors

These are the reported codes documented for agent use and configuration. Configuration codes can require changes in development followed by publishing or deployment.

CodeMessage or meaningAction
KISSFLOW_ERROR_20600"Custom Agent is not found or is outside this Application."Check AgentId and AppId.
KISSFLOW_ERROR_20604"The Application is not available for new Agent requests."Check the app's state, then retry.
KISSFLOW_ERROR_20607"The Agent did not return a valid structured result."Clarify output definitions.
KISSFLOW_ERROR_20608"The Agent execution failed. Review the execution details before trying again."Check what tools already did before rerunning.
KISSFLOW_ERROR_20609"The Agent execution exceeded its time limit."Narrow the task.
KISSFLOW_ERROR_20611Another publish finished at the same time.Publish again to apply the Draft.
KISSFLOW_ERROR_20612"The Agent made too many web searches and was stopped. Narrow its instructions, then run it again."Ask for one search per topic.
KISSFLOW_ERROR_20613"The Agent was stopped before repeating an action after a web search stop. Check its tool calls before running it again."Check actions already taken before rerunning.
KISSFLOW_ERROR_20420"Internal agent capacity is currently unavailable. Please retry shortly."Retry after a short wait.
KISSFLOW_INTERNAL_ERROR_600001The run exceeded its reasoning-step or tool-use limit. See Limits.Simplify instructions and tool use.
KISSFLOW_ERROR_20417Unsupported file typeUse a supported PDF or image.
KISSFLOW_ERROR_20418File size or page limit exceededReduce the file size or page count.
KISSFLOW_ERROR_20416File could not be processedUpload again; contact support if it persists.
KISSFLOW_ERROR_20419File could not be downloaded (retryable)Upload again; contact support if it persists.
KISSFLOW_GEN_AI_ERROR_00205Hourly AI usage limit reachedWait; contact support if frequent.
KISSFLOW_GEN_AI_ERROR_00206Hourly AI usage limit reachedWait; contact support if frequent.
KISSFLOW_ERROR_20603"Complete the Custom Agent configuration before publishing or executing."Finish the setup in AI Builder and publish.
KISSFLOW_ERROR_20601"Custom Agents can only be authored in the Development account."Change in development, then deploy.
KISSFLOW_ERROR_20602"The Application has reached its Custom Agent limit." (100 per app)Review agents no longer needed.
KISSFLOW_ERROR_15009Too many requests (account API rate limit)Wait 30 seconds, then try again. See HTTP 429.

Retry and cancellation behavior

Runs never retry automatically and cannot be canceled after starting. The SDK and API never auto-retry execute. Tools may already have acted when a run fails. Disable automatic start-request retries in your client.

If a start response is lost, read the run first when you have its ID. Without an ID, reconcile available run history and affected records before submitting again. An error indicating that retry could help does not guarantee that repeating actions is safe. Space GET requests to respect standard API rate limits.

On this page