Ai agents

Execute-Async Ai Agents Events

Execute an AI agent input event asynchronously.

POST
/ai-agents.events.execute-async

Execute an AI agent input event asynchronously.

Authorization

auth-token

AuthorizationBearer <token>

All the DevRev APIs require a token to authenticate the user. Provide Authorization: Bearer <TOKEN> as a header to every API request. How do I find my token?

In: header

Request Body

application/json

agent*string

The ID of the AI agent that will consume the event.

Formatid
agent_version?string

The ID of the agent version that will be used for the execution.

Formatid
client_metadata?object

The metadata to be sent to the client with the notifications of execution progress.

context?

Additional metadata to be used by the AI agent for the event.

event*

An event to be processed by an AI agent.

event_source_target?

The source of the event to send notifications to, of asynchronous execution progress.

message_context?

The context for the message to be sent to the client.

parent?string

The ID of the parent object for this agent session. Access to agent session will be determined by access to parent.

Formatid
session_object*string

An identifier of a session with an AI agent.

Formattext
target?string
Value in"event_source_target" | "webhook_target"
webhook_target?

The source of the event to send notifications to, of asynchronous execution progress.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.devrev.ai/ai-agents.events.execute-async" \  -H "Content-Type: application/json" \  -d '{    "agent": "string",    "event": {      "input_message": {        "message": "string"      }    },    "session_object": "string"  }'
{
  "session": {
    "display_id": "string",
    "id": "string"
  }
}
{
  "detail": "string",
  "message": "string",
  "type": "artifact_already_attached_to_a_parent",
  "existing_parent": "string",
  "is_same": true
}
{
  "detail": "string",
  "message": "string",
  "type": "dev_org_deactivated"
}
{
  "detail": "string",
  "message": "string",
  "type": "forbidden",
  "object_ids": [
    "string"
  ]
}
{
  "detail": "string",
  "message": "string",
  "type": "request_entity_too_large",
  "max_bytes": 0
}
{
  "detail": "string",
  "message": "string",
  "type": "too_many_requests",
  "retry_after": 0
}
{
  "detail": "string",
  "message": "string",
  "type": "internal_error",
  "reference_id": "string"
}
{
  "detail": "string",
  "message": "string",
  "type": "service_unavailable"
}