The AgenticPal API provides RESTful endpoints for programmatic access to the agent. It supports synchronous responses, streaming via Server-Sent Events (SSE), and conversation management.Base URL:http://localhost:8000 (development)
{ "response": "I found 15 draft emails. Are you sure you want to delete all of them?", "thread_id": "thread_abc123", "requires_confirmation": true, "confirmation_message": "This will permanently delete 15 draft emails. Confirm?", "actions": [ { "id": "action_1", "tool": "delete_emails", "success": false, "result": null } ]}
Conversations are organized by thread IDs for context management:
import requestsimport uuid# Create a new threadthread_id = str(uuid.uuid4())# First messageresponse1 = requests.post( "http://localhost:8000/chat", cookies={"session_id": "your-session-id"}, json={ "user_message": "Schedule a meeting for tomorrow", "thread_id": thread_id })# Follow-up message in same threadresponse2 = requests.post( "http://localhost:8000/chat", cookies={"session_id": "your-session-id"}, json={ "user_message": "Make it at 2pm", "thread_id": thread_id # Same thread for context })
If you don’t provide a thread_id, the API will generate one automatically. Include it in follow-up requests to maintain conversation context.