Add Agent Run Wait
curl --request POST \
  --url https://agents-api.kolena.com/api/v1/client/agents/{agent_id}/runs/wait \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form files=@example-file
{
  "agent_id": 1,
  "created": "2025-01-01T00:00:00",
  "data": {
    "prompt_1": {
      "end_time": "2025-01-05T03:05:10.000102",
      "metadata": {
        "citations": [
          {
            "file": "demo1.pdf",
            "pages": [
              2,
              5
            ]
          }
        ],
        "confidence": 1,
        "reasoning": "Looking at file demo1.pdf, ..."
      },
      "start_time": "2025-01-05T03:05:05.000057",
      "status": "success",
      "value": "foo"
    },
    "prompt_2": {
      "end_time": "2025-01-05T03:13:59.000013",
      "metadata": {
        "citations": [
          {
            "file": "demo2.csv"
          }
        ],
        "confidence": 0.9,
        "reasoning": "The order amount is listed in demo2.csv"
      },
      "start_time": "2025-01-05T03:13:45.000051",
      "status": "success",
      "value": 123
    }
  },
  "files": [
    "demo1.pdf",
    "demo2.csv"
  ],
  "order": [
    "prompt_1",
    "prompt_2"
  ],
  "run_id": 1,
  "run_url": "https://agents.kolena.com/my_org/agents/1/runs/1",
  "status": "success",
  "updated": "2025-01-05T00:00:00"
}

Rate Limits

This endpoint is rate limited based on your organization tier:
Organization TierRate Limit (requests/minute)
Starter10
Professional20
Enterprise40
Rate limits are applied per organization.

Handling Timeouts

If the Agent Run takes longer than the request timeout period to complete, this endpoint will return the Agent Run in a running status. In such cases:
  1. The response will indicate the Run is still in progress
  2. You can use the Get Agent Run endpoint to fetch the results later by providing the same run_id

Tips to Avoid Timeouts

To reduce the likelihood of timeouts when using this endpoint:
  1. Use smaller inputs - Upload inputs with minimal content and fewer prompts
  2. Disable “Data Analysis” - If your Agent has Data Analysis enabled, consider disabling it for faster processing
  3. Batch your requests - For large volumes of data, consider using the non-waiting version (Add Agent Run) and poll for results

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>. The <token> represents your API key, which must be acquired from the Kolena platform.

Path Parameters

agent_id
integer
required

Query Parameters

timeout
integer
default:60
Required range: 1 <= x <= 120

Body

multipart/form-data

Response

200
application/json

Successful Response

The response is of type object.