Skip to main content

REST APIs

This guide covers User-Agent configuration for direct REST API calls to Databricks.

Unity Catalog REST APIs

For the Databricks REST APIs, use the User-Agent header to identify your product and ISV in every API request:

-H "User-Agent: <isv-name_product-name>/<product-version>"

SQL Execution API

curl -X POST "$DATABRICKS_HOST/api/2.0/sql/statements" \
-H "Authorization: Bearer $DATABRICKS_TOKEN" \
-H "User-Agent: <isv-name_product-name>/<product-version>" \
-H "Content-Type: application/json" \
-d "{
\"warehouse_id\": \"$DATABRICKS_SQL_WAREHOUSE_ID\",
\"catalog\": \"<catalog>\",
\"schema\": \"<schema>\",
\"statement\": \"<your SQL here>\"
}"

Jobs API

curl -X GET "$DATABRICKS_HOST/api/2.0/jobs/list" \
-H "Authorization: Bearer $DATABRICKS_TOKEN" \
-H "User-Agent: <isv-name_product-name>/<product-version>" \
-H "Content-Type: application/json"

Iceberg integration

For Apache Iceberg client access, include a User-Agent identifier in SDK and REST API calls.

Iceberg SDK (Java)

Map<String, String> props = new HashMap<>();
props.put("type", "rest");
props.put("uri", catalogApi);
props.put("warehouse", warehouse);
props.put("security", "oauth2");
props.put("oauth2-server-uri", tokenUri);
props.put("scope", "all-apis");
props.put("credential", clientId + ":" + clientSecret);

// Set User-Agent for Iceberg REST catalog
props.put("header.User-Agent", "<isv-name_product-name>/<product-version>");
System.out.println("Using User-Agent: " + props.get("header.User-Agent"));

RESTCatalog catalog = new RESTCatalog();
catalog.initialize("partner_rest", props);

Iceberg REST API calls

String v1CredsUrl = catalogApi + "/v1/catalogs/" + warehouse +
"/namespaces/" + schema + "/tables/" + table + "/credentials";

HttpURLConnection conn = (HttpURLConnection) new URL(v1CredsUrl).openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Authorization", "Bearer " + accessToken);
conn.setRequestProperty("User-Agent", "<isv-name_product-name>/<product-version>");

What's next

  • Configure Databricks Connect: Set up telemetry for Spark sessions. See Databricks Connect.
  • Configure libraries: Implement telemetry for Python and Scala libraries. See Libraries & UDFs.
  • Review User-Agent format: Understand the required format and guidelines. See Telemetry & Attribution.