Search Articles
/v1/kb/articles/searchorg.permission.kb.readThe API key or user must hold at least one of them. Legacy roles still work; prefer the others for new keys.
Returns articles matching the query
Knowledge base articles
An article is one help page in your knowledge base, such as "How to return an order". Each article keeps its own versions for each language, and customers and agents only see the published version in each language.
Articles are the content of a Kustomer knowledge base. Admins write them in the knowledge base editor. Customers read published public articles in the help center and in the chat widget, and agents look up articles, including internal ones, from the agent desktop. An article is a container. The title, htmlBody, slug and SEO fields live on its versions, with a separate series of versions for each language. The article itself holds what all languages share: categories, knowledgeBases (where featured pins it to that knowledge base's home page), tags, scope, hash (the short ID used in its URL) and source, the language it was first written in.
POST /v1/kb/articles creates the article and an empty draft in the source language, which defaults to the org's default language. You fill in the draft and publish it. To change the article later, you create a new draft. There is no DELETE for articles: send deleted: true to PUT /v1/kb/articles/{id} to soft-delete one.
Versions, languages and publishing
Each language has at most one draft and at most one published version. The version status shows which role a version plays:
status |
Meaning |
|---|---|
draft |
The working copy. You can edit it, and customers never see it. |
published |
The live version for that language. Its version number goes up by one on every publish. |
unpublished |
A version that used to be live, kept as history, or one you took offline. |
To add a translation, create a version in the new language. Creating a version when a draft already exists replaces that draft. To publish, send publishedAt to PUT …/versions/{lang}/draft. You can include final edits in the same request. The previous live version becomes unpublished. Add markOthersOutOfDate: true to flag every other language as outdated, which tells translators to update them. On the article, latestLangs summarizes each language's live status and its outdated flag, and draftLangs lists the languages that have a draft.
Public and internal articles
scope is public (the default) or internal. Internal articles are only for signed-in Kustomer users. Set accessTeams or accessUsers on a draft to limit an internal article to those teams or users, and the limit takes effect when you publish. Admins can always see every article.
The /p/v3 endpoints are the customer view. They need no API key and only return published, public versions in the requested lang. They work out the org from the host, so call your org host, https://<org>.api.kustomerapp.com (see Regions and base URLs). That host serves the org's default knowledge base; pass knowledgeBaseId to read a different one. Each result is a published version: its id is the version ID, and the parent article is in attributes.article.
Scheduling
A schedule publishes a language's draft at a future time. Send lang, publishAt (at least one minute in the future) and tz (an IANA time zone such as America/New_York). The article must already have a draft in that language. Each language can have only one schedule, and {type} is always publish. Publishing by hand or deleting the draft cancels the schedule.
Which endpoint to use
| To | Call |
|---|---|
List articles as an agent or admin, or search them by scope and lang |
GET /v1/kb/articles or GET /v1/kb/articles/search |
| Read one article, optionally with its versions and categories | GET /v1/kb/articles/{id} |
| Create an article and its first draft | POST /v1/kb/articles |
| Change categories, knowledge bases, tags or scope, or delete the article | PUT /v1/kb/articles/{id} |
| List or search what customers see, without an API key | GET /p/v3/kb/articles or GET /p/v3/kb/articles/search |
| Start a new draft or a translation | POST /v1/kb/articles/{id}/versions/{lang} |
Edit the draft, or publish it with publishedAt |
PUT …/versions/{lang}/draft |
| Discard the draft | DELETE …/versions/{lang}/draft |
Unpublish the live version, or set outdated |
PUT …/versions/{lang}/latest |
| Remove a language and all its versions | DELETE /v1/kb/articles/{id}/versions/{lang} |
| Read a language's version history, or one version | GET …/versions/{lang} or GET /v1/kb/versions/{id} |
| Schedule, reschedule or cancel publishing | POST, PUT or DELETE …/schedules/{type}/{lang} |
Reads need a knowledge base read role such as org.user.kb.read. Writes need org.admin.kb.write or the matching org.permission.kb.* permission. If two writes to the same article overlap, one can fail with 409 Conflict; read the article again and retry. List endpoints page with page and pageSize.
Query parameters
Search term to match against article content.
"new"Language code for filtering article results.
"en_us"Comma-separated scopes to search. Supported values are public and internal.
"public,internal"Search index override.
"articles"Page number of results to return.
1Number of results to return per page.
100Fields to include in the search.
"title,htmlBody"Knowledge Base ID used to scope public article results when it cannot be inferred from the subdomain.
"5e15fa56a07888001927f8e5"Responses
OK