Skip to main content
Send a message to an existing session. Returns immediately unless --wait is used. This maps directly to POST /sessions/{id}/messages described in the Messages API reference.

Usage

motus serve send <url> <id> <message> [options]

Options

FlagDefaultDescription
--roleuserMessage role: system, user, assistant, or tool
--waitfalseWait for the turn to complete and print the final session state
--timeoutMaximum seconds to wait (only applies with --wait)
--webhook-urlURL to POST the turn result to when it completes
--webhook-tokenBearer token for the webhook Authorization header
--webhook-include-messagesfalseInclude the full message history in the webhook payload
--paramKEY=VALUE parameter passed to the agent as user_params (repeatable). Numeric values are auto-coerced to int or float.

Examples

Fire and forget

motus serve send http://localhost:8000 550e8400-e29b-41d4-a716-446655440000 "hello"

Wait for the turn to finish

motus serve send http://localhost:8000 550e8400-e29b-41d4-a716-446655440000 "hello" --wait

Send with a webhook

motus serve send http://localhost:8000 550e8400-e29b-41d4-a716-446655440000 "hello" \
  --webhook-url https://example.com/hook \
  --webhook-token secret