ServiceNow
Overview
ServiceNow’s Knowledge Base can now be integrated with Leena AI’s KM dashboard, allowing ServiceNow Knowledge Articles to reflect in KM. We can check more about ServiceNow’s knowledge base here.
Granting ServiceNow Access Using OAuth
There are 2 approaches to connect the ServiceNow knowledge base with Leena KM via OAuth access.
- OAuth Token Based (Recommended approach)
- OAuth Password Based
1. OAuth Token Based (Recommended)
-
Go to your ServiceNow developer instance and select “Application Registry” under “System OAuth”.

-
Click on “New” application and select the following option: “Create an OAuth API endpoint for external clients”.

-
Enter the required details and click on “Submit”.

Important: Kindly make sure to keep the refresh token lifespan long enough so that the sync with Leena KM does not expire.
-
Please note the Client ID and Client Secret from this step.
-
Use the API to generate the refresh token which will be used in the ServiceNow connector with Leena AI with same user.

-
Service Account Requirements & Permissions
Required user roles
Ensure the integration user is assigned the following roles within the ServiceNow instance:
- knowledge_admin Provides administrative access to the knowledge base.
- user_criteria_admin Permission to manage user criteria rules that control knowledge base access and visibility.
- snc_read_only Provides read-only access to ServiceNow platform tables and records.
- snc_internal Grants access to internal ServiceNow APIs and platform services.
- rest_api_explorer Ability to discover and test REST API endpoints directly through the interface.
OAuth token scopes
The following scopes must be enabled on the OAuth token to permit API communication:
Data Access- Table API
Read access to ServiceNow tables, specifically:
kb_knowledge,kb_category, andkb_knowledge_base. - Attachment API Permission to read and retrieve attachments linked to specific knowledge articles.
- Aggregate API Ability to run aggregate queries, such as retrieving record counts on knowledge tables.
- Knowledge General access to knowledge-specific API endpoints and system resources.
2. OAuth Password Based
-
Go to your ServiceNow developer instance and select “Application Registry” under “System OAuth”.

-
Click on “New” application registration and select the following option: “Create an OAuth JWT API endpoint for external clients”.

-
Enter the required details and click on “Submit”.
Check the field “Accessible from” set it to “All application scopes”
-
Please note the “Client Id” and “Client Secret” from this application.
-
Service Account Requirements & Permissions
User roles
The following roles must be assigned to the service account user:
- knowledge_admin Provides administrative access to the knowledge base.
- user_criteria_admin Required to fetch user criteria rules for access control.
- snc_read_only Effectively restricts the service account user to read-only access across the platform.
- snc_internal Grants access to internal ServiceNow APIs. For more details, refer to the ServiceNow Documentation on Explicit Roles.
- rest_api_explorer Provides the ability to discover and test REST API endpoints via the ServiceNow UI.
Leena AI Configuration
KM-ServiceNow Integration via OAuth Token (Recommended)
-
Go to KM Dashboard >> Settings >> Integrations >> ServiceNow.
-
Fill in the required details:
- Client ID
- Client Secret
- Refresh Token
- Instance URL
-
Select the setting to move fetched articles to Directly Published state in KM or Draft state.
-
(Optional) Select the option to fetch permissions for ServiceNow.

KM-ServiceNow Integration via OAuth Password
- Go to KM Dashboard >> Settings >> Integrations >> ServiceNow.
- Fill in the required details:
- Username (Instance username): This is the user who created the application.
- Password (Instance password)
- Client ID
- Client Secret
- Instance URL
- Select the setting to move fetched articles to Directly Published state in KM or Draft state.
- (Optional) Select the option to fetch permissions for ServiceNow.
Syncing
Once the connection is successful, we can sync the Knowledge Articles from ServiceNow to KM. We will sync the list of all the knowledge bases; however, users can select specific knowledge bases to be synced with Leena KM.
ServiceNow Integration: FAQs
General & Authentication
Q: What is the purpose of the ServiceNow integration? A: This integration allows you to connect your ServiceNow Knowledge Base with Leena AI's Knowledge Management (KM) dashboard, enabling your ServiceNow Knowledge Articles to be synced and displayed within Leena AI.
Q: What connection methods are available? A: There are two approaches to connect using OAuth:
- OAuth Token Based (Recommended)
- OAuth Password Based
Q: Which connection method is recommended? A: The OAuth Token Based method is the recommended approach.
Configuration
Q: How do I get a Client ID and Client Secret from ServiceNow? A: You must go to your ServiceNow developer instance and navigate to System OAuth > Application Registry. When you register a new application (for either the Token or Password-based method), ServiceNow will provide a Client ID and Client Secret.
Q: What details are required for the recommended (OAuth Token Based) setup in Leena AI? A: You will need to provide the following four items in the Leena AI KM dashboard:
- Client ID
- Client Secret
- Refresh Token
- Instance URL
Q: How do I get the Refresh Token for the recommended method? A: After creating your OAuth application, you must use the provided API command to generate the refresh token. This token is then used in the Leena AI connector settings.
Q: Why is a long Refresh Token lifespan important? A: You should configure a long lifespan for your refresh token in ServiceNow to ensure that the sync connection with Leena AI's KM does not expire unexpectedly.
Q: What details are required for the (OAuth Password Based) setup in Leena AI? A: You will need to provide the following five items:
- Username (the ServiceNow user who created the application)
- Password (for that user)
- Client ID
- Client Secret
- Instance URL
Syncing
Q: Do I have to sync all my Knowledge Bases? A: No. While the integration will sync the list of all available Knowledge Bases, you can select which specific ones you want to sync with Leena AI's KM.
Q: What happens to articles after they are synced? A: You can choose. The settings allow you to configure whether fetched articles are moved directly to a published state or to a draft state within Leena AI.
Q: Can I sync the permissions for my ServiceNow articles? A: Yes, the integration settings include an option to fetch and sync permissions from ServiceNow.
Updated about 19 hours ago
