Skip to main content
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

string
required
Your Nexus API key for authentication

Request Body

string
Optional initial message to send to the agent when creating the session. This can help set the context for the conversation.

Response Fields

string
required
Unique identifier for the created session. You’ll need this ID to send messages and retrieve conversation history.
string
required
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

  • 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
  • Use initial messages to provide context
  • Include relevant details upfront
  • Set clear expectations for the conversation
  • Avoid sensitive information in initial messages
  • Always check for error responses
  • Implement retry logic for transient failures
  • Log session IDs for debugging
  • Have fallback behavior for session creation failures