Path Of A Call
Server-side segment filter
Before the AI sees any tools, OpenCX filters the action list by the contact’s segment memberships. An action with an empty Restricted to segments list is visible to every contact; a restricted action reaches only contacts in a matching segment.
AI chooses a tool
The AI reads each action’s name and description, matches them against the conversation, and picks zero or one tool per turn. Fuzzy or overlapping descriptions lead to wrong picks — tighten the description if the AI picks an adjacent action.
OpenCX calls your API
OpenCX sends an HTTP request from its infrastructure to your endpoint. Headers include
User-Agent: OpenCX, any action-level headers, any global variables, any widget-passed headers, and (if enabled) the x-opencx-* context headers. Path and query parameters are filled with values the AI extracted from the conversation.Response back to AI
OpenCX reads the full response body as text and hands it to the AI along with the status code. Keep responses compact — large bodies dilute context and hurt reply quality.
Timeout And Retries
| Value | |
|---|---|
| Timeout per call | 60 seconds (hard, enforced with AbortSignal.timeout) |
| Retries on failure | None — OpenCX does not retry |
| Concurrency | One tool call per conversation turn — the AI waits for the response before replying |
| Circuit breaker | None — every call hits your endpoint |
How The AI Sees Failures
OpenCX returns whatever happened, and the AI decides what to do next — retry, fall back to another action, or hand off to a human.| Failure | What the AI receives |
|---|---|
| Timeout | responseStatus: 408, body Request timed out after 60000ms |
| Network error | The string Something went wrong |
| 4xx or 5xx | The upstream status + response body verbatim |
| Success | The 2xx status + response body verbatim |
"order 12345 not found"). The AI can then explain the failure to the customer in its own words rather than echoing a stack trace.
Good To Know
Response-body size matters
Response-body size matters
The full body counts against the AI’s context window. Paginate or summarize large lists server-side — return the three most recent orders, not the customer’s entire order history.
Bodies don't transform
Bodies don't transform
OpenCX does not reshape your response. JSON passes through as the raw text the AI reads. If you want pretty-formatted fields in the reply, mirror them in your response payload exactly.
Per-call logging lives on the session
Per-call logging lives on the session
Every action call, including request parameters and response status, is recorded on the conversation session. Open any session in the inbox and expand the tool-call row to audit.
Related Documentation
Build An Action
The fields that decide what the AI sees.
Authentication
Where each header comes from at call time.
Troubleshooting
When the call doesn’t land as expected.
Human Handoff
What happens when the AI gives up after a failed action.