Skip to main content
POST
/
api
/
agents
/
{agentId}
/
run-async
cURL
curl --request POST \
  --url https://app.cotool.ai/api/agents/{agentId}/run-async \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "inputs": {},
  "attachments": [
    {
      "fileId": "<string>",
      "fileName": "<string>",
      "mimeType": "<string>",
      "size": 123,
      "objectPath": "<string>",
      "fileType": "image",
      "previewText": "<string>"
    }
  ]
}'
{
  "runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Authorizations

Authorization
string
header
required

API Key authentication for programmatic access. Include your API key in the Authorization header as: Bearer your_api_key_here

Path Parameters

agentId
string<uuid>
required

Unique identifier of the agent to execute

Body

application/json

Input values for agent execution based on agent input configuration

inputs
object
required

Input values for agent execution based on agent input configuration. This can be any JSON object and will be stringified as input to the agent.

attachments
object[]

Optional array of file attachments to include with the agent execution

Response

200 - application/json

Successful response

Response containing run ID for asynchronous agent execution

runId
string<uuid>
required

Unique identifier for this asynchronous agent run that can be polled for status