Ai agents

Execute-Async Ai Agents Events

Execute an AI agent input event asynchronously.

POST
/ai-agents.events.execute-async
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

agentstring

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

Formatid
client_metadata?object

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

Empty Object

context?ai-agent-event-context

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

eventai-agent-event

An event to be processed by an AI agent.

event_source_target?ai-agent-event-source-target

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

session_objectstring

An identifier of a session with an AI agent.

Formattext
target?string
Value in"event_source_target" | "webhook_target"
webhook_target?ai-agent-webhook-target

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

Response Body

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": "unauthenticated"
}
{
  "detail": "string",
  "message": "string",
  "type": "forbidden"
}
{
  "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"
}