> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kombo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Connection setup

The first part of the implementation is the setup of the connection. Your customer needs to generate and share their API credentials so that we can make the necessary API calls for the integration.

<img src="https://mintcdn.com/kombo/DniMaFamDeZQwfSo/images/ta-connection-setup.png?fit=max&auto=format&n=DniMaFamDeZQwfSo&q=85&s=e69206d4ee8c44b65e9f70693d977831" alt="1376" width="2478" height="532" data-path="images/ta-connection-setup.png" />

There are [multiple ways of implementing this step](/ats/getting-started/create-integrations#ways-of-creating-integrations), but during your development and for the first customers we highly recommend, just using the Magic Link feature that we provide. This guide will therefore assume that you are using the magic links for setting up the connection.

1. Generate a link for your customer. You only have to go into the [dashboard](https://app.kombo.dev/integrations) and:
   * Click on New integration

     <img src="https://mintcdn.com/kombo/DniMaFamDeZQwfSo/images/ta-click-new-integration.png?fit=max&auto=format&n=DniMaFamDeZQwfSo&q=85&s=39e7854936e58589e7765011f03af2c5" alt="Click on new integration.png" width="450" data-path="images/ta-click-new-integration.png" />

   * Click on "Let your customer create the integration" (during development, you can also use the first option).

     <img src="https://mintcdn.com/kombo/DniMaFamDeZQwfSo/images/ta-click-let-your-customer-create.png?fit=max&auto=format&n=DniMaFamDeZQwfSo&q=85&s=456fae0b9a8a5a44c5654046c6cda23b" alt="Click on let your customer create.png" width="270" data-path="images/ta-click-let-your-customer-create.png" />

   * Click on "Continue".

     <img src="https://mintcdn.com/kombo/DniMaFamDeZQwfSo/images/ta-click-continue.png?fit=max&auto=format&n=DniMaFamDeZQwfSo&q=85&s=894f4bb4611ba8b3ea1f32cfba24c38f" alt="Click on continue.png" width="270" data-path="images/ta-click-continue.png" />

   * Copy the link.

     <img src="https://mintcdn.com/kombo/DniMaFamDeZQwfSo/images/ta-copy-link.png?fit=max&auto=format&n=DniMaFamDeZQwfSo&q=85&s=3a388cef170a6c0ff14f6bcb649dde77" alt="Copy link.png" width="270" data-path="images/ta-copy-link.png" />

2. Wait for your customer to generate and enter their API credentials. You can see the status of any sent-out connection link in the [Kombo dashboard](https://app.kombo.dev/pending-connections).

   <Note>
     🦉 Setting up the credentials for an integration can be tricky for your non-technical users. That's why we highly recommend sharing our [step-by-step connection guides](https://help.kombo.dev/hc/en-us/sections/14349683218961-Connection-Guides) with them or guiding them through the process on a short call.
   </Note>

3. Receive the `integration-created` [webhook](/ats/guides/webhooks#integration-created). We send this webhook every time one of your customers creates a new integration.

   ```json theme={null}
   {
     "id": "5gjAtURLPbnTiwgkaBfiA3WJ",
     "type": "integration-created",
     "data": {
       "id": "personio:CBNMt7dSNCzBdnRTx87dev4E",
       "tool": "personio",
       "category": "HRIS",
       "end_user": {
         "origin_id": "36123",
         "creator_email": "user@example.com",
         "organization_name": "Acme, Inc."
       }
     }
   }
   ```

   The `end_user.origin_id` [is submitted by you](/ats/v1/post-connect-create-link#:~:text=HRIS%22%2C%0A%20%20%22integration_tool%22%3A%20%22personio%22%2C-,%22end_user_origin_id%22%3A%20%22123%22%2C,-%22language%22%3A%20%22en%22%0A%7D%27) when creating a connection link and should represent the ID of your customer in your database. You need to store this ID in your database so that you'll know which ATS belongs to which customer. For example, if you have two customers with the IDs "42" and "43", then your database could look as follows after the integrations have been created:

   | end\_user.origin\_id | kombo\_integration\_id                    |
   | -------------------- | ----------------------------------------- |
   | 42                   | `personio:8d1hpPsbjxUkoCoa1veLZGe5`       |
   | 43                   | `successfactors:B1hu5NGyhdjSq5X3hxEz4bAN` |

   <Note>
     ⚠️ **This ID is not for public display** and should only be accessible to your backend. The ID is not a secret as such but it's one of two things needed alongside the API key. There is no way to list all integration IDs via the API key so even in a case of accidental API key leak, the data would still be safe.
   </Note>

**Alerting for customer problems**

We will send you a `connection-flow-failed` [webhook](/ats/guides/webhooks#connection-flow-failed) every time a customer is running into an issue. You should set up some sort of alerting based on this webhook so that you can be fast to offer help to your customer, should they have an error when setting up an integration.

```json theme={null}
{
  "id": "5gjAtURLPbnTiwgkaBfiA3WJ",
  "type": "connection-flow-failed",
  "data": {
    "integration_tool": "personio",
    "integration_category": "ATS",
    "end_user": {
      "origin_id": "123456",
      "creator_email": "user@example.com",
      "organization_name": "Acme, Inc."
    },
    "log_url": "https://app.kombo.dev/env/production/logs/C3xUo6XAsB2sbKC7M1gyXaRX"
  }
}
```

**Handling deleted integrations**

It is of course also possible to delete integrations. This can be done in two ways:

* via the ["delete integration"-endpoint](/ats/v1/delete-integrations-integration-id). If you are calling this endpoint you should also take care of deleting the `kombo_integration_id` from your database.
* via the `integration-deleted` [webhook](/ats/guides/webhooks#integration-deleted). This will be sent to you if someone goes into the Kombo dashboard and deletes an integration manually. Also then you'll have to remove the `kombo_integration_id` from your database.

  ```json theme={null}
  {
    "id": "5gjAtURLPbnTiwgkaBfiA3WJ",
    "type": "integration-deleted",
    "data": {
      "id": "personio:CBNMt7dSNCzBdnRTx87dev4E",
      "tool": "personio",
      "category": "ATS",
      "end_user": {
        "origin_id": "123456",
        "creator_email": "user@example.com",
        "organization_name": "Acme, Inc."
      },
      "deleted_at": "2022-11-02T10:50:10.242Z"
    }
  }
  ```
