Skip to main content
POST
Send Message

Send Message

Sends a message to an existing chat session. The AI agent will process the message and generate an appropriate response based on the conversation context.

Endpoint

Authentication

string
required
Your Nexus API key for authentication

Path Parameters

string
required
The session ID obtained from creating a session. This identifies which conversation thread to send the message to.

Request Body

string
required
The message content to send to the AI agent. Maximum length: 4000 characters.

Response Fields

boolean
required
Indicates whether the message was successfully sent and queued for processing

Example Usage

Message Processing

How It Works

  1. Message Receipt: Your message is received and validated
  2. Context Loading: Previous conversation history is loaded
  3. AI Processing: The agent processes your message with full context
  4. Response Generation: A contextual response is generated
  5. Storage: Both messages are stored in the conversation thread

Response Time

  • Typical response time: 1-3 seconds
  • Complex queries may take longer
  • Use polling to retrieve responses

Common Patterns

1. Send and Wait Pattern

2. Conversation Flow

3. Structured Queries

Error Responses

Best Practices

  • Keep messages concise and clear
  • Use proper punctuation and grammar
  • Break complex queries into multiple messages
  • Avoid sending multiple messages too quickly
  • Send related messages in the same session
  • Create new sessions for unrelated topics
  • Include relevant details in your messages
  • Reference previous messages when needed
  • Implement retry logic for failed sends
  • Handle session expiration gracefully
  • Validate message content before sending
  • Log failed messages for debugging
  • Batch related information in single messages
  • Use appropriate polling intervals
  • Implement client-side rate limiting
  • Cache session IDs for reuse

Limitations

  • Message Length: Maximum 4000 characters per message
  • Rate Limits: 60 messages per minute per API key
  • Session Limits: Messages must be sent to active sessions
  • Content Policy: Messages must comply with usage policies