Skip to main content
POST
/
agents
/
{agentId}
/
runs
Start Agent Run
curl --request POST \
  --url https://api.ag.dev/v0.1/agents/{agentId}/runs \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{}'
{
  "id": "<string>",
  "agentId": "<string>",
  "input": {},
  "status": "pending",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "error": {
    "code": "<string>",
    "message": "<string>"
  },
  "resultType": "document",
  "resultData": {
    "result": "<string>",
    "sources": [
      {
        "url": "<string>",
        "title": "<string>"
      }
    ]
  }
}

Authorizations

X-API-Key
string
header
required

Path Parameters

agentId
string
required

Agent ID

Body

application/json · object

Input data that matches the agent's input schema

Response

Run created successfully

  • Option 1
  • Option 2
  • Option 3
  • Option 4
id
string
required

Unique identifier for the run

agentId
string
required

ID of the agent that executed this run

input
object
required

Input data provided for the run

status
enum<string>
required

Current status of the run

Available options:
pending,
running,
done,
error
createdAt
string<date-time>
required

Run creation timestamp

updatedAt
string<date-time>
required

Run last update timestamp

error
object

Error information (only present when status is 'error')

resultType
enum<string> | null

Type of result (null until run completes)

Available options:
document,
json
resultData
object

The result data (null until run completes successfully)

  • Option 1
  • Option 2