Skip to main content
POST
/
v1
/
orgs
/
{org_id}
/
responses
Create Response
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"
}

Authorizations

Authorization
string
header
required

Platform token (starts with pat_)

Path Parameters

org_id
string<uuid>
required

Query Parameters

include_events
boolean
default:true

Body

application/json

Request schema for generating agent responses.

agent_id
string<uuid>
required
message
string | null

Single user message. Omit or pass null for greeting generation.

session_id
string | null

Session ID for conversation threading.

profile_metadata
Profile Metadata · object

User profile metadata for personalization (e.g., user_name, preferences)

Response

Successful Response

Response schema for agent responses.

content
string
required
role
string
default:assistant
Allowed value: "assistant"
events
RunEventSchema · object[] | null

Ordered list of all events during execution (tool calls, reasoning, etc.)

session_id
string<uuid> | null
run_id
string<uuid> | null