Send Message
Endpoints
Send Message
Send a message to an existing chat session
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
Your Nexus API key for authentication
Path Parameters
The session ID obtained from creating a session. This identifies which conversation thread to send the message to.
Request Body
The message content to send to the AI agent. Maximum length: 4000 characters.
Response Fields
Indicates whether the message was successfully sent and queued for processing
Example Usage
Message Processing
How It Works
- Message Receipt: Your message is received and validated
- Context Loading: Previous conversation history is loaded
- AI Processing: The agent processes your message with full context
- Response Generation: A contextual response is generated
- 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
Message Formatting
Message Formatting
- Keep messages concise and clear
- Use proper punctuation and grammar
- Break complex queries into multiple messages
- Avoid sending multiple messages too quickly
Context Management
Context Management
- Send related messages in the same session
- Create new sessions for unrelated topics
- Include relevant details in your messages
- Reference previous messages when needed
Error Handling
Error Handling
- Implement retry logic for failed sends
- Handle session expiration gracefully
- Validate message content before sending
- Log failed messages for debugging
Performance Tips
Performance Tips
- 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
Related Endpoints
- Create Session - Create a new chat session
- List Messages - Retrieve conversation history
- Get Session - Check session status