Create Session
Endpoints
Create Session
Create a new chat session with your AI agent
POST
Create Session
Create Session
Creates a new chat session with your configured AI agent. This establishes a conversation thread that maintains context across multiple messages.Endpoint
Authentication
Your Nexus API key for authentication
Request Body
Optional initial message to send to the agent when creating the session. This can help set the context for the conversation.
Response Fields
Unique identifier for the created session. You’ll need this ID to send messages and retrieve conversation history.
ISO 8601 timestamp indicating when the session was created
Example Usage
Common Use Cases
1. Customer Support Bot
2. Product Assistant
3. Technical Support
Error Responses
Best Practices
Session Lifecycle
Session Lifecycle
- Sessions remain active for 24 hours of inactivity
- Reuse sessions for continued conversations
- Create new sessions for unrelated topics
- Store session IDs securely in your application
Initial Messages
Initial Messages
- Use initial messages to provide context
- Include relevant details upfront
- Set clear expectations for the conversation
- Avoid sensitive information in initial messages
Error Handling
Error Handling
- Always check for error responses
- Implement retry logic for transient failures
- Log session IDs for debugging
- Have fallback behavior for session creation failures
Related Endpoints
- Send Message - Send messages to an existing session
- Get Session - Retrieve session information
- List Messages - Get conversation history