Structural & navigational improvements
a. Add a short “Getting Started” section
Right after Overview, add something like:
-
Audience: “Intended for developers integrating with CX via GraphQL.”
-
Endpoint: GraphQL endpoint URL (if stable) and required HTTP method.
-
Auth prerequisites: “Requires a valid JWT / API token/session (link to auth doc).”
-
Minimal query: A very small example that just returns
idandcreationTimeof the latest 10 conversations.
This anchors new readers before diving into operators and limitations.
b. Introduce an explicit “API Reference” section
Right now, the arguments of searchConversations are implied through examples. Add a dedicated section:
And sub‑sections:
-
filter: ConversationFilterInput -
pagination: PaginationInput -
sort: SortInput -
searchTerm: String
For each, describe:
-
Type
-
Is it optional?
-
Defaults (e.g. default limit, offset, sort order if omitted)
-
Interaction rules (e.g. “
filterandsearchTermare combined with logical AND”)
c. Reformat “Allowed Filter Fields” into a table
The current bullet list is useful but dense. A table will make it much easier to design filters:
|
Field |
Type |
Description / Example |
|---|---|---|
|
|
String |
Conversation ID |
|
|
DateTime |
ISO 8601, e.g. |
|
|
String |
Customer identifier |
|
|
String |
Agent username, supports partial text operators |
|
|
String |
Wrap-up / disposition value |
|
|
Number |
Conversation duration in seconds |
|
… |
… |
… |
Also, explicitly mention for each if text operators (contains, starts_with) are allowed, or only comparison operators.
d. Group “Pagination” and “Sorting” into a “Result Shaping” section
To improve flow:
Also clarify default values:
-
What is the default
limitand maximum allowedlimit? -
What is the default
sortBy/sortOrderifsortis omitted?
e. Expand “Best Practices”
This section is valuable but short. Suggested bullets to add:
-
Prefer indexed fields (like
creationTime,customer._id) in filters for performance. -
Avoid using
containson high-cardinality fields in very large datasets unless necessary. -
Use narrow time ranges when filtering on timestamps to reduce scan size.
-
Combine
searchTermwith structured filters (e.g. creation range + direction) for precise results.
Content gaps & missing clarifications
a. Clarify interaction between filter and searchTerm
The doc doesn’t tell the reader how these combine:
-
Are they ANDed (filter by fields AND search by name)?
-
Does
searchTerminternally expand intoORconditions on allowed search fields? -
Can
searchTermbe used together withsortandpagination(it is in example, but state it explicitly)?
Add an explicit statement such as:
When both
filterandsearchTermare provided, conversations must match both the structured filter and the search term.
…and perhaps a combined example:
query {
searchConversations(
searchTerm: "ahsan"
filter: {
and: [
{ key: "conversationDirection", operator: equal_to, value: "INBOUND" }
{ key: "creationTime", operator: greater_than_equal_to, value: "2024-01-01T00:00:00Z" }
]
}
pagination: { limit: 10, offset: 0 }
sort: { sortBy: "creationTime", sortOrder: DESC }
) {
totalDocs
docs { id customer { firstName } creationTime }
}
}
b. Clarify default behavior more fully
You mention:
If no query parameters are provided, the API will return the top 10 most recent conversations based on
creationTimein descending order.
Recommended clarifications:
-
Confirm that this is effectively:
-
limit = 10,offset = 0 -
sortBy = "creationTime",sortOrder = DESC
-
-
What happens if:
-
Only
filteris provided? (still default sort bycreationTime DESC?) -
Only
paginationis provided but nosort? (same default sort?)
-
-
Is there a max limit to prevent abuse (e.g. 100 / 1000)?
c. Add error handling section
You mention “Any attempt to filter using other fields will result in a validation error”, but don’t show examples.
Add:
Also clarify behavior when:
-
valuetype doesn’t match the field type (e.g. string for a numeric field). -
Unsupported operator is used for a field type.
d. Add response examples
You already give request examples; add a short sample response for at least one or two queries. For example, under “Search via searchTerm”:
{
"data": {
"searchConversations": {
"totalDocs": 2,
"limit": 10,
"offset": 0,
"docs": [
{
"customer": {
"_id": "123",
"firstName": "Ahsan",
"phoneNumber": "+923001234567",
"isAnonymous": false,
"additionalDetail": null
}
},
…
]
}
}
}
This helps users quickly validate that their integration works as expected.
e. Versioning & compatibility note
You mention:
partial search via searchTerm is enabled by default for customer.fistName attribute in CX-4.10.5, CX-5.1 and upcoming releases on top.
Suggested improvements:
-
Correct typo:
customer.fistName→customer.firstName. -
Add a small compatibility note/table:
|
Version |
|
|---|---|
|
CX < 4.10.5 |
Not supported |
|
CX 4.10.5 |
Supported for |
|
CX 5.1+ |
Supported for |
-
Clarify whether users on older versions should expect a schema error or ignored argument if they pass
searchTerm.
f. Authentication & security
If not covered elsewhere, add either:
-
A brief “Authentication” subsection with a link to the main auth doc, or
-
A short sentence: “All
searchConversationsrequests must be authenticated. See Authentication Guide”.
Also mention:
-
Whether results are scoped by tenant / org / permissions.
-
That users only see conversations they are allowed to see (if applicable).
Operator & field semantics
a. Supported operators matrix
Right now, “Supported Operators” is flat. It would help to show which operators work on which field types. For example:
|
Operator |
String fields |
Number fields |
DateTime fields |
Notes |
|---|---|---|---|---|
|
|
✅ |
✅ |
✅ |
|
|
|
❌ / N/A |
✅ |
✅ |
|
|
|
✅ |
❌ |
❌ |
Case-insensitive |
|
|
✅ |
❌ |
❌ |
Strings only |
This prevents incorrect assumptions, especially with timestamps and numeric fields.
b. Case-insensitivity scope
You state:
Partial text matches … are case insensitive.
Clarify explicitly:
-
This applies to
starts_with,ends_with,containson string fields. -
equal_tofor string fields – is it case‑sensitive or insensitive? (State clearly.) -
searchTerm– confirm it is case‑insensitive as well.
If behavior differs between fields, note that.
5. Limitations & performance
a. STRING_LIST limitation
This section is good but can be a bit sharper:
-
Emphasize that behavior is unsupported and results are unreliable (not just “may” be unexpected).
-
Add a guidance sentence:
-
“If you need to search inside list values, consider normalizing your schema so that each searchable value is stored as an individual document field that can be indexed.”
-
You might also:
-
Add a simple “do/don’t” example of
conversationDatadesign.
b. Indexing & performance hints
It would help advanced users if you mention:
-
Which fields are indexed (if you can share that).
-
That queries combining multiple indexed fields under
ANDperform best. -
That
containson large text fields may be slower than exact or prefix matches.
Even a short note like:
For best performance, prefer filters on indexed fields such as
creationTime,customer._id, andwrapUps.value. Avoid usingcontainson high‑cardinality fields when a more specific filter is available.
would help.
Consistency, naming & small fixes
a. Field naming consistency
You use:
-
In filters:
customer._id -
In
docsexample:docs { id customer { id } }
Then in searchTerm example:
customer {
_id
firstName
...
}
This is confusing. Suggestions:
-
Choose one canonical field name in the schema (either
idor_id) and use it consistently in all examples, or -
If both exist for a reason, explicitly explain:
-
“
_idis the internal Mongo identifier;idis the GraphQL‑level ID,” etc.
-
-
Ensure the “Allowed Filter Fields” and examples all use the same string:
customer._idvscustomer.id.
b. Typo fixes
-
customer.fistName→customer.firstName. -
Ensure all field names and capitalization in the narrative match the code listings (
creationTime,endTime, etc.).
c. Headings & capitalization
For consistency:
-
### Search via searchTerm (partial search):
→ consider “### Search viasearchTerm(partial search)” to visually mark the argument name. -
Ensure all section titles follow a consistent case style (e.g. Title Case or sentence case).
Example-focused refinements
a. Explain what each example demonstrates
Before each GraphQL example, add a one‑line explanation:
-
“This example filters conversations by
customer._idand direction INBOUND.” -
“This example demonstrates a time range filter on
creationTimeandendTime.” -
“This example shows a partial text match on
agentParticipants.usernameusingcontains.”
This helps readers scan for the pattern they need.
b. Add a combined filters + searchTerm + pagination example
You already have separate examples; one combined example (as suggested above) will show the typical real‑world usage.