Skip to content
中文

Send Events

Call Create session first and replace the example session ID with its returned ID.

POST/anthropic/v1/sessions/{session_id}/events◐ Partial

Official Claude documentation ↗

Request parameters

  • session_idstringrequired

    path: Session ID (path or query parameter).

  • eventsarrayrequired

    Events to send to the session.

Returns

200

Each user.message accepts exactly one nonempty text block. Replace sesn_123 with your session id. Text user.message, user.interrupt, tool confirmation, user.custom_tool_result and system.message are supported. A system.message requires a nonempty array of text blocks; at most one is allowed per request, as the final event immediately after user.message, user.tool_result or user.custom_tool_result. For user.custom_tool_result, take custom_tool_use_id from agent.custom_tool_use.id or the requires_action stop_reason.event_ids. Unlike Anthropic, content accepts only text blocks; other block types return 400. Omitted content becomes an empty array. Omitted or null is_error means false. Do not send session_thread_id: the server routes child calls by id and rejects this request field with 400. Unknown call ids return 400; duplicate results or calls no longer waiting return 409. On /agent/v1, end users can submit results only to their own sessions; another user's session returns 404. user.tool_result remains unsupported. Other input variants and system.message in initial_events are not supported. The response acknowledges inputs; read replies from event history or the stream. A user.message sent while the session waits for tool approval is queued: the returned event has processed_at null and runs in order once the approval is resolved.

Errors follow the Claude Managed Agents format — see error codes

Request

curl
# Call Create session first and replace the example session ID with its returned ID.
curl https://api.deepraxis.com/anthropic/v1/sessions/sesn_123/events \
  -H "x-api-key: $PRAXIS_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: managed-agents-2026-04-01" \
  -H "Content-Type: application/json" \
  -d '{"events":[{"type":"user.message","content":[{"type":"text","text":"你好"}]}]}'
Python
# Call Create session first and replace the example session ID with its returned ID.
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.deepraxis.com/anthropic",
    api_key="$PRAXIS_API_KEY",
)

result = client.beta.sessions.events.send("sesn_123", events=[{"type": "user.message", "content": [{"type": "text", "text": "你好"}]}])
print(result)
TypeScript
// Call Create session first and replace the example session ID with its returned ID.
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://api.deepraxis.com/anthropic",
  apiKey: "$PRAXIS_API_KEY",
});

const result = await client.beta.sessions.events.send("sesn_123", {
  "events": [
    {
      "type": "user.message",
      "content": [
        {
          "type": "text",
          "text": "你好"
        }
      ]
    }
  ]
});
console.log(result);

Response 200

{
  "data": [
    {
      "id": "fa9087de-7935-45fb-b675-4cc50fac7af0",
      "type": "user.message",
      "processed_at": null,
      "content": [
        {
          "type": "text",
          "text": "你好"
        }
      ]
    }
  ]
}

Response

HTTP 200

Successful response

application/json

Name Type Description
data array<object> Sent events
data[].id string Unique identifier for this event.
data[].content array<object> Array of content blocks comprising the user message. / The result content returned by the tool. / The result content returned by the tool. / System content blocks. Text-only.
data[].type string
data[].processed_at null | string | string | null | string | null | string A timestamp in RFC 3339 format
data[].session_thread_id null | string If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread. / Set by the server to the subagent thread this confirmation was routed to. Omitted when it was routed to the primary thread. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.
data[].result string UserToolConfirmationResult enum
data[].tool_use_id string The id of the agent.tool_use or agent.mcp_tool_use event this result corresponds to, which can be found in the last session.status_idle event's stop_reason.event_ids field. / The id of the agent.tool_use event this result corresponds to, which can be found in the last session.status_idle event's stop_reason.event_ids field.
data[].deny_message null | string Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
data[].custom_tool_use_id string The id of the agent.custom_tool_use event this result corresponds to, which can be found in the last session.status_idle event's stop_reason.event_ids field.
data[].is_error null | boolean Whether the tool execution resulted in an error.
data[].description string What the agent should produce. Copied from the input event.
data[].max_iterations null | number Evaluate-then-revise cycles before giving up. Default 3, max 20.
data[].outcome_id string Server-generated outc_ ID for this outcome. Referenced by span.outcome_evaluation_* events and the session's outcome_evaluations list.
data[].rubric object Rubric for grading the quality of an outcome.