# Hive Hive API

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

This page documents Hive payloads for the datastore API: sample requests with placeholder values to replace with your own. 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/response schemas, visit the [API docs](https://userguide.qualytics.io/api/docs).

Each example includes endpoint details, sample payloads, and instructions on how to replace placeholder values with actual data relevant to your setup.

## Creating a Datastore

This section provides a sample payload for creating a datastore. Replace the placeholder values with actual data relevant to your setup.

### Endpoint (Post)

`/api/datastores` *(post)*

**Tab: Creating a datastore with a new connection**

```json
    {
        "name": "your_datastore_name",
        "teams": ["Public"],
        "schema": "hive_schema",
        "enrichment_only": false,
        "trigger_sync": true,
        "connection": {
            "name": "your_connection_name",
            "type": "hive",
            "host": "hive_host",
            "port": 10000,
            "username": "hive_username",
            "password": "hive_password",
            "parameters": {
                "zookeeper": false,
                "authentication_type": "BASIC"
            }
        }
    }
```

**Tab: Creating a Kerberos datastore with a new connection**

```json
    {
        "name": "your_datastore_name",
        "teams": ["Public"],
        "schema": "hive_schema",
        "enrichment_only": false,
        "trigger_sync": true,
        "connection": {
            "name": "your_connection_name",
            "type": "hive",
            "host": "hive_host",
            "port": 10000,
            "username": "qualytics@EXAMPLE.COM",
            "password": "<base64-encoded keytab>",
            "parameters": {
                "zookeeper": false,
                "authentication_type": "KERBEROS",
                "hive.metastore.kerberos.principal": "hive/_HOST@EXAMPLE.COM",
                "krb5_base64": "<krb5.conf contents>"
            }
        }
    }
```

The **Client Principal** travels as `username`, and the keytab as `password`, base64 encoded, because it is a binary file and belongs in the encrypted field. The **HiveServer2 Service Principal** goes in `parameters` as `hive.metastore.kerberos.principal`. When the connection sends its own keytab, you can leave it out to use `hive/_HOST@` followed by the realm of `username`; a connection without its own keytab has no such default, so send the service principal. `krb5_base64` accepts the file's text as-is. For ZooKeeper HA, set `zookeeper` to `true` and list the quorum hosts in `host`, with their client port on each host or in `port`.

**Tab: Creating a datastore with an existing connection**

```json
    {
        "name": "your_datastore_name",
        "teams": ["Public"],
        "schema": "hive_schema",
        "enrichment_only": false,
        "trigger_sync": true,
        "connection_id": 123
    }
```

**Tab: Create a Source Datastore using the CLI**

```bash
# Step 1: Create a Connection
qualytics connections create \
    --type hive \
    --name "your_connection_name" \
    --host ${HIVE_HOST} \
    --port 10000 \
    --username ${HIVE_USER} \
    --password ${HIVE_PASSWORD}

# Step 2: Create a Source Datastore
qualytics datastores create \
    --name "your_datastore_name" \
    --connection-name "your_connection_name" \
    --schema default
```

## Link an Enrichment Destination

### Endpoint (Patch)

`/api/datastores/{datastore-id}/enrichment/{enrichment-id}` *(patch)*

*Last updated: November 16, 2026.*
