# Integrating with Keka HR

[Prerequisites](#prerequisites)

[Keka HR Setup](#sapling-setup)\
&#x20;  [Locating and Generating New API Keys](#locating-and-generating-new-api-keys)

[Drivetrain Setup](#sapling-setup-1)\
&#x20;  [Setting up Keka HR Integration](#locating-and-generating-new-api-keys-1)

## Prerequisites

To connect Keka HR to Drivetrain, you need:

* An active Keka HR account
* Global-Admin privileges on Keka HR
* Admin privileges in Drivetrain

## Keka HR Setup <a href="#sapling-setup" id="sapling-setup"></a>

Drivetrain supports in-built integration with Keka HR. You would need to generate and enter API Keys from an account with administrator access to get started.

{% hint style="info" %}
Please note Keka's API access is currently in a closed beta phase and requires your account to include the API & Webhooks Add-On, which may have associated costs. Please reach out to <support@keka.com> to inquire about the status of this add-on with your account if it is not already enabled.
{% endhint %}

### Locating and Generating New API Keys <a href="#locating-and-generating-new-api-keys" id="locating-and-generating-new-api-keys"></a>

1. Navigate to **Settings** by selecting the gear icon in the upper left-hand corner of the page.
2. Under **Integrations and Automation** navigate to the **API Access** tab.
3. Enable API Access if you have not yet done so.
4. Copy the **Client Id** and **Client Secret** as it will be displayed only once, and they are mandatory for accessing the API.&#x20;

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2FjkVL7LXtsf82GTnx34jV%2Fkeka1.png?alt=media&#x26;token=8a70a38d-b3a9-42df-931c-0a80d6565e8a" alt=""><figcaption></figcaption></figure>

5. Create an API Key by selecting the **Create key** button, enter the name as "Drivetrain Integration" and select an expiry date (preferably a year or more from the day you are creating).&#x20;
6. Select the necessary scopes you need for the implementation and copy the **API key** and store it in a secure document along with Client ID and Client Secret.&#x20;

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2FjqNDzf4jRmiYOAE13Av6%2Fkeka2.png?alt=media&#x26;token=5b8a6aa0-c704-4918-ae04-6e84bb40aef3" alt=""><figcaption></figcaption></figure>

7. Get the subdomain of your Keka HR account, for example if you login keka at mycompany.keka.com then your subdomain is "**mycompany**"

{% hint style="info" %}
Please note the following details are required for setting up Keka HR:

1. Client ID
2. Client Secret
3. API Key
4. Subdomain
   {% endhint %}

## Drivetrain Setup <a href="#sapling-setup" id="sapling-setup"></a>

### Setting up Keka HR Integration <a href="#locating-and-generating-new-api-keys" id="locating-and-generating-new-api-keys"></a>

1. Go to Drivetrain's data page and Click on **+** button on top left corner

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2FU8trlD0o31CYQxzOxxEh%2Fimage.png?alt=media&#x26;token=be7b5090-c070-4a40-997d-cd239355a861" alt=""><figcaption></figcaption></figure>

2. Select the Keka HR connector from the list of integrations and enter the **Subdomain** of your account and click **Next**

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2FfSY5kp6FvU89GzL8RA14%2Fimage.png?alt=media&#x26;token=26cf293a-60c3-4167-ad78-8ecb7ef0855e" alt=""><figcaption></figcaption></figure>

3. Enter Client ID, Client Secret and API key generated from previous steps and click **Next**

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fqk0u4wbpNISdZZ7hFzZc%2Fimage.png?alt=media&#x26;token=346da1e6-cfd3-451d-bcff-a389dbecc070" alt=""><figcaption></figcaption></figure>

4. After a successful authentication, you will be directed back to Drivetrain's **Connected Integrations** page. Once the data sync is completed, you will be able to see the Keka HR Datasets.
