Frontend API
Execute the agent with a new message in the context
cURL
curl --request POST \ --url https://api.wacht.dev/agent/contexts/{id}/execute \ --header 'Content-Type: multipart/form-data' \ --cookie session_id= \ --form 'message=Hello, can you help me?' \ --form 'files=<string>' \ --form files.items='@example-file'
{ "status": 200, "message": "", "data": { "message": { "id": "msg_abc123", "message_type": "user", "content": { "type": "text", "text": "Hello, how can you help?" }, "timestamp": "2024-01-15T10:30:00Z", "metadata": {} }, "status": "complete", "tool_calls": [], "usage": { "prompt_tokens": 123, "completion_tokens": 123, "total_tokens": 123 } }, "session": { "id": "123456789012345678", "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z" }, "errors": [ { "code": "INVALID_CREDENTIALS", "message": "Invalid credentials. Please try again." } ] }
Session-based authentication using cookies
Context ID
User message to send to the agent
"Hello, can you help me?"
Optional file attachments
Agent response
HTTP status code
200
Response message (empty on success)
""
Show child attributes
Minimal session info included in every response
Error details (null on success)
Was this page helpful?