# SAP HANA SAP HANA API

Source: https://userguide.qualytics.io/source-datastore/datastore/jdbc/sap-hana/how-tos/api/

This page documents SAP HANA-specific payload fields for the datastore API. For generic operations (get, list, update, delete, multi-schema bulk), see [Datastore API](https://userguide.qualytics.io/source-datastore/datastore/api/).

> **Tip: Complete API Reference**
>
> For the full interactive API documentation with all request and response schemas, visit the [API docs](https://userguide.qualytics.io/api/docs).

SAP HANA supports a single authentication mode (basic username and password). You can create a datastore with a new inline connection or reuse an existing connection. Both modes use the same endpoint:

**Endpoint**: `POST /api/datastores`

**Permission**: Manager, plus the **Editor** team permission on at least one of the assigned teams (the **Public** team when `teams` is left out). Admins are exempt.

---

## UI ↔ API field mapping

The API names a few fields differently from the UI. The mapping below avoids the most common copy-paste mistakes.

| UI form field | API field | HANA concept | Example |
| --- | --- | --- | --- |
| **Connection > Host** | `connection.host` | HANA endpoint | `xxxxxxxx.hna1.prod-us10.hanacloud.ondemand.com` |
| **Connection > Port** | `connection.port` | HANA SQL port | `443` (HANA Cloud) or `39015` (on-premises) |
| **Connection > Username** | `connection.username` | HANA database user | `QUALYTICS_READER` |
| **Connection > Password** | `connection.password` | HANA user password | `<secret>` |
| **Connection > Encryption** | `connection.parameters.encryption` | TLS posture | `verify`, `skip_verify`, or `none` |
| **Datastore > Database** | `database` | HANA tenant database name (optional) | `H00` |
| **Datastore > Schema** | `schema` | HANA schema inside the tenant | `SALES` |

## Connection Fields

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `host` | string | Yes |  | HANA endpoint. HANA Cloud URL or on-premises hostname/IP. |
| `port` | integer | No | `443` | HANA SQL port. Override to the tenant-specific port on on-premises deployments. |
| `username` | string | Yes |  | HANA database user with `SELECT` privileges on the target schema. |
| `password` | string | Yes |  | HANA user password. |
| `parameters.encryption` | string | No | `verify` | TLS posture: `verify`, `skip_verify`, or `none`. HANA Cloud requires `verify`. |

## Datastore Fields

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `database` | string | No |  | HANA tenant database name. Leave blank for HANA Cloud (the tenant is encoded in the hostname); set for on-premises multi-tenant deployments. |
| `schema` | string | Yes |  | HANA schema inside the tenant (e.g., `SALES`, `TPCH`). |

> **Note: About trigger_sync**
>
> The `trigger_sync: true` flag in the examples below tells Qualytics to immediately sync metadata after creating the datastore, equivalent to ticking the **Initiate Sync** toggle in the UI. Set it to `false` if you want to defer the first sync.

---

## Create with a New Connection

**Tab: HANA Cloud**

On HANA Cloud, the tenant database is encoded inside the hostname, so omit the `database` field. The default port is `443` and TLS is enforced by the driver.

> **Example: Example request and response**
>
> **Request**:
>
> ```bash
> curl -X POST "https://your-instance.qualytics.io/api/datastores" \
>   -H "Authorization: Bearer YOUR_TOKEN" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "name": "SAP HANA Production",
>     "connection": {
>       "name": "hana_production",
>       "type": "hana",
>       "host": "xxxxxxxx.hna1.prod-us10.hanacloud.ondemand.com",
>       "port": 443,
>       "username": "QUALYTICS_READER",
>       "password": "<strong-password>",
>       "parameters": {
>         "encryption": "verify"
>       }
>     },
>     "schema": "SALES",
>     "teams": ["Data Platform"],
>     "trigger_sync": true
>   }'
> ```
>
> **Response** (200 OK):
>
> ```json
> {
>   "id": 42,
>   "name": "SAP HANA Production",
>   "type": "hana",
>   "store_type": "jdbc",
>   "schema": "SALES",
>   "connected": true
> }
> ```

**Tab: On-Premises**

For on-premises HANA, set `port` to the tenant SQL port (typically `3<instance>15`, for example `39015`) and supply the tenant database in `database` when connecting to a multi-tenant container deployment.

> **Example: Example request and response**
>
> **Request**:
>
> ```bash
> curl -X POST "https://your-instance.qualytics.io/api/datastores" \
>   -H "Authorization: Bearer YOUR_TOKEN" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "name": "SAP HANA Finance",
>     "connection": {
>       "name": "hana_finance",
>       "type": "hana",
>       "host": "hana-prod.acme.internal",
>       "port": 39015,
>       "username": "QUALYTICS_READER",
>       "password": "<strong-password>",
>       "parameters": {
>         "encryption": "verify"
>       }
>     },
>     "database": "H00",
>     "schema": "FINANCE",
>     "teams": ["Finance Team"],
>     "trigger_sync": true
>   }'
> ```
>
> **Response** (200 OK):
>
> ```json
> {
>   "id": 43,
>   "name": "SAP HANA Finance",
>   "type": "hana",
>   "store_type": "jdbc",
>   "database": "H00",
>   "schema": "FINANCE",
>   "connected": true
> }
> ```

---

## Create with an Existing Connection

If you have already created a SAP HANA connection (via this API or the UI), reuse it by passing its `connection_id`. The credentials are reused from the existing connection. You only need to specify datastore-level fields like `database`, `schema`, and `teams`.

> **Example: Example request and response**
>
> **Request**:
>
> ```bash
> curl -X POST "https://your-instance.qualytics.io/api/datastores" \
>   -H "Authorization: Bearer YOUR_TOKEN" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "name": "SAP HANA Marketing",
>     "connection_id": 7,
>     "schema": "MARKETING",
>     "teams": ["Marketing Team"],
>     "trigger_sync": true
>   }'
> ```
>
> **Response** (200 OK):
>
> ```json
> {
>   "id": 44,
>   "name": "SAP HANA Marketing",
>   "type": "hana",
>   "store_type": "jdbc",
>   "schema": "MARKETING",
>   "connected": true
> }
> ```

---

## Other Operations

For get, list, update, delete, test connection, multi-schema bulk creation, and end-to-end automation examples, see the [Datastore API](https://userguide.qualytics.io/source-datastore/datastore/api/) reference.

*Last updated: November 3, 2026.*
