---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - en/operations/connection/create-api-connector
  - ru/operations/connection/create-api-connector
  - href: en/operations/connection/create-api-connector.md
    type: text/markdown
    title: Markdown version
csp:
  - script-src:
      - https://mc.yandex.ru
    img-src:
      - https://mc.yandex.ru
    connect-src:
      - https://mc.yandex.ru
      - wss://mc.yandex.ru
    child-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-ancestors:
      - 'blob:'
      - https://mc.yandex.ru
canonical: en/operations/connection/create-api-connector.html
title: How to create an API Connector connection in DataLens On-premises
description: Follow this guide to create an API Connector in DataLens On-premises.
vcsPath: en/operations/connection/create-api-connector.md
---

# Creating an API Connector connection


With API Connector in DataLens On-premises, you can send HTTP requests to any API on the internet. You can use such a connection only in [Editor](../../charts/editor/index.md) as it is not supported in [QL charts](../../concepts/chart/ql-charts.md) or [dataset-based charts](../../concepts/chart/dataset-based-charts.md).

To create an API Connector connection, follow these steps:

1. Select a workbook for the new connection and click **Create** → **Connection**.
1. Under **Files and services**, select **API Connector**.
1. Configure the connection as follows:

   * **Host name**: Specify the path to the host you will send a request to.
   * **Port**: Specify the API connection port.
   * **URL path**: Optionally, specify the path to the API (part of the [URL](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL) without a protocol, host name, or port).
   * **HTTPS**: Enable the secure connection option if your server supports HTTPS.
   * **Allowed methods**: Select a method to send an HTTP request to the API. The available methods are `GET`, `POST`, `PUT`, `PATCH`, and `DELETE`.
   * Add public and private headers to your HTTP request as key-value pairs. To do this, click **Add**, select the header, and enter its value.

     * **Public request headers** do not contain sensitive data. You can view values of public headers at any time in the connection settings. The following public headers are available:
     
       * `Accept-Charset`: List of supported response encodings.
       * `Accept-Encoding`: List of supported response contents encoding methods.
       * `Accept-Language`: List of supported natural languages.
       * `Prefer`: HTTP status code to send in the response.
     
     * **Private request headers** are used for sensitive data. Their values are encrypted; you cannot view them in the connection settings, but you can replace them with new values. The following private headers are available:

       * `Authorization`: API authentication data.
       * `X-Api-Key`: API key for authentication in ClickHouse®.
       * `X-ClickHouse-User`: Username for authentication in ClickHouse®.
       * `X-ClickHouse-Key`: User password for authentication in ClickHouse®.

   ![image](../../_assets/datalens/operations/connection/connection-api.png)

1. Click **Create connection**.
1. Select a [workbook](../../workbooks-collections/index.md) to save your connection to or create a new one. If using legacy folder navigation, select a folder to save the connection to. Click **Create**.
1. Enter a name for the connection and click **Create**.


<!-- source: en/_includes/clickhouse-disclaimer.md -->
_ClickHouse® is a registered trademark of [ClickHouse, Inc](https://clickhouse.com)._
<!-- endsource: en/_includes/clickhouse-disclaimer.md -->
