Skip to main content
Honeydew provides a GraphQL API, that allows to directly call the Honeydew service.
This guide covers a direct connection to the Honeydew API using GraphQL.It is also possible to use Honeydew APIs with a Snowflake Connection, by calling the Snowflake Native Application API.
Public GraphQL API is not enabled by default. To enable for your organization, please contact support@honeydew.ai.

Use Cases

Embedded Analytics

The GraphQL API can be used to build embedded analytics applications that leverage the semantic layer. This allows you to build custom applications that use the semantic layer to generate queries and retrieve data.

Building custom AI analyst applications

The GraphQL API can be used to build custom AI analyst applications that leverage the semantic layer to answer user questions in natural language.

Metadata Sharing

The GraphQL API can be used to share metadata with other applications or services. For example, you can use the GraphQL API to share metadata with a data catalog or a data governance tool, or to import metadata from another system into Honeydew.

BI Integration

The GraphQL API can be used to publish metadata to BI tools, such as Tableau, Power BI, Thoughtspot, and more.

Development and Testing

The GraphQL API can be used to develop and test semantic layer definitions. Developers can use their favorite development tools to edit the semantic layer definitions, push them directly to git, and use the GraphQL APIs to validate the definitions. These validations can also be integrated into CI/CD pipelines to ensure that the semantic layer definitions are valid before deploying them to production.

Usage

Security

You can use the GraphQL API with an API Key and Secret. You cannot use the GraphQL API with a Honeydew username and password.
Different API queries and mutations require different permissions. Therefore, in order to follow the principal of least privileges as a best practice, you may need to create different API keys for different use cases.Each query or mutation below specifies the required permissions.
It is recommended to restrict API access to specific IP addresses or ranges, by using the IP Access Control feature. To set up IP Access Control, please contact support@honeydew.ai.

API Endpoint

The default API endpoint is https://api.honeydew.cloud/api/public/v1/graphql. If your organization uses a custom hostname for the API connection, you can locate it in the Honeydew UI, under the API section in Settings.

Headers

The following custom Honeydew headers can be used in the API requests:
  • X-Honeydew-Client: A string that identifies the client making the request. Use it to identify the client in Honeydew logs and query history, for audit, debugging and support purposes.
  • X-Honeydew-Workspace: The name of the workspace to use for the request. This is required for most queries and mutations that operate on a specific workspace.
  • X-Honeydew-Branch: The name of the branch to use for the request. This is required for most queries and mutations that operate on a specific branch.

Rate Limiting

The Public API implements rate limiting to ensure fair usage and system stability. Rate limits are applied per user (or per API key) and are enforced according to industry standards. Default Rate Limit: 60 calls per user/key per minute Response Headers: The API provides rate limit information through standard HTTP response headers:
  • RateLimit-Limit: The maximum number of requests allowed per time window
  • RateLimit-Remaining: The number of requests remaining in the current time window
  • RateLimit-Reset: The timestamp when the rate limit will reset (in Unix epoch seconds)
Monitor these headers in your API responses to implement proper rate limiting in your applications and avoid hitting rate limits unexpectedly.
When you exceed the rate limit, the API will return a 429 Too Many Requests HTTP status code. Implement exponential backoff and retry logic in your applications to handle rate limiting gracefully.
If you need to increase your rate limits beyond the default, please contact support@honeydew.ai to discuss your requirements.

API integration example

Below we have provided API integration examples for Python, JavaScript and cURL. The API can be used with any programming language that supports HTTP requests.
To learn more about GraphQL, you can refer to the GraphQL documentation
This example uses the requests library to make HTTP requests to the Honeydew API. To install it, run:
The above will produce the following kind of output:
The above examples are basic and do not include error handling. In production code, you should handle errors and exceptions appropriately. We recommended using a graphql client library for more complex queries and mutations.

GraphQL API Reference

Workspaces and Branches

Workspace/Branch Headers: Not requiredPermissions: Viewer or higher
GraphQL Query
This mutation creates a new branch in the specified workspace.Workspace/Branch Headers: Not requiredPermissions: Editor or higher
GraphQL Mutation
Successful Result Example
Error Example
This mutation syncs a specific entity’s table from its source, refreshing the metadata in the semantic layer.Workspace/Branch Headers: RequiredPermissions: Editor or higherParameters:
  • dataset_object_key: The object key of the dataset to sync. You can find dataset object keys by querying the entity’s fields and looking for the DataSet type’s object_key field.
GraphQL Mutation
This mutation syncs all tables from their sources, refreshing the metadata in the semantic layer.Workspace/Branch Headers: RequiredPermissions: Editor or higher
GraphQL Mutation
This mutation reloads the specified workspace from Git.Workspace/Branch Headers: RequiredPermissions: Viewer or higher
GraphQL Mutation
Result Example
This mutation reloads all workspaces from Git.Workspace/Branch Headers: Not requiredPermissions: Viewer or higher
GraphQL Mutation
Result Example
This mutation reloads a workspace from Git for all users. This is useful for ensuring that all users see the latest changes in the workspace.Workspace/Branch Headers: RequiredPermissions: Admin
GraphQL Mutation
Result Example
This mutation reloads all workspaces from Git for all users. This is useful for ensuring that all users see the latest changes in all workspaces, in particular after a workspace was added or deleted.Workspace/Branch Headers: Not requiredPermissions: Admin
GraphQL Mutation
Result Example

Querying Schema

Workspace/Branch Headers: RequiredPermissions: Viewer or higher
GraphQL Query
Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • entity_name: The name of the entity to retrieve
GraphQL Query
Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • entity_name: The name of the entity to retrieve the field from
  • name: The name of the field to retrieve
GraphQL Query
Workspace/Branch Headers: RequiredPermissions: Viewer or higher
GraphQL Query
Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • name: The name of the domain to retrieve
GraphQL Query
Workspace/Branch Headers: RequiredPermissions: Viewer or higher
GraphQL Query
Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • name: The name of the global parameter to retrieve
GraphQL Query
Workspace/Branch Headers: RequiredPermissions: Viewer or higher
GraphQL Query
Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • name: The name of the dynamic dataset to retrieve
GraphQL Query

Validate a Workspace

Use these queries to validate a workspace in a CI/CD pipeline: reload the branch from Git, confirm the workspace loads, then check every object for errors. This is the same sequence run by the GitHub Action; see CI/CD Overview for using it with other CI/CD systems. All calls below require the X-Honeydew-Workspace and X-Honeydew-Branch headers, and the Viewer role or higher. A pipeline runs them in the order shown and fails the step if any error is found. 1. Reload the branch from Git so validation reflects the latest commit of the branch:
GraphQL Mutation
2. Check the workspace for load errors. If the workspace fails to load (for example, a YAML parse error), the per-object checks are not meaningful — report these errors first:
GraphQL Query
3. Check objects for validation errors. This query returns every entity, so that field-level errors surface even inside otherwise-valid entities. Domains, perspectives, and parameters use the has_errors: true argument, so they return only the objects that fail validation. Treat the workspace as failing if any entity has a non-null error, any entity returns fields, or any domain, perspective, or parameter is returned:
GraphQL Query
4. Check context items and agents. Context items (instructions and memories) and agents report errors under validation_errors; both use has_errors: true, so any returned object is a failure:
GraphQL Query

Modifying Schema

Workspace/Branch Headers: RequiredPermissions: Editor or higherParameters:
  • yaml: The YAML definition of the object to create. See references for YAML schema here.
  • force_with_error:
    • If false, the mutation will fail if the deletion causes the workspace to become invalid (For example, if the object is used by another object in the workspace).
    • If true, the mutation will delete the object even if it causes the workspace to become invalid. This is useful if you are performing a set of changes that will eventually make the workspace valid again.
Return Value:The mutation returns the created object, or an error if the creation failed. You can use qualifiers to get specific fields of the object, such as name, error, etc.
GraphQL Mutation
Workspace/Branch Headers: RequiredPermissions: Editor or higherParameters:
  • yaml: The YAML definition of the object to update. See references for YAML schema here.
  • object_key: The key of the object to update. This is the object_key field that can be retrieved in any query on objects.
  • force_with_error:
    • If false, the mutation will fail if the deletion causes the workspace to become invalid (For example, if the object is used by another object in the workspace).
    • If true, the mutation will delete the object even if it causes the workspace to become invalid. This is useful if you are performing a set of changes that will eventually make the workspace valid again.
Return Value:The mutation returns the updated object, or an error if the update failed. You can use qualifiers to get specific fields of the object, such as name, error, etc.
GraphQL Mutation
Workspace/Branch Headers: RequiredPermissions: Editor or higherParameters:
  • object_key: The key of the object to delete.
  • force_with_error:
    • If false, the mutation will fail if the deletion causes the workspace to become invalid (For example, if the object is used by another object in the workspace).
    • If true, the mutation will delete the object even if it causes the workspace to become invalid. This is useful if you are performing a set of changes that will eventually make the workspace valid again.
GraphQL Mutation

Deployment

Deploy a dynamic dataset according to its deployment settings. Use this for aggregate aware caching and incremental aggregate updates.Workspace/Branch Headers: RequiredPermissions: Editor or higherParameters:
  • perspective_name: The name of the dynamic dataset to deploy
Return Value: Returns the SQL query used to select from the deployed dynamic dataset.
GraphQL Mutation
Result Example
Deploy an entity according to its deployment settings, to update the entity cache.Workspace/Branch Headers: RequiredPermissions: Editor or higherParameters:
  • entity_name: The name of the entity to deploy
Return Value: Returns the SQL query used to select from the deployed entity cache.
GraphQL Mutation
Result Example
Refresh the data for a dynamic dataset that has already been deployed.
  • For views: no-op, returns false.
  • For tables: redeploys the table with fresh data, returns true.
  • For dynamic tables (Snowflake only): triggers an incremental refresh, returns true.
Workspace/Branch Headers: RequiredPermissions: Editor or higherParameters:
  • perspective_name: The name of the dynamic dataset to refresh
Return Value: Returns true if data was refreshed, false if no refresh was needed.
GraphQL Mutation
Result Example
Clears the deployed cache status so Honeydew re-evaluates cache validity on the next query.
Honeydew scans the data warehouse information schema to check the validity of caches. If an entity or dynamic dataset used for caching was rebuilt or replaced outside Honeydew (for example, via a third-party tool), call this mutation to notify Honeydew that the cache was updated.
Workspace/Branch Headers: RequiredPermissions: Editor or higherReturn Value: Returns null.
GraphQL Mutation
Result Example

Queries

Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • yaml_text: YAML definition of a dynamic dataset, which represents a query. For more information on the YAML format, see Dynamic Dataset YAML. Here’s an example of a simple dynamic dataset YAML:
Return Value:
  • domain: The domain to use for the query (if applicable), as extracted from the SQL query.
  • dwh_role: The Snowflake role to use for the query, based on the definitions in the workspace, branch and the domain.
  • dwh_warehouse: The Snowflake warehouse to use for the query, based on the definitions in the workspace, branch and the domain.
  • sql: A list of the actual Snowflake SQL queries to run, translated from the provided SQL query by the Honeydew semantic layer. Note that there can be multiple sql statements to run, for example - there might be a SET statement to set values for parameters used in the sql query.
GraphQL Query
Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • sql: The SQL query to translate. This should be a valid SQL query in Trino dialect. For more information, see SQL Interface documentation. Here’s an example of a simple sql query to translate:
Return Value:
  • domain: The domain to use for the query (if applicable), as extracted from the SQL query.
  • dwh_role: The Snowflake role to use for the query, based on the definitions in the workspace, branch and the domain.
  • dwh_warehouse: The Snowflake warehouse to use for the query, based on the definitions in the workspace, branch and the domain.
  • sql: A list of the actual Snowflake SQL queries to run, translated from the provided SQL query by the Honeydew semantic layer. Note that there can be multiple sql statements to run, for example - there might be a SET statement to set values for parameters used in the sql query.
GraphQL Query

AI

This query allows you to ask a question to the AI and get a response in the form of a dynamic dataset and a SQL query. You can use this to ask questions about your data and get a response in a structured format. You can subsequently run the SQL query to get the data.Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • question: The data question to ask the AI
  • domain_name: The name of the domain to use for the question
  • llm_name: The name of the LLM to use for the question, or null to use the default LLM configured in the domain. This will use the model provider or runner configured for the workspace.
  • default_results_limit: The default limit for the number of results to return
  • temperature: The temperature to use for the LLM response. Pass null to use the default temperature configured.
  • max_tokens: The maximum number of tokens to return in the LLM response. Pass null to use the default max tokens configured.
  • conversation_id: The ID of the conversation to use for the question. Can be used in subsequent questions to continue the conversation with follow-up questions. Subsequent questions with same conversation_id will use the context of the entire thread. If null is provided, a new conversation will be created.
  • include_judge: If true, the response will include an explanation and correctness evaluation of the LLM response.
Return Value:
  • error: An error message if the question failed, or null if the question succeeded.
  • input_tokens: The number of input tokens used by the LLM.
  • judge: An object containing the explanation and correctness evaluation of the LLM response, if include_judge is true.
    • explanation: The explanation of the LLM response.
    • is_correct: A status indicating whether the LLM response is correct. Can be yes, no, partially or unknown.
    • runtime_ms: The runtime of the LLM response in milliseconds.
  • llm_response: The raw LLM response as a string.
  • llm_response_json: The LLM response as a JSON object, if applicable.
  • output_tokens: The number of output tokens generated by the LLM.
  • dynamic_dataset: The dynamic dataset generated by the LLM response, if applicable.
  • question_id: The ID of the question.
  • runtime_ms: The runtime of the question in milliseconds.
  • sql: The SQL query generated by the LLM response, if applicable.
GraphQL Query
This mutation creates a new chat session for deep analysis questions.Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • agent: Required. The name of the agent to run the analysis with. The agent supplies both the domain to query and the context items loaded into the session.
  • show_charts: Whether the analysis produces charts. Defaults to true.
Return Value:
  • chat_id: The ID of the created chat session
  • domain: The domain the agent is scoped to
  • ui_url: The URL of the chat in the Honeydew UI
GraphQL Query
To find the agent name to pass, list the agents in the workspace along with the domain each one is built on:
GraphQL Query
This mutation runs a multi-step agentic analysis question, using the semantic layer as the source of truth. It blocks until the analysis completes (up to 5 minutes).The response includes markdown text, tabular data, and chart visualizations produced during the analysis.Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • chat_id: The ID of the conversation to use for the question
  • question: The deep analysis question to ask the AI
Return Value:
  • response: A list of content items produced by the analysis. Each item is one of:
    • MarkdownContent: Textual analysis with text and category (final_conclusion, interpretation, plan, or user_response)
    • DataContent: Tabular data with results (columns and rows)
    • GraphContent: A chart. vega_lite is a complete Vega-Lite specification with the data embedded, so it renders as-is. visualization_hint describes the intended chart in natural language, and group_name groups related content. Also select data to get the rows on their own, to render with a different charting library.
  • suggested_responses: A list of suggested follow-up questions
  • ui_url: The URL of the chat in the Honeydew UI
GraphQL Query
This mutation aborts a running deep analysis chat, stopping any in-progress analysis. Use it to cancel a long-running question before it completes.Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • chat_id: The ID of the chat session to abort
Return Value:
  • null on success
  • FailureResult with error_code and message on error
GraphQL Query
Returns a paginated list of AI questions asked in the workspace, with filtering support.Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • limit: Maximum number of results to return (up to 1000)
  • offset: Number of results to skip for pagination
  • params: Optional filter parameters:
    • domain: Filter by domain name(s)
    • llm_model: Filter by LLM model name(s)
    • conversation_id: Filter by conversation ID(s)
    • asked_by: Filter by user display name(s)
    • client: Filter by client name(s)
    • agent: Filter by agent name(s)
    • status: Filter by response status (FINISHED or FAILED)
    • from_execution_time: Filter by start time (inclusive)
    • to_execution_time: Filter by end time (inclusive)
    • question: Filter by question text (partial match)
    • llm_response: Filter by LLM response text (partial match)
    • has_feedback: Filter to questions whose chat has user feedback
Return Value:A list of AnalystResponse objects. Each object includes:
  • question_id: Unique ID for the question
  • response_type: QUICK_ANALYSIS or DEEP_ANALYSIS
  • question: The question text
  • asked_by: Display name of the user who asked the question
  • client: The client identifier set in the X-Honeydew-Client header
  • agent: The agent that handled the question, if applicable
  • conversation_id: The ID of the deep analysis chat this question belongs to
  • execution_time: When the question was executed
  • creation_time: When the question record was created
  • llm_model: The LLM model used to answer the question
  • status: FINISHED or FAILED
  • sql: The generated SQL, if applicable
  • error: Error message if the question failed
  • runtime_ms: Total time to answer the question, in milliseconds
  • chat_title: The title of the deep analysis chat, if applicable
  • user_feedback: User feedback submitted on the chat, if applicable
GraphQL Query
Example: Filter by feedback

Publish to BI Tools

Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • domain: The domain to retrieve the Looker LookML for
Return Value: Returns the Looker LookML for the domain as a string. For more information, see the Looker Metadata Sync documentation.
GraphQL Query
Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • domain: The domain to retrieve the ThoughtSpot TML for
  • connection_name: The name of the Honeydew connection in ThoughtSpot to use
Return Value: Returns the ThoughtSpot TML for the domain as a string. For more information, see the ThoughtSpot Metadata Sync documentation.
GraphQL Query
Workspace/Branch Headers: RequiredPermissions: Viewer or higherParameters:
  • domain: The domain to retrieve the Lightdash model for
Return Value: Returns the Lightdash model for the domain as a string. For more information, see the Lightdash Metadata Sync documentation.
GraphQL Query
Missing an API query or mutation? If you need a specific query or mutation that is not covered in this guide, please reach out to support@honeydew.ai