> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.syncspider.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to Set Up Datahub API Keys for Agency Users

**TABLE OF CONTENTS**

* [Description](#Description)
* [Steps to Create and Configure a Company API Key for DataHub](#Steps-to-Create-and-Configure-a-Company-API-Key-for-DataHub)
* [Step 1: Generate a Company API Key](#Step-1%3A-Generate-a-Company-API-Key)
* [1.1 Go to API Settings](#1.1-Go-to-API-Settings)
* [1.2 Create a New API Key](#1.2-Create-a-New-API-Key)
* [Step 2: Configure the API Key in DataHub Integration](#Step-2%3A-Configure-the-API-Key-in-DataHub-Integration)
* [2.1 Go to the Integrations Menu](#2.1-Go-to-the-Integrations-Menu)
* [2.2 Assign the API Key to the Correct Company](#2.2-Assign-the-API-Key-to-the-Correct-Company)
* [Troubleshooting](#Troubleshooting)

---
## Description

If you are an agency user managing multiple companies in SyncSpider and trying to use the **DataHub** integration, you may encounter a **4xx database error** when switching between companies. This issue occurs because SyncSpider caches API keys, causing an authentication failure when switching to a different company.

To prevent this, you must generate **separate API keys** for each company and correctly configure them within SyncSpider. This guide walks you through the process step by step.

---
## Steps to Create and Configure a Company API Key for DataHub
### 
### Step 1: Generate a Company API Key
#### 1.1 Go to API Settings

Log in to Datahub and on the **left-hand navigation menu**, click the **Settings (⚙️) icon**.

Select **API** from the available options.

![](https://storage.crisp.chat/users/helpdesk/website/-/7/c/9/7/7c972f4278056800/b5a93589-6c13-4802-9276-f73c66_1q65fzo.png)

---
#### 1.2 Create a New API Key

In the API tab you will see the list of all API Keys. Click on the green **Create API Key** button.

![](https://storage.crisp.chat/users/helpdesk/website/-/4/a/f/7/4af7b81fd31f5c00/4a16d05e-6e73-4df2-8caf-d54239_iw0nwc.png)

A pop-up window will appear and you need to do the following:

**Enter a name** for your API key.

Choose **Company API Key** from the dropdown.

![](https://storage.crisp.chat/users/helpdesk/website/-/f/f/d/b/ffdbc7354a368800/594e9a2d-c99e-4378-b82c-a97f0f_48pp2d.png)

Once you have selected company, a new dropdown will appear where you will select the specific company you want to associate with the key. Then click **Create** to generate the API key.

![](https://storage.crisp.chat/users/helpdesk/website/-/7/0/8/2/70824fd7e7a81400/ac90123e-d973-4170-a4bb-3bb465_19b6u9x.png)

---

**1.3 Copy the newly generated API key**

Once created the new API key will appear in your list of API Keys. Copy the API Key, you will need it in the next steps.

![](https://storage.crisp.chat/users/helpdesk/website/-/a/1/7/d/a17d0b3bef12b800/31448c40-97b8-46bb-9fbf-4780b8_1qq4m8c.png)

---
### Step 2: Configure the API Key in DataHub Integration
#### 2.1 Go to the Integrations Menu

Back in SyncSpider, click on the **Integrations icon** in the left-hand menu. Find the **DataHub integration**.

Click the **three dots (⋮) menu** on the integration tile. Select **Config**.

![](https://storage.crisp.chat/users/helpdesk/website/-/4/7/b/a/47ba1b75f15d8400/6671c046-cf00-4cfd-9e62-41b179_e5rr9m.png)

---
#### 2.2 Assign the API Key to the Correct Company

In the **API Key** field, **paste the company-specific API key** you created in Step 1.

From the **Company dropdown**, select the corresponding company. Click **Save** to finalize the setup.

### 
## 
## Troubleshooting

**Still seeing a 404 error?**

* Ensure you have selected the correct company when generating the API key.
* If you previously tried using Datahub with another company, clear your browser cache and refresh SyncSpider before trying again.
* Re-enter the API key in the **Config** section to ensure it's correctly applied.

**Switching between companies?**

* Remember that SyncSpider caches API keys. If you switch companies and use Datahub, always **update the API key** in the **Config settings** to prevent authentication errors.

We hope that this covers everything. If you have any further questions or need additional clarification please reach out to us via [[email protected]](/cdn-cgi/l/email-protection#9ae9efeaeaf5e8eedae9e3f4f9e9eaf3feffe8b4f9f5f7) or our Chat Widget!