Skip to main content
POST
/
api
/
v1
/
sessions
/
{sessionId}
/
messages
Send a user message to the agent in a session
curl --request POST \
  --url https://api.agenhq.com/api/v1/sessions/{sessionId}/messages \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "message": "<string>",
  "client_id": "<string>"
}
'
{
  "id": "<string>",
  "session_id": "<string>",
  "type": "user_message",
  "payload": {
    "type": "user_message",
    "message": "<string>"
  },
  "status": "completed",
  "client_id": "<string>",
  "session_goal_id": "<string>",
  "session_task_id": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.agenhq.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Path Parameters

sessionId
string
required
Minimum string length: 1

Body

application/json
message
string
required
Minimum string length: 1
client_id
string

Response

Default Response

id
string
required
session_id
string
required
type
enum<string>
required
Available options:
user_message,
agent_message,
system_message,
session_finished,
session_closed,
merge_request_merged,
merge_request_closed,
agent_file_tree_browse,
agent_file_read,
agent_file_edit,
agent_file_create,
agent_file_remove,
agent_file_move,
agent_file_copy,
agent_file_read_range,
agent_read_around_match,
agent_search_files,
agent_search_files_v2,
agent_plan_execution_update,
agent_ask_user,
user_ask_user_response,
agent_branch_diff,
agent_uncommitted_changes,
agent_conflict_state,
agent_check_target_branch_mergeability,
agent_merge_remote_branch,
agent_pull_from_remote,
agent_push_to_remote,
agent_abort_conflict_resolution,
agent_rollback_uncommitted_changes,
agent_http_request,
agent_web_browse,
agent_run_repository_command,
agent_alert_created
payload
object
required

A message sent by the user to the agent within a session. This is the payload created by the send message endpoint.

status
enum<string>
required
Available options:
completed,
queued,
processing,
canceled
client_id
string | null
required
session_goal_id
string | null
required
session_task_id
string | null
required
created_at
string
required
updated_at
string
required