Skip to main content
POST
/
v1
/
agents
/
sessions
/
{session_id}
/
messages
Send Message
curl --request POST \
  --url https://api.mixpeek.com/v1/agents/sessions/{session_id}/messages \
  --header 'Content-Type: application/json' \
  --data '
{
  "content": "<string>",
  "metadata": {},
  "stream": true
}
'
{
  "status": 123,
  "error": {
    "message": "<string>",
    "type": "<string>",
    "details": {}
  },
  "success": false
}

Headers

Authorization
string

REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.

X-Namespace
string

REQUIRED: Namespace identifier for scoping this request. All resources (collections, buckets, taxonomies, etc.) are scoped to a namespace. You can provide either the namespace name or namespace ID. Format: ns_xxxxxxxxxxxxx (ID) or a custom name like 'my-namespace'

Path Parameters

session_id
string
required

Session ID

Body

application/json

Request payload for sending a message to the agent.

Attributes: content: Message text content metadata: Optional message metadata stream: Whether to stream response as SSE (default: True)

Note: When stream=True, the response will be Server-Sent Events (SSE). When stream=False, the response will be a MessageResponse object.

Example: ```python # Streaming request (SSE) request = SendMessageRequest( content="Find videos about machine learning", stream=True )

# Non-streaming request
request = SendMessageRequest(
content="Find videos about machine learning",
stream=False
)
```
content
string
required

Message text content (REQUIRED)

Minimum string length: 1
metadata
Metadata · object

Message metadata (OPTIONAL)

stream
boolean
default:true

Stream response as SSE (default: True)

Response

Successful Response