イベントを送信
POST/v1/sessions/{session_id}/events
イベントを送信
Parameters
Returns
イベントを送信
package com.anthropic.example;
import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.beta.sessions.events.BetaManagedAgentsSendSessionEvents;
import com.anthropic.models.beta.sessions.events.BetaManagedAgentsTextBlock;
import com.anthropic.models.beta.sessions.events.BetaManagedAgentsUserMessageEventParams;
import com.anthropic.models.beta.sessions.events.EventSendParams;
import java.util.List;
public final class Main {
private Main() {}
public static void main(String[] args) {
AnthropicClient client = AnthropicOkHttpClient.fromEnv();
EventSendParams params = EventSendParams.builder()
.sessionId("sesn_011CZkZAtmR3yMPDzynEDxu7")
.addUserMessageEvent(List.of(BetaManagedAgentsUserMessageEventParams.Content.ofText(BetaManagedAgentsTextBlock.builder()
.text("Where is my order #1234?")
.type(BetaManagedAgentsTextBlock.Type.TEXT)
.build())))
.build();
BetaManagedAgentsSendSessionEvents betaManagedAgentsSendSessionEvents = client.beta().sessions().events().send(params);
}
}Response 200
{
"data": [
{
"id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
"content": [
{
"text": "Where is my order #1234?",
"type": "text"
}
],
"type": "user.message",
"processed_at": "2026-03-15T10:00:00Z"
}
]
}Returns Examples
Response 200
{
"data": [
{
"id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
"content": [
{
"text": "Where is my order #1234?",
"type": "text"
}
],
"type": "user.message",
"processed_at": "2026-03-15T10:00:00Z"
}
]
}