cURL
curl --request POST \ --url https://api.letpiper.com/v1/orgs/{org_id}/responses/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "message": "<string>", "session_id": "<string>", "profile_metadata": {} } '
{ "content": "<string>", "role": "assistant", "events": [ { "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "event_type": "user_message", "created_at": "2023-11-07T05:31:56Z", "role": "user", "content": "<string>", "tool_name": "<string>", "tool_call_id": "<string>", "tool_arguments": {}, "parent_tool_call_id": "<string>", "reasoning_effort": "low", "latency_ms": 123, "error_code": "<string>", "error_message": "<string>", "model_name": "<string>", "provider_name": "<string>", "input_tokens": 123, "output_tokens": 123, "cache_read_tokens": 123, "cache_write_tokens": 123, "cost_usd": 123, "code_executed": "<string>", "printed_output": "<string>" } ], "session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
Generate a response from the customer service agent.
Platform token (starts with pat_)
Request schema for generating agent responses.
Single user message. Omit or pass null for greeting generation.
Session ID for conversation threading.
User profile metadata for personalization (e.g., user_name, preferences)
Successful Response
Response schema for agent responses.
"assistant"
Ordered list of all events during execution (tool calls, reasoning, etc.)
Show child attributes