Voice+ Context API
Voice+ multimodal context endpoints for providing web page state, available actions, form fields, and navigation information.
Send contextual information for Voice+ multimodal conversations. This endpoint allows you to provide structured context about web page elements, available actions, form fields, and navigation destinations.
Use Cases:
Provide page context for voice-enabled web applications
Define available actions the AI can perform
Specify form fields that can be filled
Set navigation destinations
Security: Requires valid API key and conversation context
API key authentication required for all conversational endpoints. Obtain your API key from the channel setup instructions in your deployment.
The unique deployment identifier
Channel identifier
The conversation ID for this Voice+ session
conv_voice123Security nonce for request validation (currently not enforced)
nonce_abc123Context successfully received and processed
Bad Request - Invalid context format or missing required fields
Forbidden - Invalid API key or unauthorized context submission
POST /c/{deploymentKey}/{channelKey}/context HTTP/1.1
Host: apps.nlx.ai
nlx-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 1628
{
"conversationId": "conv_voice_bank123",
"nonce": "nonce_auto_generated",
"context": {
"nlx:vpContext": {
"uri": "https://mybank.com/transfer",
"fields": [
{
"id": "fromAccount",
"name": "From Account",
"type": "select",
"description": "Source account for the money transfer",
"value": "savings_account_001"
},
{
"id": "toAccount",
"name": "To Account",
"type": "select",
"description": "Destination account for the money transfer",
"value": ""
},
{
"id": "amount",
"name": "Transfer Amount",
"type": "number",
"description": "Amount to transfer in USD (minimum $0.01, maximum $5000.00)",
"placeholder": "Enter amount",
"value": ""
},
{
"id": "memo",
"name": "Transfer Memo",
"type": "text",
"description": "Optional memo for the transfer",
"placeholder": "Optional memo",
"value": ""
}
],
"actions": [
{
"action": "submitTransfer",
"description": "Execute the money transfer with current form data and user verification",
"schema": {
"type": "object",
"required": [
"fromAccount",
"toAccount",
"amount"
],
"properties": {
"fromAccount": {
"type": "string",
"description": "Source account identifier"
},
"toAccount": {
"type": "string",
"description": "Destination account identifier"
},
"amount": {
"type": "number",
"minimum": 0.01,
"maximum": 5000,
"description": "Transfer amount in USD"
},
"memo": {
"type": "string",
"maxLength": 100
}
}
}
},
{
"action": "validateTransfer",
"description": "Validate transfer details without executing",
"schema": {
"type": "object",
"properties": {
"fromAccount": {
"type": "string"
},
"toAccount": {
"type": "string"
},
"amount": {
"type": "number"
}
}
}
},
{
"action": "clearForm",
"description": "Reset all form fields to default values"
}
],
"destinations": [
"/account/history",
"/account/dashboard",
"/help/transfers",
"/account/settings"
]
}
}
}{}
