Conversation API
Main conversational endpoints for sending messages and receiving bot responses. Supports both unstructured text input and structured intent/choice requests.
Main endpoint for sending messages to your conversational application. Supports both unstructured text input and structured intent/choice requests.
Channel Key Format: May include language code (e.g., mychannel-en-US)
Request Types:
Unstructured: Send natural language text for NLP processing
Structured: Send explicit intents, choices, or slot values
Response: Returns bot messages, choices, modalities, and metadata
API key authentication required for all conversational endpoints. Obtain your API key from the channel setup instructions in your deployment.
The unique deployment identifier
my-deployment-123Channel identifier, optionally with language suffix
api-channel-en-USThe request payload - either unstructured text or structured intent/choice data. Use unstructured for natural language input, structured for explicit intents/choices.
Unique identifier for the conversation session. If not provided, a new conversation will be created. Use the same ID across requests to maintain conversation context.
conv_abc123def456Unique identifier for the user. Used for personalization and conversation tracking. Can be overridden by context.nlx_userId if provided.
user_789xyzEnvironment for request processing
productionPossible values: Successful conversation response
Bad Request - Invalid request format or missing required fields
Unauthorized - Invalid or missing API key
Forbidden - Valid API key but access denied
Too Many Requests - Rate limit exceeded
POST /c/{deploymentKey}/{channelKey} HTTP/1.1
Host: apps.nlx.ai
nlx-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 129
{
"request": {
"unstructured": {
"text": "Hello, I need help with my account"
}
},
"userId": "user_12345",
"conversationId": "conv_abcd1234"
}{
"conversationId": "conv_abcd1234",
"expirationTimestamp": "2024-01-15T11:30:00Z",
"messages": [
{
"messageId": "msg_001",
"text": "I found your account information. Your current balance is $2,347.50.",
"choices": [],
"metadata": {
"intentId": "CheckBalance"
}
}
],
"metadata": {
"intentId": "CheckBalance",
"isGenerative": false,
"hasPendingDataRequest": false,
"escalation": false,
"frustration": false,
"incomprehension": false,
"uploadUrls": []
}
}
