--- title: Knowledge Management REST API description: The Knowledge Management API provides endpoints for searching, viewing, and fetching lists of the most-viewed and featured knowledge articles.Returns a list of knowledge base \(KB\) articles which can be searched and filtered using various parameters.Returns a knowledge article attachment as a file.Returns a list of the most-viewed knowledge articles and featured knowledge articles.Returns specific knowledge article content and its field values.Returns a list of knowledge articles prioritized by most-viewed. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/rest-apis/knowledge-api.html release: australia product: REST APIs classification: rest-apis topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 27 breadcrumb: [REST API reference, API reference, API implementation and reference] --- # Knowledge Management REST API The Knowledge Management API provides endpoints for searching, viewing, and fetching lists of the most-viewed and featured knowledge articles. You can only use this API when the Knowledge API \(sn\_km\_api\) plugin is activated. The Knowledge Management REST API was originally released in Orlando using the Knowledge API app available in the ServiceNow Store. **Note:** The Knowledge Management REST API is publicly accessible and makes any knowledge base that is publicly accessible available to all users, including unauthenticated users. For version 1.0.1 and later, the API was made editable, allowing admins to configure each endpoint to disallow unauthenticated access by selecting the **Requires Authentication** flag on the Scripted REST Service Security tab associated with the API. To enable other domains to use Knowledge Management REST API endpoints, define a Cross-Origin Resource Sharing \(CORS\) rule. For more information, see [Define a CORS rule](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/t_DefineACORSRule.md). To view an article from the scoped knowledge base using this REST API, allow the sn\_km\_api scope read access from the requesting scope in the Restricted Caller Access Privileges \[sys\_restricted\_caller\_access\] table. For more information, see [Define cross-scope access to an application resource](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/application-development/set-RCA-level.md). By default, this API has a rate limit of 500 per hour for unauthenticated and snc\_external users. For more information about rate limiting, see [Inbound REST API rate limiting](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/inbound-REST-API-rate-limiting.md). **Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md) ## Knowledge Management - GET /knowledge/articles Returns a list of knowledge base \(KB\) articles which can be searched and filtered using various parameters. ### URL format Versioned URL: `/api/sn_km_api/{api_version}/knowledge/articles` Default URL: `/api/sn_km_api/knowledge/articles` **Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md). ### Supported request parameters
| Name | Description |
|---|---|
| api\_version | Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String |
| Name | Description |
|---|---|
| filter |
Encoded query to use to filter the result set. Syntax: `filter= |
| fields | Comma-separated list of fields from the Knowledge \[kb\_knowledge\] table to show details in results.Data type: String Default: None |
| kb | Comma-separated list of knowledge base sys\_ids from the Knowledge Bases \[kb\_knowledge\_base\] table to restrict results to.Data type: String |
| language | List of comma-separated languages in two-letter ISO 639-1 language code format to restrict results to. Alternatively type 'all' to search in all valid installed languages on an instance.Data type: String Default: User's session language or en |
| limit | Maximum number of records to return. Unusually large **limit** values can impact system performance. For requests that exceed this number of records, use the **offset** parameter to paginate record retrieval.Data type: Number Default: 30 |
| offset | Starting record index for which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks. For example, the first time this endpoint is called, **offset** is set to "0". To page through all available records, use `offset=offset+limit` until the end of the all records is reached. Data type: Number Default: 0 |
| query | Text to search for, can be empty.Data type: String |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Name | Description |
|---|---|
| articles | List of articles returned in response.Data type: Array ``` "articles": [ { "fields": {Object}, "link": "String", "id": "String", "number": "String", "rank": Number, "score": Number, "snippet": "String", "title": "String" } ] ``` |
| articles.fields |
Values of requested fields, if any.Data type: Object
```
"fields": {
" |
| articles.fields.<field\_name> |
Lists each field requested using the fields parameter, if any.Data type: Object
```
" |
| articles.fields.<field\_name>.display\_value | Display value of the requested field.Data type: String |
| articles.fields.<field\_name>.label | Label representing the requested field. For example, `Knowledge`.Data type: String |
| articles.fields.<field\_name>.name | Name of the requested field. Matches **<field\_name>**.Data type: String |
| articles.fields.<field\_name>.type | Data type of requested field.Data type: String |
| articles.fields.<field\_name>.value | Value of the requested field.Data type: String |
| articles.id | Knowledge article sys\_id from the Knowledge \[kb\_knowledge\] table.Data type: String |
| articles.link | Link to the article.Data type: String |
| articles.number | Knowledge article number.Data type: String |
| articles.rank | Search rank of article specific to this search.Data type: Number \(Float\) |
| articles.snippet | Text showing a small portion of the knowledge article.Data type: String |
| articles.score | Relevancy score, results sorted in descending order by score.Data type: String |
| articles.title | Short description or title of the knowledge article.Data type: String |
| meta | Meta information of the results and request parameters.Data type: Object ``` "meta": { "count": Number, "end": Number, "fields": "String", "filter": "String", "kb": "String", "language": "String", "query": "String", "start": Number, "status": {Object}, "ts_query_id": "String" } ``` |
| meta.count | Number of available KB articles.Data type: Number |
| meta.end | Ending index of the result set.Data type: Number |
| meta.fields | Fields in the article.Data type: String |
| meta.filter | Filter used to acquire the data.Data type: String |
| meta.kb | List of knowledge base article sys\_ids.Data type: String |
| meta.language | List of comma-separated languages of the KB articles that were requested.Data type: String |
| meta.query | Specified request query.Data type: String |
| meta.start | Starting index of result set.Data type: Number |
| meta.status | Status of the call.Data type: String |
| meta.ts\_query\_id | Sys\_id of the query.Data type: String |
| Name | Description |
|---|---|
| api\_version | Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String |
| article\_sys\_id | Sys\_id of the knowledge article with the attachment you intend to retrieve.Data type: String Table: Knowledge Bases \[kb\_knowledge\] |
| attachment\_sys\_id | Sys\_id of record to which the attachment belongs.Data type: String |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Name | Description |
|---|---|
| api\_version | Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String |
| Name | Description |
|---|---|
| fields | Comma-separated list of fields from the Knowledge \[kb\_knowledge\] table to show details in results.Data type: String Default: None |
| kb | Comma-separated list of knowledge base sys\_ids from the Knowledge Bases \[kb\_knowledge\_base\] table to restrict results to.Data type: String |
| language | List of comma-separated languages in two-letter ISO 639-1 language code format to restrict results to. Alternatively type 'all' to search in all valid installed languages on an instance.Data type: String Default: User's session language or en |
| limit | Maximum number of records to return. Unusually large **limit** values can impact system performance. For requests that exceed this number of records, use the **offset** parameter to paginate record retrieval.Data type: Number Default: 30 |
| offset | Starting record index for which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks. For example, the first time this endpoint is called, **offset** is set to "0". To page through all available records, use `offset=offset+limit` until the end of the all records is reached. Data type: Number Default: 0 |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Name | Description |
|---|---|
| articles | List of articles returned in response.Data type: Array ``` "articles":[ { "fields": {Object}, "id": "String", "link": "String", "number": "String", "rank": Number, "score": Number, "snippet": "String", "title": "String" } ] ``` |
| articles.fields |
Values of requested fields, if any.Data type: Object
```
"fields": {
" |
| articles.fields.<field\_name> |
Lists each field requested using the fields parameter, if any.Data type: Object
```
" |
| articles.fields.<field\_name>.display\_value | Display value of the requested field.Data type: String |
| articles.fields.<field\_name>.name | Name of the requested field. Matches **<field\_name>**.Data type: String |
| articles.fields.<field\_name>.label | Label representing the requested field. For example, `Knowledge`.Data type: String |
| articles.fields.<field\_name>.type | Data type of requested field.Data type: String |
| articles.fields.<field\_name>.value | Value of the requested field.Data type: String |
| articles.id | Knowledge article sys\_id from the Knowledge \[kb\_knowledge\] table.Data type: String |
| articles.link | Link to the article.Data type: String |
| articles.number | Knowledge article number.Data type: String |
| articles.rank | Search rank of article specific to this search.Data type: Number \(Float\) |
| articles.score | Relevancy score, results sorted in descending order by score.Data type: String |
| articles.snippet | Text showing a small portion of the knowledge article.Data type: String |
| articles.title | Short description or title of the knowledge article.Data type: String |
| meta | Meta information of the results and request parameters.Data type: Object ``` "meta": { "count": Number, "end": Number, "fields": "String", "filter": "String", "kb": "String", "language": "String", "query": "String", "start": Number, "status": {Object}, "ts_query_id": "String" } ``` |
| meta.count | Number of available KB articles.Data type: Number |
| meta.end | Ending index of the result set.Data type: Number |
| meta.fields | Fields in the article.Data type: String |
| meta.filter | Filter used to acquire the data.Data type: String |
| meta.kb | List of knowledge base article sys\_ids.Data type: String |
| meta.language | List of comma-separated languages of the KB articles that were requested.Data type: String |
| meta.query | Specified request query.Data type: String |
| meta.start | Starting index of result set.Data type: Number |
| meta.status | HTTP status of the call.Data type: String |
| meta.ts\_query\_id | Sys\_id of the query.Data type: String |
| Name | Description |
|---|---|
| api\_version | Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String |
| id | Sys\_id or knowledge base \(KB\) number of a knowledge article.Data type: String Table: Knowledge \[kb\_knowledge\] |
| Name | Description |
|---|---|
| fields | Comma-separated list of fields from the Knowledge \[kb\_knowledge\] table to show details in results.Data type: String Default: None |
| language | Two letter ISO 639-1 language code; for example, "fr" for French. Results display only when searches use the knowledge article KB number as the **id** and a translated version of the article is available in the language specified.**Note:** Only valid when setting the **id** parameter as a KB number \(not sys\_id\). Data type: String |
| search\_id | Optional unless using **search\_rank**. Unique identifier of search that returned this article.You can retrieve **search\_id** using one of the following APIs that returns the **articles.id** element: - [Knowledge Management - GET /knowledge/articles](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/knowledge-api.md) - [Knowledge Management - GET /knowledge/articles/featured](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/knowledge-api.md) - [Knowledge Management - GET knowledge/articles/most\_viewed](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/knowledge-api.md) Passing the **search\_id** and **search\_rank** parameter increments the article view count and records an entry for the article in the Knowledge Use \[kb\_use\] table. You can also verify incremented view counts in Knowledge Base \[kb\_view2\] page. Data type: String |
| search\_rank | Optional unless using **search\_id**. Article [search rank](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-administration/c_DocumentScoring.md) by click-rate that you can retrieve using one of the following APIs that returns the **articles.rank** element:- [Knowledge Management - GET /knowledge/articles](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/knowledge-api.md) - [Knowledge Management - GET /knowledge/articles/featured](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/knowledge-api.md) - [Knowledge Management - GET knowledge/articles/most\_viewed](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/knowledge-api.md) Data type: Number |
| update\_view | Update view count and record an entry for the article in the Knowledge Use \[kb\_use\] table. True whether present as a standalone parameter or set to true. **Note:** If you pass **update\_view** with **search\_id** and **search\_rank**, **update\_view** is ignored because the view count will already be incremented. Data type: Boolean that is always handled as true when passed whether set to `"true"`, `"false"`, or not set at all. |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Name | Description |
|---|---|
| attachments | Provides attachment details for each instance if attachment exists.Only displays if `display_attachments = true`. Data type: Array of Objects ``` "attachments": [ { "file_name": "String", "size_bytes": "String", "state": "String", "sys_id": "String" } ] ``` |
| attachments.file\_name | File name of attachment.Data type: String |
| attachments.size\_bytes | File size.Data type: String Unit: Bytes |
| attachments.state | State.Possible values: - available - available\_conditionally - not\_available - pending Data type: String |
| attachments.sys\_id | Sys\_id of the attachment.Data type: String |
| content | Entire HTML content of the article.Data type: String |
| display\_attachments | Flag that indicates whether the **display\_attachments** flag is active for that article. Attachments are returned only if **display\_attachments** is true \(active\) in the knowledge article record.- true: **display\_attachments** is active. - false: **display\_attachments** is inactive. Data type: Boolean |
| embedded\_content | Lists each attachment containing embedded content by sys\_id and includes relevant attachment information.Only displays if `display_attachments = true`. Data type: Array of Objects ``` "attachments": [ { "file_name": "String", "size_bytes": "String", "state": "String", "sys_id": "String" } ] ``` |
| embedded\_content.file\_name | File name of the attachment.Data type: String |
| embedded\_content.size\_bytes | Size of the attachment.Data type: String Unit: Bytes |
| embedded\_content.state | State of the attachment. Possible values: - available - available\_conditionally - not\_available - pending Data type: String |
| embedded\_content.sys\_id | Sys\_id of the attachment.Data type: String |
| fields |
Values of requested fields \(if any\).Data type: Object
```
"fields": {
" |
| fields.<field\_name> |
Lists each field requested using the fields parameter, if any.Data type: Object
```
" |
| fields.<field\_name>.display\_value | Display value of the requested field.Data type: String |
| fields.<field\_name>.label | Label representing the requested field. For example, `Knowledge`.Data type: String |
| fields.<field\_name>.name | Name of the requested field. Matches **<field\_name>**.Data type: String |
| fields.<field\_name>.type | Data type of requested field.Data type: String |
| fields.<field\_name>.value | Value of the requested field.Data type: String |
| language | Two-letter ISO 639-1 language code for the current article \(if translation is available\).Data type: String |
| languages | For each translated version of a knowledge article \(if translated\):``` "languages": [ { "label": "String", "language": "String", "sys_id": "String" } ] ``` Data type: Array |
| languages.label | String representation for language.Data type: String |
| languages.language | Two-letter ISO 639-1 code language.Data type: String |
| languages.sys\_id | Unique identifier for translated version of knowledge article.Data type: String |
| number | Article number.Data type: String |
| short\_description | Short description or title of the knowledge article.Data type: String |
| sys\_id | Knowledge article sys\_id from the Knowledge \[kb\_knowledge\] table.Data type: String |
| template | Flag that indicates whether a returned article is a template.Possible values: - true: Article is a template. - false: Article is not a template. Data type: Boolean |
| template\_table | Name of template table, only returns if knowledge article is a template.Data type: String |
How to Deal with Spam
\r\nSpam has increasingly become a problem on the Internet. While every Internet user receives some spam, email addresses posted to web sites or in newsgroups and chat rooms attract the most spam.
\r\nTo reduce the amount of spam you receive:
\r\n"template": false, "number": "KB0000011", "sys_id": "0b48fd75474321009db4b5b08b9a71c2", "short_description": "How to Deal with Spam", "display_attachments": true, "attachments": [ { "sys_id": "dc27ae18294f4010f877796e707869c8", "file_name": "image.jpg", "size_bytes": "66792", "state": "available_conditionally" }, { "sys_id": "fedf5614294f4010f877796e70786956", "file_name": "attachment.txt", "size_bytes": "75", "state": "available_conditionally" } ], "embedded_content": [] } } ``` ### Sample cURL request \(update\_view\) ``` curl "https://instance.servicenow.com/api/sn_km_api/knowledge/KB0000020?update_view=' \ --request GET \ --header "Accept:application/json" \ --user "username":"password" ``` ``` { "result": { "content": "
\r\n
\r\n
Should I upgrade to Windows 8.x?
\r\nWindows 8.x is designed for using touch, mouse, and keyboard together, on hardware ranging from touch-enabled tablets and laptops to PCs and all-in-one computers...(intentionally truncated)
", "template": false, "number": "KB0000020", "sys_id": "9e528db1474321009db4b5b08b9a71a6", "short_description": "Windows: Should I upgrade to Windows 8.x?\t\t", "display_attachments": true, "attachments": [], "embedded_content": [] } } ``` ## Knowledge Management - GET knowledge/articles/most\_viewed Returns a list of knowledge articles prioritized by most-viewed. ### URL format Versioned URL: `/api/sn_km_api/{api_version}/knowledge/articles/most_viewed` Default URL: `/api/sn_km_api/knowledge/articles/most_viewed` **Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md). ### Supported request parameters| Name | Description |
|---|---|
| api\_version | Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String |
| Name | Description |
|---|---|
| fields | Comma-separated list of fields from the Knowledge \[kb\_knowledge\] table to show details in results.Data type: String Default: None |
| kb | Comma-separated list of knowledge base sys\_ids from the Knowledge Bases \[kb\_knowledge\_base\] table to restrict results to.Data type: String |
| language | List of comma-separated languages in two-letter ISO 639-1 language code format to restrict results to. Alternatively type 'all' to search in all valid installed languages on an instance.Data type: String Default: User's session language or en |
| limit | Maximum number of records to return. Unusually large **limit** values can impact system performance. For requests that exceed this number of records, use the **offset** parameter to paginate record retrieval.Data type: Number Default: 30 |
| offset | Starting record index for which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks. For example, the first time this endpoint is called, **offset** is set to "0". To page through all available records, use `offset=offset+limit` until the end of the all records is reached. Data type: Number Default: 0 |
| Header | Description |
|---|---|
| Accept | Data format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json** |
| Name | Description |
|---|---|
| articles | List of articles returned in response.Data type: Array ``` [ { "fields": {Object}, "id": "String", "link": "String", "number": "String", "rank": Number, "score": Float, "snippet": "String", "title": "String" } ] ``` |
| articles.fields |
Values of requested fields \(if any\).Data type: Object
```
"fields": {
" |
| articles.fields.<field\_name> |
Lists each field requested using the fields parameter, if any.Data type: Object
```
" |
| articles.fields.<field\_name>.display\_value | Display value of the requested field.Data type: String |
| articles.fields.<field\_name>.label | Label representing the requested field. For example, `Knowledge`.Data type: String |
| articles.fields.<field\_name>.name | Name of the requested field. Matches <field\_name>.Data type: String |
| articles.fields.<field\_name>.type | Data type of requested field.Data type: String |
| articles.fields.<field\_name>.value | Value of the requested field.Data type: String |
| articles.id | Knowledge article sys\_id from the Knowledge \[kb\_knowledge\] table.Data type: String |
| articles.link | Link to the article.Data type: String |
| articles.number | Knowledge article number.Data type: String |
| articles.rank | Search rank of article specific to this search.Data type: Float |
| articles.score | Relevancy score, results sorted in descending order by score.Data type: String |
| articles.snippet | Text showing a small portion of the knowledge article.Data type: String |
| articles.title | Short description or title of the knowledge article.Data type: String |
| meta | Meta information of the results and request parameters.Data type: Object ``` "meta": { "count": Number, "end": Number, "fields": "String", "filter": "String", "kb": "String", "language": "String", "query": "String", "start": Number, "status": {Object}, "ts_query_id": "String" } ``` |
| meta.count | Number of available KB articles.Data type: Number |
| meta.end | Ending index of the result set.Data type: Number |
| meta.fields | Fields in the article.Data type: String |
| meta.filter | Filter used to acquire the data.Data type: String |
| meta.kb | List of knowledge base article sys\_ids.Data type: String |
| meta.language | List of comma-separated languages of the KB articles that were requested.Data type: String |
| meta.query | Specified request query.Data type: String |
| meta.start | Starting index of result set.Data type: Number |
| meta.status | HTTP status of the call.Data type: String |
| meta.ts\_query\_id | Sys\_id of the query.Data type: String |