GraphQL API

Content

Help articles, News posts, AI knowledge documents, and the folders, categories and tags that organise them

Wexio hosts two kinds of customer-facing content: a Help centre (articles in folders, tagged) and a News feed (posts in categories, tagged). Both are fully manageable over a key, which is what lets a partner publish a client's help centre from its own CMS.

Scopes: CONTENT_READ to read, CONTENT_MANAGE to change. The same pair covers knowledge documents, the text your AI assistants answer from. Knowledge documents through an API key need a Standard, Pro or Enterprise plan. Through MCP they need Pro or Enterprise.

These operations manage the content records. How the Help centre and News feed are rendered to visitors - and how the widget surfaces them - is covered in the Web Widget docs.

Help Articles

Reading

helpArticles(
  integrationId: ID
  status: HelpArticleStatus
  locale: String
  search: String
  folderId: ID
  recursive: Boolean
  tagIds: [ID!]
  sort: HelpArticleSort = CREATED_DESC
  limit: Int
  offset: Int
): PaginatedHelpArticles!

helpArticle(…): HelpArticle

CONTENT_READ

ArgumentTypeDescription
integrationIdIDNarrow to one widget's help centre.
statusHelpArticleStatusFilter by draft/published state.
localeStringOne language's articles.
searchStringFree-text search.
folderIdIDArticles in a folder.
recursiveBooleanInclude articles in that folder's descendants.
tagIds[ID!]Articles carrying any of these tags.
sortHelpArticleSortDefaults to CREATED_DESC.
limit / offsetIntOffset pagination - unlike the rest of the API.

Content paginates with limit/offset, not cursors. That is a third convention alongside limit/cursor and first/after elsewhere - see the conventions table.

Writing

createHelpArticle(input: CreateHelpArticleInput!): HelpArticle!
updateHelpArticle(…): HelpArticle!
createHelpArticleTranslation(…): HelpArticle!
publishHelpArticle(…): HelpArticle!
unpublishHelpArticle(…): HelpArticle!
deleteHelpArticle(…): Boolean!

CONTENT_MANAGE

Authoring and publishing are separate steps: create or update the article, then publishHelpArticle when it should go live. unpublishHelpArticle pulls it back without deleting it.

createHelpArticleTranslation adds a locale to an existing article rather than creating a second, unrelated article - use it so translations stay linked.

Folders and Tags

helpFolders / helpFolder / helpFolderTree                    # CONTENT_READ
helpFolderCounts / helpFolderCountsBatch                     # CONTENT_READ
helpTags / helpTag                                           # CONTENT_READ

createHelpFolder / updateHelpFolder / moveHelpFolder / deleteHelpFolder   # CONTENT_MANAGE
createHelpTag / updateHelpTag / deleteHelpTag                             # CONTENT_MANAGE

Folders are a tree. helpFolderTree returns the whole hierarchy in one call - use it instead of walking parents. moveHelpFolder re-parents a folder with its contents.

helpFolderCounts gives article counts for one folder; helpFolderCountsBatch does several at once, which is what you want for rendering a sidebar without N queries.

News

Reading

newsPosts(
  integrationId: ID
  status: NewsPostStatus
  locale: String
  search: String
  categoryIds: [ID!]
  tagIds: [ID!]
  sort: NewsPostSort = CREATED_DESC
  limit: Int
  offset: Int
): PaginatedNewsPosts!

newsPost(…): NewsPost

CONTENT_READ

Same filter and pagination shape as helpArticles, with categoryIds in place of folders.

Writing

createNewsPost(input: CreateNewsPostInput!): NewsPost!
updateNewsPost(…): NewsPost!
createNewsPostTranslation(…): NewsPost!
publishNewsPost(id: ID!): NewsPost!
scheduleNewsPost(id: ID!, scheduledFor: DateTime!): NewsPost!
unpublishNewsPost(…): NewsPost!
archiveNewsPost(…): NewsPost!
deleteNewsPost(…): Boolean!

CONTENT_MANAGE

News has a richer lifecycle than Help:

OperationEffect
publishNewsPostLive now.
scheduleNewsPost(id, scheduledFor)Live at a future time - Wexio publishes it for you.
unpublishNewsPostBack to unpublished, still editable.
archiveNewsPostRetired but kept. Distinct from delete.
deleteNewsPostGone.

Prefer archiveNewsPost over deleteNewsPost for anything that was ever public - an archived post keeps its history and can be reasoned about later.

Categories and Tags

newsCategories / newsCategory / newsTags / newsTag                        # CONTENT_READ
createNewsCategory / updateNewsCategory / deleteNewsCategory              # CONTENT_MANAGE
createNewsTag / updateNewsTag / deleteNewsTag                             # CONTENT_MANAGE

Categories are a flat list, not a tree - that is the difference from Help folders.

Knowledge Documents

Knowledge documents are the text an AI assistant answers from. A key can list them, write them, upload files as documents, and attach them to an assistant. For how they work in the dashboard, see the knowledge base guide.

knowledgeDocuments(input: GetCursorPaginatedInput, filter: KnowledgeDocumentsFilter, sort: KnowledgeDocumentsSort): KnowledgeDocumentPage!
knowledgeDocument(id: ID!): KnowledgeDocument!

CONTENT_READ

Lists use cursor pagination (limit, default 20, and cursor). filter takes kind, statuses, enabled, assistantId, audienceKind, titleSource, descriptionSource, descriptionMissing and a case-insensitive title-prefix search. sort takes UPDATED_AT (default), CREATED_AT, TITLE or STATUS.

MutationWhat it does
createKnowledgeDocumentCreate an authored document from title, body and optional description, assistantIds, enabled and audience. It is published as version 1, or kept as a draft with asDraft: true.
createKnowledgeDocumentsFromMediaCreate documents from files you already uploaded. Up to 20 files per call; each result carries a document or an error.code (MEDIA_NOT_FOUND, UNSUPPORTED_TYPE or INVALID_INPUT). Pass asDraft: true to keep them as drafts.
updateKnowledgeDocumentChange only the fields you pass. A change to title, description or body is published at once, as a new version. To keep it as a draft, use saveKnowledgeDocumentDraft.
replaceKnowledgeDocumentFileSwap the file of an uploaded document for another mediaId. The new text lands in the draft. Pass publish: true to publish it once the file has been read.
reindexKnowledgeDocumentRebuild the index of one document.
deleteKnowledgeDocumentDelete a document.
attachKnowledgeDocuments / detachKnowledgeDocumentsAdd or remove up to 100 documents on one assistantId.

CONTENT_MANAGE for all of them. To upload the files first, use createMedia or uploadMultipleMedia, which a key may call with either MESSAGES_SEND or CONTENT_MANAGE.

LimitValue
Title200 characters
Description300 characters
Authored body100,000 characters

Indexing runs in the background. A new or published document has status: INDEXING until it reaches READY; the other states are NO_TEXT, FAILED, and UNPUBLISHED for a document that was never published. Poll while indexingCount on the page is above zero. audience limits who the AI uses a document for: EVERYONE (default), SIGNED_IN, or FIELD_VALUES with a People fieldKey and a list of values.

Drafts and Versions

A document has a published version, which the AI reads, and at most one draft. Saving a draft does not change what the AI says. Publishing makes the draft the next version and indexes it. The last 50 versions are kept.

OperationWhat it does
saveKnowledgeDocumentDraft(id, input)Save title, description and body into the draft. Pass expectedDraftRev to refuse the save if the draft changed since you read it.
publishKnowledgeDocument(id, expectedDraftRev)Publish the draft as the next version. Expensive.
discardKnowledgeDocumentDraft(id)Throw the draft away. The published version stays.
restoreKnowledgeDocumentVersion(id, versionNumber)Load an older version into the draft. Publish it to make it live.
revertKnowledgeDocumentTextToOriginal(id, expectedDraftRev)For an uploaded file, drop the edited text and read the file's text into the draft again. Expensive.

CONTENT_MANAGE for all of them. On a KnowledgeDocument, publishedVersion, hasUnpublishedChanges, textEditable and textLockReason (TOO_LARGE, EXTRACTING, NO_TEXT or NOT_CAPTURED) tell you where it stands. draft carries the draft's fields, its rev, and stale when a newer version was published after the draft started.

To read the history, use knowledgeDocumentVersions(documentId, input) for a cursor-paginated list and knowledgeDocumentVersion(documentId, versionNumber) for one version with its body. Each version has source (CREATE, EDIT, FILE_REPLACE, RESTORE, API or MIGRATION), publishedVia (MEMBER or API_KEY) and isLive. CONTENT_READ.

A refused change answers with extensions.reason, for example draftConflict, noDraft, draftNotReady, textNotEditable, textTooLong or versionNotFound. Branch on that value rather than on the message text.

A key reads assistants only through a summary (id, name, enabled). Prompts, models and integrations are not reachable. The create, update, replace, reindex, publish and revert mutations count as expensive operations in the rate limits.

Import from a Website

A document made from a web page has a web object with primaryUrl, autoSync, autoSyncDisabledByEdit, lastSyncedAt and lastCheckedAt. Each operation below returns a KnowledgeSyncRun that you poll.

OperationWhat it does
startWebKnowledgePreview(input)Read a site and suggest pages. url defaults to the organisation website. CONTENT_MANAGE.
importWebKnowledge(input)Create documents from a preview: previewRunId, selectedKeys and optional assistantIds. If you leave assistantIds out, the first import uses the system assistant. CONTENT_MANAGE.
addKnowledgeFromUrl(input)Add one page of the imported site by url, with optional assistantIds. CONTENT_MANAGE.
refreshKnowledgeDocumentFromWebsite(id)Check the page now. CONTENT_MANAGE.
setKnowledgeDocumentAutoSync(id, enabled)Turn the daily check on or off. Turning it on is refused on the Free plan. CONTENT_MANAGE.
webKnowledgeOverview, knowledgeSyncRun(id), knowledgeSyncRuns(input)Read the website, the active run, one run and the run history. CONTENT_READ.

Publishing a Client's Help Centre

A typical partner flow, with one key holding CONTENT_READ, CONTENT_MANAGE and CHANNELS_MANAGE, acting on the client via X-Wexio-Org:

  1. createWebIntegration - the client's widget. See Channels → Web widget.
  2. createHelpFolder for each section of your CMS tree.
  3. createHelpArticle per article, then createHelpArticleTranslation for each extra locale.
  4. publishHelpArticle when the client approves.
  5. On every CMS change, updateHelpArticle; use helpFolderTree to reconcile structure.

Content is per client org. A partner managing 50 clients publishes into each one separately via X-Wexio-Org - there is no shared content pool across children.

Was this page helpful?

On this page